summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2002-11-23 15:52:56 +0200
committerunknown <Sinisa@sinisa.nasamreza.org>2002-11-23 15:52:56 +0200
commitf81084a2e0003f2d6ef1d263d8c312903966e8ff (patch)
tree3d747b93e586163a003bf3d4a9fa8b7bd31f7726 /sql
parentfe9bbec4c0c48a680dbfeecd4d334679bc7bd5d4 (diff)
parentfa76afe6edbc6572f179d1dcf859f013e85ef7dd (diff)
downloadmariadb-git-f81084a2e0003f2d6ef1d263d8c312903966e8ff.tar.gz
Merge sinisa@work.mysql.com:/home/bk/mysql-4.0
into sinisa.nasamreza.org:/mnt/work/mysql-4.0
Diffstat (limited to 'sql')
-rw-r--r--sql/handler.cc2
-rw-r--r--sql/sql_delete.cc10
-rw-r--r--sql/sql_insert.cc9
-rw-r--r--sql/sql_update.cc10
4 files changed, 12 insertions, 19 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index f07e90d2eb9..c4e742ef519 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -314,7 +314,7 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans)
}
#endif
#ifdef HAVE_QUERY_CACHE
- if (transaction_commited)
+ if (transaction_commited && thd->transaction.changed_tables)
query_cache.invalidate(thd->transaction.changed_tables);
#endif /*HAVE_QUERY_CACHE*/
if (error && trans == &thd->transaction.all && mysql_bin_log.is_open())
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 5f2d7e36a04..1361ff39388 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -179,14 +179,12 @@ cleanup:
if (ha_autocommit_or_rollback(thd,error >= 0))
error=1;
}
+
/*
- Only invalidate the query cache if something changed or if we
- didn't commit the transacion (query cache is automaticly
- invalidated on commit)
+ Store table for future invalidation or invalidate it in
+ the query cache if something changed
*/
- if (deleted &&
- (!transactional_table ||
- thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
+ if (deleted)
{
query_cache_invalidate3(thd, table_list, 1);
}
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 2508314c469..6ce2b50fc36 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -319,13 +319,10 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
error=ha_autocommit_or_rollback(thd,error);
/*
- Only invalidate the query cache if something changed or if we
- didn't commit the transacion (query cache is automaticly
- invalidated on commit)
+ Store table for future invalidation or invalidate it in
+ the query cache if something changed
*/
- if ((info.copied || info.deleted) &&
- (!transactional_table ||
- thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
+ if (info.copied || info.deleted)
{
query_cache_invalidate3(thd, table_list, 1);
}
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index b5263322301..97e6ea43bfd 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -318,14 +318,12 @@ int mysql_update(THD *thd,
if (ha_autocommit_or_rollback(thd, error >= 0))
error=1;
}
+
/*
- Only invalidate the query cache if something changed or if we
- didn't commit the transacion (query cache is automaticly
- invalidated on commit)
+ Store table for future invalidation or invalidate it in
+ the query cache if something changed
*/
- if (updated &&
- (!transactional_table ||
- thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
+ if (updated)
{
query_cache_invalidate3(thd, table_list, 1);
}