summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-01-14 00:09:15 +0200
committerunknown <monty@mysql.com>2005-01-14 00:09:15 +0200
commit177e99f32719b9c20c55c19fbbc9cef09550d9e1 (patch)
tree8e12e0a89204ea53a9bc43cf5f2fcb17819c89d5 /sql/sql_base.cc
parentc0af1e3c67c707477f2cdc1dd776fb6d6df8cdb8 (diff)
downloadmariadb-git-177e99f32719b9c20c55c19fbbc9cef09550d9e1.tar.gz
Fix bug in INSERT DELAYED with prepared statements
The bug was that if you have two TL_WRITE_DELAYED at the same time, mi_lock_databases() could be done in the wrong order and we could write the wrong header to the MyISAM index file. sql/mysql_priv.h: Fix bug in insert delayed with prepared statements sql/sql_base.cc: Fix bug in insert delayed with prepared statements sql/sql_prepare.cc: Fix bug in insert delayed with prepared statements The bug was that if you have two TL_WRITE_DELAYED at the same time, mi_lock_databases() could be done in the wrong order and we could write the wrong header to the MyISAM index file.
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 2f2d9b290ac..263c68a82b7 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1703,6 +1703,34 @@ int open_and_lock_tables(THD *thd, TABLE_LIST *tables)
/*
+ Open all tables in list and process derived tables
+
+ SYNOPSIS
+ open_normal_and_derived_tables
+ thd - thread handler
+ tables - list of tables for open&locking
+
+ RETURN
+ FALSE - ok
+ TRUE - error
+
+ NOTE
+ This is to be used on prepare stage when you don't read any
+ data from the tables.
+*/
+
+int open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables)
+{
+ uint counter;
+ DBUG_ENTER("open_normal_and_derived_tables");
+ if (open_tables(thd, tables, &counter))
+ DBUG_RETURN(-1); /* purecov: inspected */
+ relink_tables_for_derived(thd);
+ DBUG_RETURN(mysql_handle_derived(thd->lex));
+}
+
+
+/*
Let us propagate pointers to open tables from global table list
to table lists in particular selects if needed.
*/