summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-03-24 23:29:06 +0200
committerunknown <monty@narttu.mysql.fi>2003-03-24 23:29:06 +0200
commit0783e5bc2f6fa2aa754958d147619b1ba92e60a5 (patch)
treed7b52da36a9af4cf687ed434b2175a101b50cf12
parente38d200c85a65b0388871c736e66b15692948f5b (diff)
parent3b0438c8dd343da6ff77480ce3a814dbc11a0e42 (diff)
downloadmariadb-git-0783e5bc2f6fa2aa754958d147619b1ba92e60a5.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-3.23
into narttu.mysql.fi:/my/mysql-3.23
-rw-r--r--sql/sql_delete.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 278e98533c9..2372e908152 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -30,6 +30,7 @@ int generate_table(THD *thd, TABLE_LIST *table_list, TABLE *locked_table)
char path[FN_REFLEN];
int error;
TABLE **table_ptr;
+ my_bool lock_open_locked= 0;
DBUG_ENTER("generate_table");
thd->proc_info="generate_table";
@@ -102,7 +103,7 @@ int generate_table(THD *thd, TABLE_LIST *table_list, TABLE *locked_table)
error= ha_create_table(path,&create_info,1) ? -1 : 0;
if (thd->locked_tables && reopen_tables(thd,1,0))
error= -1;
- VOID(pthread_mutex_unlock(&LOCK_open));
+ lock_open_locked= 1; // Unlock mutex before return
}
if (!error)
{
@@ -114,6 +115,8 @@ int generate_table(THD *thd, TABLE_LIST *table_list, TABLE *locked_table)
}
send_ok(&thd->net); // This should return record count
}
+ if (lock_open_locked)
+ VOID(pthread_mutex_unlock(&LOCK_open));
DBUG_RETURN(error ? -1 : 0);
}