summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-05-26 20:48:40 +0300
committerunknown <monty@mashka.mysql.fi>2003-05-26 20:48:40 +0300
commitda9bf1dec30f9d1cda414d0a96ca93c11b1a77e7 (patch)
treed114eefb7420ba742d8c275a4841b0c8aeedaeb0 /sql
parent926add9c888941bb2d307cd325d10ffcf85a8775 (diff)
downloadmariadb-git-da9bf1dec30f9d1cda414d0a96ca93c11b1a77e7.tar.gz
ixed wrong unlock of tables (new bug)
sql/sql_delete.cc: Comment cleanup sql/sql_insert.cc: Comment cleanup sql/sql_load.cc: Comment cleanup sql/sql_update.cc: Fixed wrong unlock of tables. (Unlock must be done after writing to binary log
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_delete.cc6
-rw-r--r--sql/sql_insert.cc12
-rw-r--r--sql/sql_load.cc6
-rw-r--r--sql/sql_update.cc13
4 files changed, 18 insertions, 19 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 9c1743eeb12..ebb09b99df7 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -481,8 +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_... */
+ /*
+ We must invalidate the query cache before binlog writing and
+ ha_autocommit_...
+ */
if (deleted)
query_cache_invalidate3(thd, delete_tables, 1);
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 48cc6d4e254..1908f898a27 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -350,9 +350,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
before binlog writing and ha_autocommit_...
*/
if (info.copied || info.deleted)
- {
query_cache_invalidate3(thd, table_list, 1);
- }
transactional_table= table->file->has_transactions();
@@ -1424,9 +1422,7 @@ void select_insert::send_error(uint errcode,const char *err)
table->file->extra(HA_EXTRA_NO_CACHE);
table->file->activate_all_index(thd);
if (info.copied || info.deleted)
- {
query_cache_invalidate3(thd, table, 1);
- }
ha_rollback_stmt(thd);
}
@@ -1438,13 +1434,13 @@ bool select_insert::send_eof()
error=table->file->activate_all_index(thd);
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
- /* We must invalidate the table in the query cache before binlog writing
- and ha_autocommit_... */
+ /*
+ We must invalidate the table in the query cache before binlog writing
+ and ha_autocommit_...
+ */
if (info.copied || info.deleted)
- {
query_cache_invalidate3(thd, table, 1);
- }
/* Write to binlog before commiting transaction */
if (mysql_bin_log.is_open())
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index b79a3b739d7..758ff88477b 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -283,8 +283,10 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
table->copy_blobs=0;
thd->count_cuted_fields=0; /* Don`t calc cuted fields */
- /* We must invalidate the table in query cache before binlog writing and
- ha_autocommit_... */
+ /*
+ We must invalidate the table in query cache before binlog writing and
+ ha_autocommit_...
+ */
query_cache_invalidate3(thd, table_list, 0);
if (error)
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 62fcb02163d..1f6364ec427 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -338,14 +338,7 @@ int mysql_update(THD *thd,
This must be before binlog writing and ha_autocommit_...
*/
if (updated)
- {
query_cache_invalidate3(thd, table_list, 1);
- }
- if (thd->lock)
- {
- mysql_unlock_tables(thd, thd->lock);
- thd->lock=0;
- }
transactional_table= table->file->has_transactions();
log_delayed= (transactional_table || table->tmp_table);
@@ -368,6 +361,12 @@ int mysql_update(THD *thd,
error=1;
}
+ if (thd->lock)
+ {
+ mysql_unlock_tables(thd, thd->lock);
+ thd->lock=0;
+ }
+
delete select;
free_underlaid_joins(thd, &thd->lex.select_lex);
if (error >= 0)