summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authoringo@mysql.com <>2005-05-31 11:08:14 +0200
committeringo@mysql.com <>2005-05-31 11:08:14 +0200
commit51d80960ea52e1c3c99bf6287f331a58e1c2b11c (patch)
treea57814a50ac22d55c9f811df170159eea1b1eb3c /sql/sql_acl.cc
parentdb8368fdd519f918c398d4d2ba47cc8dfc9d2cc0 (diff)
downloadmariadb-git-51d80960ea52e1c3c99bf6287f331a58e1c2b11c.tar.gz
Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
1.) Added a new option to mysql_lock_tables() for ignoring FLUSH TABLES. Used the new option in create_table_from_items(). It is necessary to prevent the SELECT table from being reopend. It would get new storage assigned for its fields, while the SELECT part of the command would still use the old (freed) storage. 2.) Protected the CREATE TABLE and CREATE TABLE ... SELECT commands against a global read lock. This prevents a deadlock in CREATE TABLE ... SELECT in conjunction with FLUSH TABLES WITH READ LOCK and avoids the creation of new tables during a global read lock. 3.) Replaced set_protect_against_global_read_lock() and unset_protect_against_global_read_lock() by wait_if_global_read_lock() and start_waiting_global_read_lock() in the INSERT DELAYED handling.
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index acdd07b2fc5..46b29f252a6 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -177,7 +177,7 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables)
ptr[0]= tables[0].table;
ptr[1]= tables[1].table;
ptr[2]= tables[2].table;
- if (!(lock=mysql_lock_tables(thd,ptr,3)))
+ if (! (lock= mysql_lock_tables(thd, ptr, 3, 0)))
{
sql_print_error("Fatal error: Can't lock privilege tables: %s",
thd->net.last_error);
@@ -2514,7 +2514,7 @@ my_bool grant_init(THD *org_thd)
TABLE *ptr[2]; // Lock tables for quick update
ptr[0]= tables[0].table;
ptr[1]= tables[1].table;
- if (!(lock=mysql_lock_tables(thd,ptr,2)))
+ if (! (lock= mysql_lock_tables(thd, ptr, 2, 0)))
goto end;
t_table = tables[0].table; c_table = tables[1].table;