diff options
author | unknown <aelkin@dl145j.mysql.com> | 2007-09-15 21:25:56 +0200 |
---|---|---|
committer | unknown <aelkin@dl145j.mysql.com> | 2007-09-15 21:25:56 +0200 |
commit | e35c1ab9a287264ec167f6c17c690aabbf921715 (patch) | |
tree | fc09beb28356b1412aac29629c639e209c908fe6 /sql | |
parent | 48f38afb8ee84ea6a08710374a54098581683444 (diff) | |
parent | 69604f4db10f125651ab0620320dbd91253c5bc6 (diff) | |
download | mariadb-git-e35c1ab9a287264ec167f6c17c690aabbf921715.tar.gz |
Merge dl145j.mysql.com:/tmp/andrei/mysql-5.0-rpl
into dl145j.mysql.com:/tmp/andrei/5.1-merge
BitKeeper/deleted/.del-sp_trans_log.result:
Auto merged
BitKeeper/deleted/.del-sp_trans_log.test:
Auto merged
mysql-test/suite/rpl/r/rpl_packet.result:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_update.cc:
Auto merged
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
should be re-recorded
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
manual merge
mysql-test/suite/rpl/t/rpl_packet.test:
manual merge
sql/slave.cc:
manual merge
sql/sql_insert.cc:
manual merge - installing 5.0 patch logics
sql/sql_load.cc:
manual merge
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_delete.cc | 6 | ||||
-rw-r--r-- | sql/sql_insert.cc | 87 | ||||
-rw-r--r-- | sql/sql_load.cc | 2 | ||||
-rw-r--r-- | sql/sql_update.cc | 2 |
4 files changed, 48 insertions, 49 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 303918f42a2..d5e88ab8761 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -345,7 +345,7 @@ cleanup: thd->transaction.stmt.modified_non_trans_table= TRUE; /* See similar binlogging code in sql_update.cc, for comments */ - if ((error < 0) || (deleted && !transactional_table)) + if ((error < 0) || thd->transaction.stmt.modified_non_trans_table) { if (mysql_bin_log.is_open()) { @@ -862,7 +862,8 @@ bool multi_delete::send_eof() { query_cache_invalidate3(thd, delete_tables, 1); } - if ((local_error == 0) || (deleted && normal_tables)) + DBUG_ASSERT(!normal_tables || !deleted || thd->transaction.stmt.modified_non_trans_table); + if ((local_error == 0) || thd->transaction.stmt.modified_non_trans_table) { if (mysql_bin_log.is_open()) { @@ -879,7 +880,6 @@ bool multi_delete::send_eof() if (thd->transaction.stmt.modified_non_trans_table) thd->transaction.all.modified_non_trans_table= TRUE; } - DBUG_ASSERT(!normal_tables || !deleted || thd->transaction.stmt.modified_non_trans_table); /* Commit or rollback the current SQL statement */ if (transactional_tables) diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 157309a3366..16ad280c690 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -839,59 +839,58 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, } transactional_table= table->file->has_transactions(); - if ((changed= (info.copied || info.deleted || info.updated)) || - was_insert_delayed) + if ((changed= (info.copied || info.deleted || info.updated))) { /* Invalidate the table in the query cache if something changed. For the transactional algorithm to work the invalidation must be before binlog writing and ha_autocommit_or_rollback */ - if (changed) - query_cache_invalidate3(thd, table_list, 1); - if (error <= 0 || !transactional_table) + query_cache_invalidate3(thd, table_list, 1); + } + if (changed && error <= 0 || thd->transaction.stmt.modified_non_trans_table + || was_insert_delayed) + { + if (mysql_bin_log.is_open()) { - if (mysql_bin_log.is_open()) + if (error <= 0) { - if (error <= 0) - { - /* - [Guilhem wrote] Temporary errors may have filled - thd->net.last_error/errno. For example if there has - been a disk full error when writing the row, and it was - MyISAM, then thd->net.last_error/errno will be set to - "disk full"... and the my_pwrite() will wait until free - space appears, and so when it finishes then the - write_row() was entirely successful - */ - /* todo: consider removing */ - thd->clear_error(); - } - /* bug#22725: - - A query which per-row-loop can not be interrupted with - KILLED, like INSERT, and that does not invoke stored - routines can be binlogged with neglecting the KILLED error. - - If there was no error (error == zero) until after the end of - inserting loop the KILLED flag that appeared later can be - disregarded since previously possible invocation of stored - routines did not result in any error due to the KILLED. In - such case the flag is ignored for constructing binlog event. - */ - DBUG_ASSERT(thd->killed != THD::KILL_BAD_DATA || error > 0); - if (thd->binlog_query(THD::ROW_QUERY_TYPE, - thd->query, thd->query_length, - transactional_table, FALSE, - (error>0) ? thd->killed : THD::NOT_KILLED) && - transactional_table) - { - error=1; - } - } - if (thd->transaction.stmt.modified_non_trans_table) - thd->transaction.all.modified_non_trans_table= TRUE; + /* + [Guilhem wrote] Temporary errors may have filled + thd->net.last_error/errno. For example if there has + been a disk full error when writing the row, and it was + MyISAM, then thd->net.last_error/errno will be set to + "disk full"... and the my_pwrite() will wait until free + space appears, and so when it finishes then the + write_row() was entirely successful + */ + /* todo: consider removing */ + thd->clear_error(); + } + /* bug#22725: + + A query which per-row-loop can not be interrupted with + KILLED, like INSERT, and that does not invoke stored + routines can be binlogged with neglecting the KILLED error. + + If there was no error (error == zero) until after the end of + inserting loop the KILLED flag that appeared later can be + disregarded since previously possible invocation of stored + routines did not result in any error due to the KILLED. In + such case the flag is ignored for constructing binlog event. + */ + DBUG_ASSERT(thd->killed != THD::KILL_BAD_DATA || error > 0); + if (thd->binlog_query(THD::ROW_QUERY_TYPE, + thd->query, thd->query_length, + transactional_table, FALSE, + (error>0) ? thd->killed : THD::NOT_KILLED) && + transactional_table) + { + error=1; + } } + if (thd->transaction.stmt.modified_non_trans_table) + thd->transaction.all.modified_non_trans_table= TRUE; } DBUG_ASSERT(transactional_table || !changed || thd->transaction.stmt.modified_non_trans_table); diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 8bbe1e413b3..23547349a37 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -445,7 +445,7 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, /* If the file was not empty, wrote_create_file is true */ if (lf_info.wrote_create_file) { - if ((info.copied || info.deleted) && !transactional_table) + if (thd->transaction.stmt.modified_non_trans_table) write_execute_load_query_log_event(thd, handle_duplicates, ignore, transactional_table); else diff --git a/sql/sql_update.cc b/sql/sql_update.cc index cb3f2fece89..0a6bbc2d0ea 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -797,7 +797,7 @@ int mysql_update(THD *thd, Sometimes we want to binlog even if we updated no rows, in case user used it to be sure master and slave are in same state. */ - if ((error < 0) || (updated && !transactional_table)) + if ((error < 0) || thd->transaction.stmt.modified_non_trans_table) { if (mysql_bin_log.is_open()) { |