Commit b6464dda authored by Jimmy Yang's avatar Jimmy Yang

Fix Bug #55397 cannot select from innodb_trx when trx_query contains blobs

that aren't strings

rb://560 approved by Sunny Bains
parent 2cf90cb3
2011-01-06 The InnoDB Team
* handler/i_s.cc, include/trx0i_s.h, trx/trx0i_s.c:
Fix Bug#55397 cannot select from innodb_trx when trx_query contains
blobs that aren't strings
2011-01-04 The InnoDB Team
* dict/dict0dict.c:
Fix Bug#59197 double quote in field comment prevents foreign
......
......@@ -371,8 +371,16 @@ fill_innodb_trx_from_cache(
row->trx_mysql_thread_id));
/* trx_query */
OK(field_store_string(fields[IDX_TRX_QUERY],
row->trx_query));
if (row->trx_query) {
/* store will do appropriate character set
conversion check */
fields[IDX_TRX_QUERY]->store(
row->trx_query, strlen(row->trx_query),
row->trx_query_cs);
fields[IDX_TRX_QUERY]->set_notnull();
} else {
fields[IDX_TRX_QUERY]->set_null();
}
OK(schema_table_store_record(thd, table));
}
......
......@@ -110,6 +110,8 @@ struct i_s_trx_row_struct {
/*!< thd_get_thread_id() */
const char* trx_query; /*!< MySQL statement being
executed in the transaction */
struct charset_info_st* trx_query_cs; /*!< charset encode the MySQL
statement */
};
/** This structure represents INFORMATION_SCHEMA.innodb_lock_waits row */
......
......@@ -498,7 +498,6 @@ fill_trx_row(
stmt = innobase_get_stmt(trx->mysql_thd, &stmt_len);
if (stmt != NULL) {
char query[TRX_I_S_TRX_QUERY_MAX_LEN + 1];
if (stmt_len > TRX_I_S_TRX_QUERY_MAX_LEN) {
......@@ -512,6 +511,8 @@ fill_trx_row(
cache->storage, stmt, stmt_len + 1,
MAX_ALLOWED_FOR_STORAGE(cache));
row->trx_query_cs = innobase_get_charset(trx->mysql_thd);
if (row->trx_query == NULL) {
return(FALSE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment