1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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.
This commit is contained in:
ingo@mysql.com
2005-05-31 11:08:14 +02:00
parent db8368fdd5
commit 51d80960ea
10 changed files with 108 additions and 66 deletions

View File

@ -228,3 +228,11 @@ create table t1 (a int,,b int);
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'b int)' at line 1
create table t1 (,b int);
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'b int)' at line 1
create table t1 (a int);
create table t1 select * from t1;
INSERT TABLE 't1' isn't allowed in FROM table list
create table t2 union = (t1) select * from t1;
INSERT TABLE 't1' isn't allowed in FROM table list
flush tables with read lock;
unlock tables;
drop table t1;