1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

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.
This commit is contained in:
unknown
2005-01-14 00:09:15 +02:00
parent c0af1e3c67
commit 177e99f327
3 changed files with 34 additions and 1 deletions

View File

@@ -897,8 +897,12 @@ static int mysql_test_insert(Prepared_statement *stmt,
/*
open temporary memory pool for temporary data allocated by derived
tables & preparation procedure
Note that this is done without locks (should not be needed as we will not
access any data here)
If we would use locks, then we have to ensure we are not using
TL_WRITE_DELAYED as having two such locks can cause table corruption.
*/
if (open_and_lock_tables(thd, table_list))
if (open_normal_and_derived_tables(thd, table_list))
{
DBUG_RETURN(-1);
}