mirror of
https://github.com/MariaDB/server.git
synced 2025-08-30 11:22:14 +03:00
Fix for LOCK TABLES and BDB tables
This commit is contained in:
@@ -81,7 +81,8 @@ static void init_signals(void)
|
||||
inline bool end_active_trans(THD *thd)
|
||||
{
|
||||
int error=0;
|
||||
if (thd->options & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN))
|
||||
if (thd->options & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN |
|
||||
OPTION_TABLE_LOCK))
|
||||
{
|
||||
thd->options&= ~(ulong) (OPTION_BEGIN | OPTION_STATUS_NO_TRANS_UPDATE);
|
||||
thd->server_status&= ~SERVER_STATUS_IN_TRANS;
|
||||
@@ -1825,7 +1826,11 @@ mysql_execute_command(void)
|
||||
{
|
||||
thd->lock=thd->locked_tables;
|
||||
thd->locked_tables=0; // Will be automaticly closed
|
||||
}
|
||||
if (thd->options & OPTION_TABLE_LOCK)
|
||||
{
|
||||
end_active_trans(thd);
|
||||
thd->options&= ~(ulong) (OPTION_TABLE_LOCK);
|
||||
}
|
||||
if (thd->global_read_lock)
|
||||
{
|
||||
@@ -1847,12 +1852,15 @@ mysql_execute_command(void)
|
||||
if (check_db_used(thd,tables) || end_active_trans(thd))
|
||||
goto error;
|
||||
thd->in_lock_tables=1;
|
||||
thd->options|= OPTION_TABLE_LOCK;
|
||||
if (!(res=open_and_lock_tables(thd,tables)))
|
||||
{
|
||||
thd->locked_tables=thd->lock;
|
||||
thd->lock=0;
|
||||
send_ok(&thd->net);
|
||||
}
|
||||
else
|
||||
thd->options&= ~(ulong) (OPTION_TABLE_LOCK);
|
||||
thd->in_lock_tables=0;
|
||||
break;
|
||||
case SQLCOM_CREATE_DB:
|
||||
|
Reference in New Issue
Block a user