1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +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

@ -413,7 +413,7 @@ cleanup:
therefore be treated as a DDL.
*/
int log_result= thd->binlog_query(query_type,
thd->query, thd->query_length,
thd->query(), thd->query_length(),
is_trans, FALSE, errcode);
if (log_result)
@ -850,7 +850,7 @@ void multi_delete::abort()
{
int errcode= query_error_code(thd, thd->killed == THD::NOT_KILLED);
thd->binlog_query(THD::ROW_QUERY_TYPE,
thd->query, thd->query_length,
thd->query(), thd->query_length(),
transactional_tables, FALSE, errcode);
}
thd->transaction.all.modified_non_trans_table= true;
@ -1024,7 +1024,7 @@ bool multi_delete::send_eof()
else
errcode= query_error_code(thd, killed_status == THD::NOT_KILLED);
if (thd->binlog_query(THD::ROW_QUERY_TYPE,
thd->query, thd->query_length,
thd->query(), thd->query_length(),
transactional_tables, FALSE, errcode) &&
!normal_tables)
{
@ -1166,7 +1166,7 @@ end:
TRUNCATE must always be statement-based binlogged (not row-based) so
we don't test current_stmt_binlog_row_based.
*/
write_bin_log(thd, TRUE, thd->query, thd->query_length);
write_bin_log(thd, TRUE, thd->query(), thd->query_length());
my_ok(thd); // This should return record count
}
VOID(pthread_mutex_lock(&LOCK_open));