mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug #27395 OPTION_STATUS_NO_TRANS_UPDATE is not preserved at the end of SF()
thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit was not restored at the end of SF() invocation, where SF() modified non-ta table. As the result of this artifact it was not possible to detect whether there were any side-effects when top-level query ends. If the top level query table was not modified and the bit is lost there would be no binlogging. Fixed with preserving the bit inside of thd->no_trans_update struct. The struct agregates two bool flags telling whether the current query and the current transaction modified any non-ta table. The flags stmt, all are dropped at the end of the query and the transaction. mysql-test/r/sp_trans.result: results will be changed once again after bug#23333 will be fixed. mysql-test/t/sp_trans.test: regression test added sql/ha_ndbcluster.cc: replacing thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit and bool thd->no_trans_update with thd->no_trans_update as struct sql/handler.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/log.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/set_var.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sp_head.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_class.h: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_delete.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_insert.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_load.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_parse.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_table.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools. sql/sql_update.cc: replacing operations with thd->options' OPTION_STATUS_NO_TRANS_UPDATE bit with the member thd->no_trans_update.all; converting thd->no_trans_update into struct of bools.
This commit is contained in:
@ -377,7 +377,7 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
|
||||
table->file->start_bulk_insert((ha_rows) 0);
|
||||
table->copy_blobs=1;
|
||||
|
||||
thd->no_trans_update= 0;
|
||||
thd->no_trans_update.stmt= FALSE;
|
||||
thd->abort_on_warning= (!ignore &&
|
||||
(thd->variables.sql_mode &
|
||||
(MODE_STRICT_TRANS_TABLES |
|
||||
@ -467,7 +467,7 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
|
||||
(ulong) (info.records - info.copied), (ulong) thd->cuted_fields);
|
||||
|
||||
if (!transactional_table)
|
||||
thd->options|=OPTION_STATUS_NO_TRANS_UPDATE;
|
||||
thd->no_trans_update.all= TRUE;
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
if (mysql_bin_log.is_open())
|
||||
{
|
||||
@ -531,7 +531,7 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
|
||||
Item_field *sql_field;
|
||||
TABLE *table= table_list->table;
|
||||
ulonglong id;
|
||||
bool no_trans_update;
|
||||
bool no_trans_update_stmt;
|
||||
DBUG_ENTER("read_fixed_length");
|
||||
|
||||
id= 0;
|
||||
@ -559,7 +559,7 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
|
||||
#ifdef HAVE_purify
|
||||
read_info.row_end[0]=0;
|
||||
#endif
|
||||
no_trans_update= !table->file->has_transactions();
|
||||
no_trans_update_stmt= !table->file->has_transactions();
|
||||
|
||||
restore_record(table, s->default_values);
|
||||
/*
|
||||
@ -627,7 +627,7 @@ read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
|
||||
|
||||
if (write_record(thd, table, &info))
|
||||
DBUG_RETURN(1);
|
||||
thd->no_trans_update= no_trans_update;
|
||||
thd->no_trans_update.stmt= no_trans_update_stmt;
|
||||
|
||||
/*
|
||||
If auto_increment values are used, save the first one for
|
||||
@ -670,12 +670,12 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
|
||||
TABLE *table= table_list->table;
|
||||
uint enclosed_length;
|
||||
ulonglong id;
|
||||
bool no_trans_update;
|
||||
bool no_trans_update_stmt;
|
||||
DBUG_ENTER("read_sep_field");
|
||||
|
||||
enclosed_length=enclosed.length();
|
||||
id= 0;
|
||||
no_trans_update= !table->file->has_transactions();
|
||||
no_trans_update_stmt= !table->file->has_transactions();
|
||||
|
||||
for (;;it.rewind())
|
||||
{
|
||||
@ -817,7 +817,7 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
|
||||
We don't need to reset auto-increment field since we are restoring
|
||||
its default value at the beginning of each loop iteration.
|
||||
*/
|
||||
thd->no_trans_update= no_trans_update;
|
||||
thd->no_trans_update.stmt= no_trans_update_stmt;
|
||||
if (read_info.next_line()) // Skip to next line
|
||||
break;
|
||||
if (read_info.line_cuted)
|
||||
|
Reference in New Issue
Block a user