mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fix for BDB and LOCK TABLES
BitKeeper/deleted/.del-ib_config.h.in~9e57db8504e55b7: Delete: innobase/ib_config.h.in BitKeeper/deleted/.del-ib_config.h~7539e26ffc614439: Delete: innobase/ib_config.h Docs/manual.texi: Changelog myisam/mi_locking.c: Cleanup mysql-test/r/bdb.result: Test for LOCK TABLES mysql-test/r/innodb.result: Test for LOCK TABLES mysql-test/t/bdb.test: Test for LOCK TABLES mysql-test/t/innodb.test: Test for LOCK TABLES sql-bench/test-insert.sh: Allow loop to be small sql/ha_berkeley.cc: Fixed bug when using LOCK TABLES with BDB sql/ha_berkeley.h: Fixed bug when using LOCK TABLES with BDB sql/handler.h: Fixed bug when using LOCK TABLES with BDB sql/sql_base.cc: Fixed bug when using LOCK TABLES with BDB sql/sql_parse.cc: UNLOCK TABLES ends transaction sql/sql_select.cc: Fix to not call index_end() twice
This commit is contained in:
@ -1399,6 +1399,7 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type)
|
||||
&refresh)) && refresh) ;
|
||||
if (table)
|
||||
{
|
||||
int error;
|
||||
table_list->table=table;
|
||||
table->grant= table_list->grant;
|
||||
if (thd->locked_tables)
|
||||
@ -1410,7 +1411,12 @@ TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type lock_type)
|
||||
my_printf_error(ER_TABLE_NOT_LOCKED_FOR_WRITE,
|
||||
ER(ER_TABLE_NOT_LOCKED_FOR_WRITE),
|
||||
MYF(0),table_list->name);
|
||||
DBUG_RETURN(0);
|
||||
table=0;
|
||||
}
|
||||
else if ((error=table->file->start_stmt(thd)))
|
||||
{
|
||||
table->file->print_error(error,MYF(0));
|
||||
table=0;
|
||||
}
|
||||
thd->proc_info=0;
|
||||
DBUG_RETURN(table);
|
||||
@ -1437,10 +1443,10 @@ int open_and_lock_tables(THD *thd,TABLE_LIST *tables)
|
||||
|
||||
int lock_tables(THD *thd,TABLE_LIST *tables)
|
||||
{
|
||||
TABLE_LIST *table;
|
||||
if (tables && !thd->locked_tables)
|
||||
{
|
||||
uint count=0;
|
||||
TABLE_LIST *table;
|
||||
for (table = tables ; table ; table=table->next)
|
||||
count++;
|
||||
TABLE **start,**ptr;
|
||||
@ -1451,6 +1457,18 @@ int lock_tables(THD *thd,TABLE_LIST *tables)
|
||||
if (!(thd->lock=mysql_lock_tables(thd,start,count)))
|
||||
return -1; /* purecov: inspected */
|
||||
}
|
||||
else
|
||||
{
|
||||
for (table = tables ; table ; table=table->next)
|
||||
{
|
||||
int error;
|
||||
if ((error=table->table->file->start_stmt(thd)))
|
||||
{
|
||||
table->table->file->print_error(error,MYF(0));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user