summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2002-03-15 23:57:31 +0200
committerunknown <bell@sanja.is.com.ua>2002-03-15 23:57:31 +0200
commitec41bed58fe572eac819b594cd9e79206a6b9013 (patch)
tree691610fcbd4313eb2d79af0b91394cb2b9410f21 /sql/handler.cc
parentcf534d435dfb6721d560e44fe66ee92a71c2b96c (diff)
downloadmariadb-git-ec41bed58fe572eac819b594cd9e79206a6b9013.tar.gz
processing trunsactional tables in query cache
mysql-test/r/innodb_cache.result: new test for query cache with transactions mysql-test/t/innodb_cache.test: new test for query cache with transactions sql/sql_cache.cc: processing trunsactional tables in query cache & removing strlen sql/sql_class.cc: processing trunsactional tables in query cache & added transaction-live memory sql/sql_class.h: processing trunsactional tables in query cache & added transaction-live memory sql/sql_parse.cc: processing trunsactional tables in query cache & added transaction-live memory sql/table.h: removing strlen operation from query cache
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 8447797442c..2129162c427 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -271,7 +271,8 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans)
#ifdef USING_TRANSACTIONS
if (opt_using_transactions)
{
- bool operation_done=0;
+ bool operation_done= 0;
+ bool transaction_commited= 0;
/* Update the binary log if we have cached some queries */
if (trans == &thd->transaction.all && mysql_bin_log.is_open() &&
my_b_tell(&thd->transaction.trans_log))
@@ -289,6 +290,8 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans)
my_error(ER_ERROR_DURING_COMMIT, MYF(0), error);
error=1;
}
+ else
+ transaction_commited= 1;
trans->bdb_tid=0;
}
#endif
@@ -302,12 +305,12 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans)
}
trans->innodb_active_trans=0;
if (trans == &thd->transaction.all)
- {
- query_cache.invalidate(Query_cache_table::INNODB);
- operation_done=1;
- }
+ operation_done= transaction_commited= 1;
+
}
#endif
+ if (transaction_commited)
+ query_cache.invalidate(thd->transaction.changed_tables);
if (error && trans == &thd->transaction.all && mysql_bin_log.is_open())
sql_print_error("Error: Got error during commit; Binlog is not up to date!");
thd->tx_isolation=thd->session_tx_isolation;