1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +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

@ -1702,6 +1702,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.