summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorRamil Kalimullin <ramil@mysql.com>2010-11-22 14:47:28 +0300
committerRamil Kalimullin <ramil@mysql.com>2010-11-22 14:47:28 +0300
commitbd557f04f644bda3b493c37225b169167eb6e11e (patch)
tree318334755d94aef3ee64545c0a4a566380f9162f /sql/sql_show.cc
parent3bae49d64ce0df04a85583b5dc680cda54760dbc (diff)
parent9d9699209d9ca66648db8aff46f6b66a4c1c18de (diff)
downloadmariadb-git-bd557f04f644bda3b493c37225b169167eb6e11e.tar.gz
Manual merge from mysql-5.5-bugteam.
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index dfb95583d9d..69f2ff240c2 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -673,7 +673,7 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list)
Metadata locks taken during SHOW CREATE should be released when
the statmement completes as it is an information statement.
*/
- MDL_ticket *mdl_savepoint= thd->mdl_context.mdl_savepoint();
+ MDL_savepoint mdl_savepoint= thd->mdl_context.mdl_savepoint();
/* We want to preserve the tree for views. */
thd->lex->view_prepare_mode= TRUE;
@@ -1736,7 +1736,7 @@ public:
time_t start_time;
uint command;
const char *user,*host,*db,*proc_info,*state_info;
- char *query;
+ CSET_STRING query_string;
};
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
@@ -1833,12 +1833,14 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
if (mysys_var)
mysql_mutex_unlock(&mysys_var->mutex);
- thd_info->query=0;
/* Lock THD mutex that protects its data when looking at it. */
if (tmp->query())
{
uint length= min(max_query_length, tmp->query_length());
- thd_info->query= (char*) thd->strmake(tmp->query(),length);
+ char *q= thd->strmake(tmp->query(),length);
+ /* Safety: in case strmake failed, we set length to 0. */
+ thd_info->query_string=
+ CSET_STRING(q, q ? length : 0, tmp->query_charset());
}
mysql_mutex_unlock(&tmp->LOCK_thd_data);
thd_info->start_time= tmp->start_time;
@@ -1866,7 +1868,8 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
else
protocol->store_null();
protocol->store(thd_info->state_info, system_charset_info);
- protocol->store(thd_info->query, system_charset_info);
+ protocol->store(thd_info->query_string.str(),
+ thd_info->query_string.charset());
if (protocol->write())
break; /* purecov: inspected */
}
@@ -3195,7 +3198,7 @@ try_acquire_high_prio_shared_mdl_lock(THD *thd, TABLE_LIST *table,
{
bool error;
table->mdl_request.init(MDL_key::TABLE, table->db, table->table_name,
- MDL_SHARED_HIGH_PRIO);
+ MDL_SHARED_HIGH_PRIO, MDL_TRANSACTION);
if (can_deadlock)
{
@@ -7754,7 +7757,7 @@ bool show_create_trigger(THD *thd, const sp_name *trg_name)
Metadata locks taken during SHOW CREATE TRIGGER should be released when
the statement completes as it is an information statement.
*/
- MDL_ticket *mdl_savepoint= thd->mdl_context.mdl_savepoint();
+ MDL_savepoint mdl_savepoint= thd->mdl_context.mdl_savepoint();
/*
Open the table by name in order to load Table_triggers_list object.