diff options
author | unknown <heikki@hundin.mysql.fi> | 2003-05-26 19:10:43 +0300 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2003-05-26 19:10:43 +0300 |
commit | cf381ae46b639a9f928a706e7268214aac8b5b48 (patch) | |
tree | 1350dc4877b9878316638fceb4a88709e7cda9d7 /sql/sql_delete.cc | |
parent | 720584b0c6eb435fa87b5da42578f214d83735d1 (diff) | |
download | mariadb-git-cf381ae46b639a9f928a706e7268214aac8b5b48.tar.gz |
ha_innodb.cc:
Remove accidenatlly committed debug printfs when query cache is used
sql_update.cc, sql_load.cc, sql_insert.cc, sql_delete.cc:
For the transactional query cache algorithm to work we must invalidate the query cache in INSERT/DELETE/UPDATE before writing to the binlog or calling ha_autocommit_... Note that binlog writing may also call commit. The crucial thing is that the transaction which modified data must not be committed BEFORE the query cache is invalidated.
sql/sql_delete.cc:
For the transactional query cache algorithm to work we must invalidate the query cache in INSERT/DELETE/UPDATE before writing to the binlog or calling ha_autocommit_... Note that binlog writing may also call commit. The crucial thing is that the transaction which modified data must not be committed BEFORE the query cache is invalidated.
sql/sql_insert.cc:
For the transactional query cache algorithm to work we must invalidate the query cache in INSERT/DELETE/UPDATE before writing to the binlog or calling ha_autocommit_... Note that binlog writing may also call commit. The crucial thing is that the transaction which modified data must not be committed BEFORE the query cache is invalidated.
sql/sql_load.cc:
For the transactional query cache algorithm to work we must invalidate the query cache in INSERT/DELETE/UPDATE before writing to the binlog or calling ha_autocommit_... Note that binlog writing may also call commit. The crucial thing is that the transaction which modified data must not be committed BEFORE the query cache is invalidated.
sql/sql_update.cc:
For the transactional query cache algorithm to work we must invalidate the query cache in INSERT/DELETE/UPDATE before writing to the binlog or calling ha_autocommit_... Note that binlog writing may also call commit. The crucial thing is that the transaction which modified data must not be committed BEFORE the query cache is invalidated.
sql/ha_innodb.cc:
Remove accidenatlly committed debug printfs when query cache is used
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r-- | sql/sql_delete.cc | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index a12f6efb006..9c1743eeb12 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -178,6 +178,15 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ORDER *order, (void) table->file->extra(HA_EXTRA_NORMAL); cleanup: + /* + Invalidate the table in the query cache if something changed. This must + be before binlog writing and ha_autocommit_... + */ + if (deleted) + { + query_cache_invalidate3(thd, table_list, 1); + } + transactional_table= table->file->has_transactions(); log_delayed= (transactional_table || table->tmp_table); if (deleted && (error <= 0 || !transactional_table)) @@ -199,14 +208,6 @@ cleanup: error=1; } - /* - Store table for future invalidation or invalidate it in - the query cache if something changed - */ - if (deleted) - { - query_cache_invalidate3(thd, table_list, 1); - } if (thd->lock) { mysql_unlock_tables(thd, thd->lock); @@ -480,6 +481,10 @@ bool multi_delete::send_eof() /* reset used flags */ thd->proc_info="end"; + /* We must invalidate the query cache before binlog writing and + ha_autocommit_... */ + if (deleted) + query_cache_invalidate3(thd, delete_tables, 1); /* Write the SQL statement to the binlog if we deleted @@ -504,9 +509,6 @@ bool multi_delete::send_eof() if (transactional_tables) if (ha_autocommit_or_rollback(thd,local_error > 0)) local_error=1; - - if (deleted) - query_cache_invalidate3(thd, delete_tables, 1); if (local_error) ::send_error(thd); |