diff options
author | unknown <monty@mashka.mysql.fi> | 2003-03-16 16:30:54 +0200 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2003-03-16 16:30:54 +0200 |
commit | bfbb0ad69df21854f2db5fb2b9c708b2a576929e (patch) | |
tree | f6d63b9728c1157c31c1f74bbe32bc1e50de79b8 /sql/sql_insert.cc | |
parent | f08688c5ee2aed851f92393b06b1b704ef0dd118 (diff) | |
parent | 9681f4a8cd242e3828f211e0bed5235e70ee5f4e (diff) | |
download | mariadb-git-bfbb0ad69df21854f2db5fb2b9c708b2a576929e.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into mashka.mysql.fi:/home/my/mysql-4.0
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r-- | sql/sql_insert.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 9f1a0e93cb9..ace15771449 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1361,6 +1361,14 @@ bool select_insert::send_eof() if (!(error=table->file->extra(HA_EXTRA_NO_CACHE))) error=table->file->activate_all_index(thd); table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); + + /* Write to binlog before commiting transaction */ + if (mysql_bin_log.is_open()) + { + Query_log_event qinfo(thd, thd->query, thd->query_length, + table->file->has_transactions()); + mysql_bin_log.write(&qinfo); + } if ((error2=ha_autocommit_or_rollback(thd,error)) && ! error) error=error2; if (info.copied || info.deleted) @@ -1386,12 +1394,6 @@ bool select_insert::send_eof() thd->insert_id(last_insert_id); // For update log ::send_ok(&thd->net,info.copied,last_insert_id,buff); mysql_update_log.write(thd,thd->query,thd->query_length); - if (mysql_bin_log.is_open()) - { - Query_log_event qinfo(thd, thd->query, thd->query_length, - table->file->has_transactions()); - mysql_bin_log.write(&qinfo); - } return 0; } } |