summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-03-04 18:16:10 +0200
committerunknown <monty@mysql.com>2004-03-04 18:16:10 +0200
commit0b751edc57385e125415a3d0aa8f37ad772e7178 (patch)
tree23e1c598bde21cc2cb86a6228f23c9965a8633f5 /sql/sql_insert.cc
parenteadfe4ddfa810972daa323131f6cc1476eee8055 (diff)
downloadmariadb-git-0b751edc57385e125415a3d0aa8f37ad772e7178.tar.gz
Rollback UPDATE/DELETE statements on kill
nsure that rows in a multi-row INSERT DELAYED are inserted atomicly mysql-test/mysql-test-run.sh: Make test case safe for openserver/unixware (Bug #2700) sql/sql_delete.cc: Rollback statement on kill sql/sql_insert.cc: Ensure that rows in a multi-row INSERT DELAYED are inserted atomicly (without releasing logs). This is needed to ensure that the mysqlbinlog is consistent. Bug #2491 sql/sql_list.h: Ensure that rows in a multi-row INSERT DELAYED is inserted atomicly (without releasing logs). This is needed to ensure that the mysqlbinlog is consistent. Bug #2491 sql/sql_update.cc: Rollback statement on kill
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r--sql/sql_insert.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index bf3112bdf10..c6dcfd2c7dd 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1236,8 +1236,15 @@ bool delayed_insert::handle_inserts(void)
pthread_mutex_lock(&mutex);
delete row;
- /* Let READ clients do something once in a while */
- if (group_count++ == max_rows)
+ /*
+ Let READ clients do something once in a while
+ We should however not break in the middle of a multi-line insert
+ if we have binary logging enabled as we don't want other commands
+ on this table until all entries has been processed
+ */
+ if (group_count++ >= max_rows && (row= rows.head()) &&
+ (!(row->log_query & DELAYED_LOG_BIN && using_bin_log) ||
+ row->query))
{
group_count=0;
if (stacked_inserts || tables_in_use) // Let these wait a while