From 33f3a11e2db38fad3c43ce3c1a30dc8d72bd53bd Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Sun, 16 Dec 2012 16:13:17 +0200 Subject: 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() --- sql/sql_base.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql/sql_base.h') diff --git a/sql/sql_base.h b/sql/sql_base.h index 6ec998c44f8..45d41777fea 100644 --- a/sql/sql_base.h +++ b/sql/sql_base.h @@ -302,7 +302,8 @@ TABLE *find_table_for_mdl_upgrade(THD *thd, const char *db, const char *table_name, bool no_error); void mark_tmp_table_for_reuse(TABLE *table); -bool check_if_table_exists(THD *thd, TABLE_LIST *table, bool *exists); +bool check_if_table_exists(THD *thd, TABLE_LIST *table, bool fast_check, + bool *exists); int update_virtual_fields(THD *thd, TABLE *table, enum enum_vcol_update_mode vcol_update_mode= VCOL_UPDATE_FOR_READ); int dynamic_column_error_message(enum_dyncol_func_result rc); -- cgit v1.2.1