1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Bug #40877: multi statement execution fails in 5.1.30

Implemented the server infrastructure for the fix:

1. Added a function LEX_STRING *thd_query_string(THD) to return
a LEX_STRING structure instead of char *.
This is the function that must be called in innodb instead of 
thd_query()

2. Did some encapsulation in THD : aggregated thd_query and 
thd_query_length into a LEX_STRING and made accessor and mutator 
methods for easy code updating. 

3. Updated the server code to use the new methods where applicable.
This commit is contained in:
Georgi Kodinov
2009-10-16 13:29:42 +03:00
parent d7cc9194e0
commit 7b4ef910f7
32 changed files with 185 additions and 155 deletions

View File

@ -1864,10 +1864,10 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
thd_info->query=0;
/* Lock THD mutex that protects its data when looking at it. */
pthread_mutex_lock(&tmp->LOCK_thd_data);
if (tmp->query)
if (tmp->query())
{
uint length= min(max_query_length, tmp->query_length);
thd_info->query=(char*) thd->strmake(tmp->query,length);
uint length= min(max_query_length, tmp->query_length());
thd_info->query= (char*) thd->strmake(tmp->query(),length);
}
pthread_mutex_unlock(&tmp->LOCK_thd_data);
thread_infos.append(thd_info);
@ -1992,11 +1992,11 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond)
pthread_mutex_unlock(&mysys_var->mutex);
/* INFO */
if (tmp->query)
if (tmp->query())
{
table->field[7]->store(tmp->query,
table->field[7]->store(tmp->query(),
min(PROCESS_LIST_INFO_WIDTH,
tmp->query_length), cs);
tmp->query_length()), cs);
table->field[7]->set_notnull();
}