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

Implemented MDEV-3941: CREATE TABLE xxx IF NOT EXISTS should not block if table exists.

- Added option to check_if_table_exists() to quickly check if table exists (either SHARE or .FRM)
- Extended lock_table_names() to not wait for meta data locks if CREATE IF NOT EXISTS is used.

mysql-test/r/create.result:
  New test case
mysql-test/t/create.test:
  New test case
sql/sql_base.cc:
  Added option to check_if_table_exists() to quickly check if table exists (either SHARE or .FRM)
  Extended lock_table_names() to not wait for meta data locks if CREATE IF NOT EXISTS is used.
sql/sql_base.h:
  Updated prototype
sql/sql_db.cc:
  Added extra argument to call to check_if_table_exists()
This commit is contained in:
Michael Widenius
2012-12-16 16:13:17 +02:00
parent a6a8f12fa3
commit 33f3a11e2d
5 changed files with 111 additions and 14 deletions

View File

@ -927,7 +927,7 @@ update_binlog:
char quoted_name[FN_REFLEN+3];
// Only write drop table to the binlog for tables that no longer exist.
if (check_if_table_exists(thd, tbl, &exists))
if (check_if_table_exists(thd, tbl, 0, &exists))
{
error= true;
goto exit;