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.
This commit is contained in:
@ -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.
|
||||
|
Reference in New Issue
Block a user