diff options
author | monty@hundin.mysql.fi <> | 2001-11-28 14:52:11 +0200 |
---|---|---|
committer | monty@hundin.mysql.fi <> | 2001-11-28 14:52:11 +0200 |
commit | 69f6802632a9f0027041b53b1fcff78c51503f33 (patch) | |
tree | b5ae91cc685e7d8ed845e9ecbcd94e7f8857ea7f /sql/sql_insert.cc | |
parent | 5fedd2dda72f59c1a00525862a093bdaf042d034 (diff) | |
parent | 41afc03a85b92ac9d3bfe81a633631f17832b461 (diff) | |
download | mariadb-git-69f6802632a9f0027041b53b1fcff78c51503f33.tar.gz |
merge
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r-- | sql/sql_insert.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 150ed503078..70cc5f412a1 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1126,7 +1126,7 @@ bool delayed_insert::handle_inserts(void) { int error; uint max_rows; - bool using_ignore=0; + bool using_ignore=0, using_bin_log=mysql_bin_log.is_open(); delayed_row *row; DBUG_ENTER("handle_inserts"); @@ -1151,7 +1151,13 @@ bool delayed_insert::handle_inserts(void) max_rows= ~0; // Do as much as possible } - table->file->extra(HA_EXTRA_WRITE_CACHE); + /* + We can't use row caching when using the binary log because if + we get a crash, then binary log will contain rows that are not yet + written to disk, which will cause problems in replication. + */ + if (!using_bin_log) + table->file->extra(HA_EXTRA_WRITE_CACHE); pthread_mutex_lock(&mutex); while ((row=rows.get())) { @@ -1188,7 +1194,7 @@ bool delayed_insert::handle_inserts(void) if (row->query && row->log_query) { mysql_update_log.write(&thd,row->query, row->query_length); - if (mysql_bin_log.is_open()) + if (using_bin_log) { thd.query_length = row->query_length; Query_log_event qinfo(&thd, row->query); @@ -1224,7 +1230,8 @@ bool delayed_insert::handle_inserts(void) /* This should never happen */ sql_print_error(ER(ER_DELAYED_CANT_CHANGE_LOCK),table->real_name); } - table->file->extra(HA_EXTRA_WRITE_CACHE); + if (!using_bin_log) + table->file->extra(HA_EXTRA_WRITE_CACHE); pthread_mutex_lock(&mutex); thd.proc_info="insert"; } |