summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorMarc Alff <marc.alff@oracle.com>2010-11-21 14:32:48 +0100
committerMarc Alff <marc.alff@oracle.com>2010-11-21 14:32:48 +0100
commit218ca24cd9f8261b2473de6792067de75d95ca31 (patch)
tree6f388bd43f36d4b3086f63dbcf97467ca95c61ff /sql/sql_show.cc
parent8afd96e4d4ec6498babb78f5b41215491660ca74 (diff)
parentf6deb00a56b2e87287d606aba3bcd71290d876ae (diff)
downloadmariadb-git-218ca24cd9f8261b2473de6792067de75d95ca31.tar.gz
local merge
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 19a73c85a9b..ec147a99553 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -671,7 +671,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;
@@ -1727,7 +1727,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
@@ -1824,12 +1824,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;
@@ -1857,7 +1859,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 */
}
@@ -3186,7 +3189,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)
{
@@ -7745,7 +7748,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.