summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 51b44af63ec..4fb85d9bab7 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -422,7 +422,7 @@ mysql_find_files(THD *thd,List<char> *files, const char *db,const char *path,
{
if (lower_case_table_names)
{
- if (wild_case_compare(system_charset_info,file->name,wild))
+ if (wild_case_compare(files_charset_info, file->name, wild))
continue;
}
else if (wild_compare(file->name,wild,0))
@@ -1597,10 +1597,13 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
thd_info->query=0;
if (tmp->query)
{
- /* query_length is always set before tmp->query */
+ /*
+ query_length is always set to 0 when we set query = NULL; see
+ the comment in sql_class.h why this prevents crashes in possible
+ races with query_length
+ */
uint length= min(max_query_length, tmp->query_length);
- thd_info->query=(char*) thd->memdup(tmp->query,length+1);
- thd_info->query[length]=0;
+ thd_info->query=(char*) thd->strmake(tmp->query,length);
}
thread_infos.append(thd_info);
}