diff --git a/mysql-test/include/binlog_formats.combinations b/mysql-test/include/binlog_formats.combinations deleted file mode 100644 index 07042c2cbec..00000000000 --- a/mysql-test/include/binlog_formats.combinations +++ /dev/null @@ -1,8 +0,0 @@ -[row] -binlog-format=row - -[stmt] -binlog-format=statement - -[mix] -binlog-format=mixed diff --git a/mysql-test/include/binlog_formats.inc b/mysql-test/include/binlog_formats.inc deleted file mode 100644 index 44d64293102..00000000000 --- a/mysql-test/include/binlog_formats.inc +++ /dev/null @@ -1,4 +0,0 @@ -# This file adds combinations for all binlog formats: row, stmt, mix -# Under each combination a corresponding binlog-format option is set. - ---source include/have_log_bin.inc diff --git a/mysql-test/main/backup_log.inc b/mysql-test/main/backup_log.inc index 4ad6b9122cd..f553a3b9527 100644 --- a/mysql-test/main/backup_log.inc +++ b/mysql-test/main/backup_log.inc @@ -7,7 +7,7 @@ # non-partitioned testing --echo # ---echo # Testing normal tables +--echo # Testing with normal tables --echo # eval create table t1 (a int) engine=myisam $part_int; @@ -20,8 +20,6 @@ repair table t1; optimize table t1; drop table t1; ---source backup_log_print.inc - eval create table t1_innodb (a int) engine=innodb $part_int; insert into t1_innodb values (1),(2); alter table t1_innodb add column b int; @@ -32,8 +30,6 @@ repair table t1_innodb; optimize table t1_innodb; drop table t1_innodb; ---source backup_log_print.inc - --echo # --echo # Testing with temporary tables (should not be logged) --echo # @@ -45,8 +41,6 @@ rename table tmp_t11 to tmp_t10; truncate table tmp_t10; drop table tmp_t10; ---source backup_log_print.inc - --echo # --echo # Testing with mix of normal and temporary tables --echo # @@ -60,8 +54,6 @@ eval create table t21 (a int) $part_int; drop temporary table if exists tmp_t21,t21; drop table if exists tmp_t21,t21; ---source backup_log_print.inc - --echo # --echo # Testing create select --echo # @@ -76,8 +68,6 @@ eval create or replace table t31 (a int primary key) $part_int select * from t30 eval create table t32 (a int) $part_int; drop table if exists t30,t31,t32,tmp_t30; ---source backup_log_print.inc - --echo # --echo # Testing create LIKE --echo # @@ -91,8 +81,6 @@ create or replace table t42 like t41; show create table t42; drop table t40, t41, t42; ---source backup_log_print.inc - --echo # --echo # Testing rename --echo # @@ -103,8 +91,6 @@ rename table t50 to t52, t51 to t53; rename table t52 to tmp, t53 to t52, tmp to t53; drop table t52,t53; ---source backup_log_print.inc - --echo # --echo # Testing enable/disable keys --echo # @@ -121,8 +107,6 @@ INSERT INTO t61 VALUES(1),(2),(3); ALTER TABLE t61 DISABLE KEYS; DROP TABLE t61; ---source backup_log_print.inc - --echo # --echo # Testing load data --echo # @@ -144,8 +128,6 @@ insert into t71 select * from t70; unlock tables; drop table t70,t71; ---source backup_log_print.inc - --echo # --echo # Testing strange table names --echo # @@ -153,8 +135,6 @@ drop table t70,t71; eval create table `t 1` (a int) $part_int; drop table `t 1`; ---source backup_log_print.inc - --echo # --echo # Testing views and triggers --echo # @@ -166,8 +146,6 @@ drop trigger trg; drop view v1; drop table t80; ---source backup_log_print.inc - --echo # --echo # Testing alter to a new storage engine --echo # @@ -175,5 +153,3 @@ drop table t80; eval create table t85 (a int primary key, b int) engine=myisam $part_int; alter table t85 engine=innodb; drop table t85; - ---source backup_log_print.inc diff --git a/mysql-test/main/backup_log.result b/mysql-test/main/backup_log.result index 9b86c19ae40..cc8d098825d 100644 --- a/mysql-test/main/backup_log.result +++ b/mysql-test/main/backup_log.result @@ -4,7 +4,7 @@ connect con1,localhost,root,,; BACKUP STAGE START; connection default; # -# Testing normal tables +# Testing with normal tables # create table t1 (a int) engine=myisam ; insert into t1 values (1),(2); @@ -19,16 +19,6 @@ optimize table t1; Table Op Msg_type Msg_text test.t1 optimize status OK drop table t1; -# -# Reading backup ddl log file -# -CREATE,MyISAM,0,test,t1,id: 1,,0,,, -ALTER,MyISAM,0,test,t1,id: 1,MyISAM,0,test,t1,id: 2 -RENAME,MyISAM,0,test,t1,id: 2,MyISAM,0,test,t2,id: 2 -RENAME,MyISAM,0,test,t2,id: 2,MyISAM,0,test,t1,id: 2 -repair,MyISAM,0,test,t1,id: 2,,0,,, -optimize,MyISAM,0,test,t1,id: 2,,0,,, -DROP,MyISAM,0,test,t1,id: 2,,0,,, create table t1_innodb (a int) engine=innodb ; insert into t1_innodb values (1),(2); alter table t1_innodb add column b int; @@ -44,17 +34,6 @@ test.t1_innodb optimize note Table does not support optimize, doing recreate + a test.t1_innodb optimize status OK drop table t1_innodb; # -# Reading backup ddl log file -# -CREATE,InnoDB,0,test,t1_innodb,id: 1,,0,,, -ALTER,InnoDB,0,test,t1_innodb,id: 1,InnoDB,0,test,t1_innodb,id: 2 -RENAME,InnoDB,0,test,t1_innodb,id: 2,InnoDB,0,test,t2_innodb,id: 2 -RENAME,InnoDB,0,test,t2_innodb,id: 2,InnoDB,0,test,t1_innodb,id: 2 -TRUNCATE,InnoDB,0,test,t1_innodb,id: 2,,0,,, -repair,InnoDB,0,test,t1_innodb,id: 2,,0,,, -ALTER,InnoDB,0,test,t1_innodb,id: 2,InnoDB,0,test,t1_innodb,id: 3 -DROP,InnoDB,0,test,t1_innodb,id: 3,,0,,, -# # Testing with temporary tables (should not be logged) # create temporary table tmp_t10 (a int) engine=myisam; @@ -64,9 +43,6 @@ rename table tmp_t11 to tmp_t10; truncate table tmp_t10; drop table tmp_t10; # -# Reading backup ddl log file -# -# # Testing with mix of normal and temporary tables # create temporary table tmp_t20 (a int); @@ -81,13 +57,6 @@ drop table if exists tmp_t21,t21; Warnings: Note 1051 Unknown table 'test.tmp_t21' # -# Reading backup ddl log file -# -CREATE,MyISAM,0,test,t20,id: 1,,0,,, -DROP,MyISAM,0,test,t20,id: 1,,0,,, -CREATE,MyISAM,0,test,t21,id: 2,,0,,, -DROP,MyISAM,0,test,t21,id: 2,,0,,, -# # Testing create select # create table t30 (a int) ; @@ -100,18 +69,7 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY' create table t32 (a int) ; drop table if exists t30,t31,t32,tmp_t30; Warnings: -Note 1051 Unknown table 'test.tmp_t30' -# -# Reading backup ddl log file -# -CREATE,MyISAM,0,test,t30,id: 1,,0,,, -CREATE,MyISAM,0,test,t31,id: 2,,0,,, -DROP,MyISAM,0,test,t31,id: 2,,0,,, -CREATE,MyISAM,0,test,t31,id: 3,,0,,, -CREATE,MyISAM,0,test,t32,id: 4,,0,,, -DROP,MyISAM,0,test,t30,id: 1,,0,,, -DROP,MyISAM,0,test,t31,id: 3,,0,,, -DROP,MyISAM,0,test,t32,id: 4,,0,,, +Note 1051 Unknown table 'test.t31,test.tmp_t30' # # Testing create LIKE # @@ -128,17 +86,6 @@ t42 CREATE TABLE `t42` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci drop table t40, t41, t42; # -# Reading backup ddl log file -# -CREATE,MyISAM,0,test,t40,id: 1,,0,,, -CREATE,InnoDB,0,test,t41,id: 2,,0,,, -CREATE,MyISAM,0,test,t42,id: 3,,0,,, -DROP,MyISAM,0,test,t42,id: 3,,0,,, -CREATE,InnoDB,0,test,t42,id: 4,,0,,, -DROP,MyISAM,0,test,t40,id: 1,,0,,, -DROP,InnoDB,0,test,t41,id: 2,,0,,, -DROP,InnoDB,0,test,t42,id: 4,,0,,, -# # Testing rename # create table t50 (a int) ; @@ -147,18 +94,6 @@ rename table t50 to t52, t51 to t53; rename table t52 to tmp, t53 to t52, tmp to t53; drop table t52,t53; # -# Reading backup ddl log file -# -CREATE,MyISAM,0,test,t50,id: 1,,0,,, -CREATE,MyISAM,0,test,t51,id: 2,,0,,, -RENAME,MyISAM,0,test,t50,id: 1,MyISAM,0,test,t52,id: 1 -RENAME,MyISAM,0,test,t51,id: 2,MyISAM,0,test,t53,id: 2 -RENAME,MyISAM,0,test,t52,id: 1,MyISAM,0,test,tmp,id: 1 -RENAME,MyISAM,0,test,t53,id: 2,MyISAM,0,test,t52,id: 2 -RENAME,MyISAM,0,test,tmp,id: 1,MyISAM,0,test,t53,id: 1 -DROP,MyISAM,0,test,t52,id: 2,,0,,, -DROP,MyISAM,0,test,t53,id: 1,,0,,, -# # Testing enable/disable keys # CREATE TABLE t60 (a int(10), index(a) ) ENGINE=Aria ; @@ -172,13 +107,6 @@ INSERT INTO t61 VALUES(1),(2),(3); ALTER TABLE t61 DISABLE KEYS; DROP TABLE t61; # -# Reading backup ddl log file -# -CREATE,Aria,0,test,t60,id: 1,,0,,, -CHANGE_INDEX,Aria,0,test,t60,id: 1,,0,,, -CHANGE_INDEX,Aria,0,test,t60,id: 1,,0,,, -DROP,Aria,0,test,t60,id: 1,,0,,, -# # Testing load data # create table t70 (a date, b date, c date not null, d date) engine=aria ; @@ -195,26 +123,11 @@ insert into t71 select * from t70; unlock tables; drop table t70,t71; # -# Reading backup ddl log file -# -CREATE,Aria,0,test,t70,id: 1,,0,,, -BULK_INSERT,Aria,0,test,t70,id: 1,,0,,, -BULK_INSERT,Aria,0,test,t70,id: 1,,0,,, -CREATE,Aria,0,test,t71,id: 2,,0,,, -BULK_INSERT,Aria,0,test,t71,id: 2,,0,,, -DROP,Aria,0,test,t70,id: 1,,0,,, -DROP,Aria,0,test,t71,id: 2,,0,,, -# # Testing strange table names # create table `t 1` (a int) ; drop table `t 1`; # -# Reading backup ddl log file -# -CREATE,MyISAM,0,test,t@00201,id: 1,,0,,, -DROP,MyISAM,0,test,t@00201,id: 1,,0,,, -# # Testing views and triggers # create table t80 (a int, b int) engine=myisam ; @@ -224,27 +137,12 @@ drop trigger trg; drop view v1; drop table t80; # -# Reading backup ddl log file -# -CREATE,MyISAM,0,test,t80,id: 1,,0,,, -CREATE,VIEW,0,test,v1,,,0,,, -CREATE,TRIGGER,0,test,trg,,,0,,, -DROP,TRIGGER,0,test,trg,,,0,,, -DROP,VIEW,0,test,v1,,,0,,, -DROP,MyISAM,0,test,t80,id: 1,,0,,, -# # Testing alter to a new storage engine # create table t85 (a int primary key, b int) engine=myisam ; alter table t85 engine=innodb; drop table t85; # -# Reading backup ddl log file -# -CREATE,MyISAM,0,test,t85,id: 1,,0,,, -ALTER,MyISAM,0,test,t85,id: 1,InnoDB,0,test,t85,id: 2 -DROP,InnoDB,0,test,t85,id: 2,,0,,, -# # Testing create/drop/alter database # create database mysqltest; @@ -253,16 +151,6 @@ create table mysqltest.t91 (a int primary key, b int) engine=innodb; alter database mysqltest character set utf8; drop database mysqltest; # -# Reading backup ddl log file -# -CREATE,DATABASE,0,mysqltest,,,,0,,, -CREATE,MyISAM,0,mysqltest,t90,id: 1,,0,,, -CREATE,InnoDB,0,mysqltest,t91,id: 2,,0,,, -ALTER,DATABASE,0,mysqltest,,,,0,,, -DROP,MyISAM,0,mysqltest,t90,id: 1,,0,,, -DROP,InnoDB,0,mysqltest,t91,id: 2,,0,,, -DROP,DATABASE,0,mysqltest,,,,0,,, -# # MENT-222 bug testing # CREATE TABLE IF NOT EXISTS t_exists LIKE t_exists_template; @@ -271,14 +159,83 @@ Note 1050 Table 't_exists' already exists # # Reading backup ddl log file # +CREATE,MyISAM,0,test,t1,id: 1,,0,,, +ALTER,MyISAM,0,test,t1,id: 1,MyISAM,0,test,t1,id: 2 +RENAME,MyISAM,0,test,t1,id: 2,MyISAM,0,test,t2,id: 2 +RENAME,MyISAM,0,test,t2,id: 2,MyISAM,0,test,t1,id: 2 +repair,MyISAM,0,test,t1,id: 2,,0,,, +optimize,MyISAM,0,test,t1,id: 2,,0,,, +DROP,MyISAM,0,test,t1,id: 2,,0,,, +CREATE,InnoDB,0,test,t1_innodb,id: 3,,0,,, +ALTER,InnoDB,0,test,t1_innodb,id: 3,InnoDB,0,test,t1_innodb,id: 4 +RENAME,InnoDB,0,test,t1_innodb,id: 4,InnoDB,0,test,t2_innodb,id: 4 +RENAME,InnoDB,0,test,t2_innodb,id: 4,InnoDB,0,test,t1_innodb,id: 4 +TRUNCATE,InnoDB,0,test,t1_innodb,id: 4,,0,,, +repair,InnoDB,0,test,t1_innodb,id: 4,,0,,, +ALTER,InnoDB,0,test,t1_innodb,id: 4,InnoDB,0,test,t1_innodb,id: 5 +DROP,InnoDB,0,test,t1_innodb,id: 5,,0,,, +CREATE,MyISAM,0,test,t20,id: 6,,0,,, +DROP,MyISAM,0,test,t20,id: 6,,0,,, +CREATE,MyISAM,0,test,t21,id: 7,,0,,, +DROP,MyISAM,0,test,t21,id: 7,,0,,, +CREATE,MyISAM,0,test,t30,id: 8,,0,,, +CREATE,MyISAM,0,test,t31,id: 9,,0,,, +DROP,MyISAM,0,test,t31,id: 9,,0,,, +CREATE,MyISAM,0,test,t31,id: 10,,0,,, +DROP,MyISAM,0,test,t31,id: 10,,0,,, +DROP_AFTER_CREATE,MyISAM,0,test,t31,id: 11,,0,,, +CREATE,MyISAM,0,test,t32,id: 12,,0,,, +DROP,MyISAM,0,test,t30,id: 8,,0,,, +DROP,MyISAM,0,test,t32,id: 12,,0,,, +CREATE,MyISAM,0,test,t40,id: 13,,0,,, +CREATE,InnoDB,0,test,t41,id: 14,,0,,, +CREATE,MyISAM,0,test,t42,id: 15,,0,,, +DROP,MyISAM,0,test,t42,id: 15,,0,,, +CREATE,InnoDB,0,test,t42,id: 16,,0,,, +DROP,MyISAM,0,test,t40,id: 13,,0,,, +DROP,InnoDB,0,test,t41,id: 14,,0,,, +DROP,InnoDB,0,test,t42,id: 16,,0,,, +CREATE,MyISAM,0,test,t50,id: 17,,0,,, +CREATE,MyISAM,0,test,t51,id: 18,,0,,, +RENAME,MyISAM,0,test,t50,id: 17,MyISAM,0,test,t52,id: 17 +RENAME,MyISAM,0,test,t51,id: 18,MyISAM,0,test,t53,id: 18 +RENAME,MyISAM,0,test,t52,id: 17,MyISAM,0,test,tmp,id: 17 +RENAME,MyISAM,0,test,t53,id: 18,MyISAM,0,test,t52,id: 18 +RENAME,MyISAM,0,test,tmp,id: 17,MyISAM,0,test,t53,id: 17 +DROP,MyISAM,0,test,t52,id: 18,,0,,, +DROP,MyISAM,0,test,t53,id: 17,,0,,, +CREATE,Aria,0,test,t60,id: 19,,0,,, +CHANGE_INDEX,Aria,0,test,t60,id: 19,,0,,, +CHANGE_INDEX,Aria,0,test,t60,id: 19,,0,,, +DROP,Aria,0,test,t60,id: 19,,0,,, +CREATE,Aria,0,test,t70,id: 20,,0,,, +BULK_INSERT,Aria,0,test,t70,id: 20,,0,,, +BULK_INSERT,Aria,0,test,t70,id: 20,,0,,, +CREATE,Aria,0,test,t71,id: 21,,0,,, +BULK_INSERT,Aria,0,test,t71,id: 21,,0,,, +DROP,Aria,0,test,t70,id: 20,,0,,, +DROP,Aria,0,test,t71,id: 21,,0,,, +CREATE,MyISAM,0,test,t@00201,id: 22,,0,,, +DROP,MyISAM,0,test,t@00201,id: 22,,0,,, +CREATE,MyISAM,0,test,t80,id: 23,,0,,, +CREATE,VIEW,0,test,v1,,,0,,, +CREATE,TRIGGER,0,test,trg,,,0,,, +DROP,TRIGGER,0,test,trg,,,0,,, +DROP,VIEW,0,test,v1,,,0,,, +DROP,MyISAM,0,test,t80,id: 23,,0,,, +CREATE,MyISAM,0,test,t85,id: 24,,0,,, +ALTER,MyISAM,0,test,t85,id: 24,InnoDB,0,test,t85,id: 25 +DROP,InnoDB,0,test,t85,id: 25,,0,,, +CREATE,DATABASE,0,mysqltest,,,,0,,, +CREATE,MyISAM,0,mysqltest,t90,id: 26,,0,,, +CREATE,InnoDB,0,mysqltest,t91,id: 27,,0,,, +ALTER,DATABASE,0,mysqltest,,,,0,,, +DROP,MyISAM,0,mysqltest,t90,id: 26,,0,,, +DROP,InnoDB,0,mysqltest,t91,id: 27,,0,,, +DROP,DATABASE,0,mysqltest,,,,0,,, # # Cleanup # DROP TABLE t_exists; DROP TABLE t_exists_template; -# -# Reading backup ddl log file -# -DROP,MyISAM,0,test,t_exists,id: 1,,0,,, -DROP,MyISAM,0,test,t_exists_template,id: 2,,0,,, disconnect con1; diff --git a/mysql-test/main/backup_log.test b/mysql-test/main/backup_log.test index d2f5d4616bd..ee34484e92b 100644 --- a/mysql-test/main/backup_log.test +++ b/mysql-test/main/backup_log.test @@ -24,8 +24,6 @@ create table mysqltest.t91 (a int primary key, b int) engine=innodb; alter database mysqltest character set utf8; drop database mysqltest; ---source backup_log_print.inc - --echo # --echo # MENT-222 bug testing --echo # @@ -38,5 +36,4 @@ CREATE TABLE IF NOT EXISTS t_exists LIKE t_exists_template; --echo # DROP TABLE t_exists; DROP TABLE t_exists_template; ---source backup_log_print.inc disconnect con1; diff --git a/mysql-test/main/backup_log_print.inc b/mysql-test/main/backup_log_print.inc deleted file mode 100644 index ad46dde49f9..00000000000 --- a/mysql-test/main/backup_log_print.inc +++ /dev/null @@ -1,7 +0,0 @@ ---disable_query_log ---source include/print_ddl_log.inc ---connection con1 -backup stage end; -backup stage start; ---connection default ---enable_query_log diff --git a/mysql-test/main/create_not_windows.result b/mysql-test/main/create_not_windows.result index 43860c2fdca..8dacf2894eb 100644 --- a/mysql-test/main/create_not_windows.result +++ b/mysql-test/main/create_not_windows.result @@ -29,39 +29,3 @@ select count(a) from t1; count(a) 0 drop table t1; -# -# MDEV-25292 Atomic CREATE OR REPLACE TABLE -# -# Test multi-byte characters in table name -set names utf8; -# Filename is too long because it is converted to @274e@274e@274e@274e... -# so each '❎' is 5 bytes in filesystem, 51 x 5 = 255 bytes -create table ❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎ (x int); -ERROR HY000: Can't create table `test`.`❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎` (errno: 36 "File name too long") -# Let's find out max length for '❎'... -# Acceptable name length: 50; Filename length: 254 -# OK with 64-characters table name, filesystem name is 40 x 5 + 24 = 224 bytes -create table tttttttttttttttttttttttt❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎ (x int); -# Not OK with 65-characters table name -create table ttttttttttttttttttttttttt❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎ (x int); -ERROR 42000: Incorrect table name 'ttttttttttttttttttttttttt❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎' -show tables; -Tables_in_test -tttttttttttttttttttttttt❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎ -create or replace table tttttttttttttttttttttttt❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎ (y int); -show create table tttttttttttttttttttttttt❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎; -Table Create Table -tttttttttttttttttttttttt❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎ CREATE TABLE `tttttttttttttttttttttttt❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎` ( - `y` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -set @@debug_dbug="+d,ddl_log_create_after_save_backup", @debug_crash_counter=1; -create or replace table tttttttttttttttttttttttt❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎ (z int); -ERROR HY000: Lost connection to server during query -#sql-backup-PID-TID-tttttttttttttttttttttttt@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e.MYD -#sql-backup-PID-TID-tttttttttttttttttttttttt@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e.MYI -#sql-backup-PID-TID-tttttttttttttttttttttttt@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e.frm -#sql-create-PID-TID-tttttttttttttttttttttttt@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e.MYD -#sql-create-PID-TID-tttttttttttttttttttttttt@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e.MYI -#sql-create-PID-TID-tttttttttttttttttttttttt@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e.frm -drop table tttttttttttttttttttttttt❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎; -set @@debug_dbug=""; diff --git a/mysql-test/main/create_not_windows.test b/mysql-test/main/create_not_windows.test index d6dfc0d3fa1..b612e31e3aa 100644 --- a/mysql-test/main/create_not_windows.test +++ b/mysql-test/main/create_not_windows.test @@ -1,8 +1,6 @@ # Non-windows specific create tests. --source include/not_windows.inc ---source include/have_debug.inc ---source include/not_embedded.inc # # Bug#19479:mysqldump creates invalid dump @@ -43,64 +41,3 @@ create table t1(a int, b int, c int); --echo "Try to select from the table. This should not crash the server" select count(a) from t1; drop table t1; - ---echo # ---echo # MDEV-25292 Atomic CREATE OR REPLACE TABLE ---echo # - -# This does not work on Windows because of max path limit 255 -# (actually it does not work for path 254 already) -# Note: on Windows use ER_BAD_DB_ERROR instead of ER_CANT_CREATE_TABLE -# unless MDEV-28746 is fixed. - ---echo # Test multi-byte characters in table name -set names utf8; -let $save_debug=`select @@debug_dbug`; -let $MYSQLD_DATADIR= `SELECT @@datadir`; ---echo # Filename is too long because it is converted to @274e@274e@274e@274e... ---echo # so each '❎' is 5 bytes in filesystem, 51 x 5 = 255 bytes -let $t= `select repeat('❎', 51)`; ---error ER_CANT_CREATE_TABLE -eval create table $t (x int); -# The below case is useful for experimenting on Windows ---echo # Let's find out max length for '❎'... ---disable_query_log -let $i= 50; -while ($i) -{ - let $t= `select repeat('❎', $i)`; - --error 0,ER_CANT_CREATE_TABLE - eval create table $t (x int); - let $good_len= $i; - dec $i; - if (!$mysql_errno) - { - let $i= 0; - } -} -let $fn_len= `select $good_len * 5 + 4`; # 4 is extension length -eval drop table $t; ---enable_query_log ---echo # Acceptable name length: $good_len; Filename length: $fn_len ---echo # OK with 64-characters table name, filesystem name is 40 x 5 + 24 = 224 bytes -let $t= `select concat(repeat('t', 24), repeat('❎', 40))`; -eval create table $t (x int); ---echo # Not OK with 65-characters table name -let $t2= `select concat(repeat('t', 25), repeat('❎', 40))`; ---error ER_WRONG_TABLE_NAME -eval create table $t2 (x int); -show tables; -# Let's try atomic replace with such long name and see what happens -eval create or replace table $t (y int); -eval show create table $t; -set @@debug_dbug="+d,ddl_log_create_after_save_backup", @debug_crash_counter=1; ---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect ---disable_reconnect ---error 2013 -eval create or replace table $t (z int); ---replace_regex /-\w+-\w+-ttt/-PID-TID-ttt/ ---list_files $MYSQLD_DATADIR/test *sql* ---enable_reconnect ---source include/wait_until_connected_again.inc -eval drop table $t; -eval set @@debug_dbug="$save_debug"; diff --git a/mysql-test/main/create_or_replace.result b/mysql-test/main/create_or_replace.result index be863986f78..4e96af97326 100644 --- a/mysql-test/main/create_or_replace.result +++ b/mysql-test/main/create_or_replace.result @@ -1,3 +1,5 @@ +SET @save_persistent=@@GLOBAL.innodb_stats_persistent; +SET GLOBAL innodb_stats_persistent=OFF; CREATE TABLE t2 (a int); INSERT INTO t2 VALUES(1),(2),(3); # @@ -258,8 +260,7 @@ Note 1051 Unknown table 'test.t1,mysqltest2.t2' create table test.t1 (i int) engine=myisam; create table mysqltest2.t2 like test.t1; lock table test.t1 write, mysqltest2.t2 write; -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME # MDL_BACKUP_DDL NULL Backup lock # MDL_BACKUP_DML NULL Backup lock @@ -271,37 +272,24 @@ create or replace table test.t1; ERROR 42000: A table must have at least 1 column show tables; Tables_in_test -t1 t2 -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME # MDL_BACKUP_DDL NULL Backup lock # MDL_BACKUP_DML NULL Backup lock # MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock mysqltest2 # MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock test # MDL_SHARED_NO_READ_WRITE NULL Table metadata lock mysqltest2 t2 -# MDL_SHARED_NO_READ_WRITE NULL Table metadata lock test t1 create or replace table mysqltest2.t2; ERROR 42000: A table must have at least 1 column -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME -# MDL_BACKUP_DDL NULL Backup lock -# MDL_BACKUP_DML NULL Backup lock -# MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock mysqltest2 -# MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock test -# MDL_SHARED_NO_READ_WRITE NULL Table metadata lock mysqltest2 t2 -# MDL_SHARED_NO_READ_WRITE NULL Table metadata lock test t1 -drop table mysqltest2.t2; -drop table t1; create table t1 (i int); drop table t1; create table test.t1 (i int); create table mysqltest2.t2 like test.t1; lock table test.t1 write, mysqltest2.t2 write; -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME # MDL_BACKUP_DDL NULL Backup lock # MDL_BACKUP_DML NULL Backup lock @@ -313,37 +301,24 @@ create or replace table test.t1 (a int) select 1 as 'a', 2 as 'a'; ERROR 42S21: Duplicate column name 'a' show tables; Tables_in_test -t1 t2 -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME # MDL_BACKUP_DDL NULL Backup lock # MDL_BACKUP_DML NULL Backup lock # MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock mysqltest2 # MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock test # MDL_SHARED_NO_READ_WRITE NULL Table metadata lock mysqltest2 t2 -# MDL_SHARED_NO_READ_WRITE NULL Table metadata lock test t1 create or replace table mysqltest2.t2 (a int) select 1 as 'a', 2 as 'a'; ERROR 42S21: Duplicate column name 'a' -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME -# MDL_BACKUP_DDL NULL Backup lock -# MDL_BACKUP_DML NULL Backup lock -# MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock mysqltest2 -# MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock test -# MDL_SHARED_NO_READ_WRITE NULL Table metadata lock mysqltest2 t2 -# MDL_SHARED_NO_READ_WRITE NULL Table metadata lock test t1 -drop table mysqltest2.t2; -drop table t1; create table t1 (i int); drop table t1; create table test.t1 (i int) engine=innodb; create table mysqltest2.t2 like test.t1; lock table test.t1 write, mysqltest2.t2 write; -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME # MDL_BACKUP_DDL NULL Backup lock # MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock mysqltest2 @@ -355,8 +330,7 @@ drop table test.t1,mysqltest2.t2; create table test.t1 (i int) engine=aria transactional=1 checksum=1; create table mysqltest2.t2 like test.t1; lock table test.t1 write, mysqltest2.t2 write; -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME # MDL_BACKUP_DDL NULL Backup lock # MDL_INTENTION_EXCLUSIVE NULL Schema metadata lock mysqltest2 @@ -373,8 +347,7 @@ drop table test.t1; # create table t1 (i int); lock table t1 write; -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME # MDL_BACKUP_DDL NULL Backup lock # MDL_BACKUP_DML NULL Backup lock @@ -382,12 +355,10 @@ THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME # MDL_SHARED_NO_READ_WRITE NULL Table metadata lock test t1 create or replace table t1 (a char(1)) engine=Innodb select 'foo' as a; ERROR 22001: Data too long for column 'a' at row 1 -drop table t1; show tables; Tables_in_test t2 -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME create table t1 (i int); drop table t1; @@ -475,8 +446,7 @@ drop view t1; # create table t1 (a int); lock table t1 write, t2 read; -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME # MDL_BACKUP_DDL NULL Backup lock # MDL_BACKUP_DML NULL Backup lock @@ -484,8 +454,7 @@ THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME # MDL_SHARED_NO_READ_WRITE NULL Table metadata lock test t1 # MDL_SHARED_READ NULL Table metadata lock test t2 create or replace table t1 (i int); -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME # MDL_BACKUP_DDL NULL Backup lock # MDL_BACKUP_DML NULL Backup lock @@ -493,8 +462,7 @@ THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME # MDL_SHARED_NO_READ_WRITE NULL Table metadata lock test t1 # MDL_SHARED_READ NULL Table metadata lock test t2 create or replace table t1 like t2; -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME # MDL_BACKUP_DDL NULL Backup lock # MDL_BACKUP_DML NULL Backup lock @@ -502,8 +470,7 @@ THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME # MDL_SHARED_NO_READ_WRITE NULL Table metadata lock test t1 # MDL_SHARED_READ NULL Table metadata lock test t2 create or replace table t1 select 1 as f1; -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME # MDL_BACKUP_DDL NULL Backup lock # MDL_BACKUP_DML NULL Backup lock @@ -612,320 +579,4 @@ DROP TABLE IF EXISTS tm, t; # # End of 10.3 tests # -# End of 10.4 tests -# -# MDEV-25292 Atomic CREATE OR REPLACE TABLE -# -create table t1 (a int); -insert t1 values (1), (1); -create table t2 (c int); -create or replace table t2 (a int, b int, key k (a), key k (b)); -ERROR 42000: Duplicate key name 'k' -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `c` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -create or replace table t2 (a int, b int, key k (a), key k (b)) as select a, a as b from t1; -ERROR 42000: Duplicate key name 'k' -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `c` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -create or replace table t2 (a int primary key) as select * from t1; -ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `c` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -set @old_mode= @@sql_mode; -set @@sql_mode='ALLOW_INVALID_DATES'; -create table t3 (dt datetime default '2008-02-31 00:00:00'); -set @@sql_mode= @old_mode; -create or replace table t2 like t3; -ERROR 42000: Invalid default value for 'dt' -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `c` int(11) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -# LOCK TABLES -lock tables t2 write, t1 write; -flush tables; -show open tables like 't2'; -Database Table In_use Name_locked -test t2 1 0 -create or replace table t2 (y int); -flush tables; -show open tables like 't2'; -Database Table In_use Name_locked -test t2 1 0 -create or replace table t2 like t1; -flush tables; -show open tables like 't2'; -Database Table In_use Name_locked -test t2 1 0 -create or replace table t2 (y int) as select * from t1; -flush tables; -show open tables like 't2'; -Database Table In_use Name_locked -test t2 1 0 -unlock tables; -# SP -create or replace procedure sp(n int) -begin -select concat('sp call ', n, ':') as ''; -show open tables like 't2'; -create or replace table t2 (y int); -select 'create or replace table t2 (y int);' as ''; -show open tables like 't2'; -insert into t2 values (2); -select 'insert into t2 values (2);' as ''; -show open tables like 't2'; -create or replace table t2 like t1; -select 'create or replace table t2 like t1;' as ''; -show open tables like 't2'; -create or replace table t2 (y int) as select * from t1; -select 'create or replace table t2 (y int) as select * from t1;' as ''; -show open tables like 't2'; -select 'select * from t2;' as ''; -select * from t2; -show open tables like 't2'; -end $ -flush tables; -call sp(1); - -sp call 1: -Database Table In_use Name_locked - -create or replace table t2 (y int); -Database Table In_use Name_locked - -insert into t2 values (2); -Database Table In_use Name_locked -test t2 0 0 - -create or replace table t2 like t1; -Database Table In_use Name_locked - -create or replace table t2 (y int) as select * from t1; -Database Table In_use Name_locked - -select * from t2; -y a -NULL 1 -NULL 1 -Database Table In_use Name_locked -test t2 0 0 -call sp(2); - -sp call 2: -Database Table In_use Name_locked -test t2 0 0 - -create or replace table t2 (y int); -Database Table In_use Name_locked - -insert into t2 values (2); -Database Table In_use Name_locked -test t2 0 0 - -create or replace table t2 like t1; -Database Table In_use Name_locked - -create or replace table t2 (y int) as select * from t1; -Database Table In_use Name_locked - -select * from t2; -y a -NULL 1 -NULL 1 -Database Table In_use Name_locked -test t2 0 0 -# SP under LOCK TABLES -lock tables t2 write, t1 write; -call sp(3); - -sp call 3: -Database Table In_use Name_locked -test t2 1 0 - -create or replace table t2 (y int); -Database Table In_use Name_locked -test t2 1 0 - -insert into t2 values (2); -Database Table In_use Name_locked -test t2 1 0 - -create or replace table t2 like t1; -Database Table In_use Name_locked -test t2 1 0 - -create or replace table t2 (y int) as select * from t1; -Database Table In_use Name_locked -test t2 1 0 - -select * from t2; -y a -NULL 1 -NULL 1 -Database Table In_use Name_locked -test t2 1 0 -call sp(4); - -sp call 4: -Database Table In_use Name_locked -test t2 1 0 - -create or replace table t2 (y int); -Database Table In_use Name_locked -test t2 1 0 - -insert into t2 values (2); -Database Table In_use Name_locked -test t2 1 0 - -create or replace table t2 like t1; -Database Table In_use Name_locked -test t2 1 0 - -create or replace table t2 (y int) as select * from t1; -Database Table In_use Name_locked -test t2 1 0 - -select * from t2; -y a -NULL 1 -NULL 1 -Database Table In_use Name_locked -test t2 1 0 -unlock tables; -drop procedure sp; -drop tables t1, t2, t3; -# Trigger -create table t1 (a int); -create trigger a before insert on t1 for each row set @s= 1; -create or replace table t1 (old int); -show create trigger a; -ERROR HY000: Trigger does not exist -drop table t1; -# PS: check thd->change_list sanity -create table t1 (a int not null, b char(10) as (concat('', dayname('2020-02-02')))) collate utf8_bin; -prepare stmt from 'insert into t1 (b) values (2)'; -create or replace table t1 (x int); -drop table t1; -drop prepare stmt; -# Foreign keys -create table t1 (x int primary key, y int) engine innodb; -create table t2 (x int references t1(x)) engine innodb; -create or replace table t1 (x int primary key); -ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (t2) -create or replace table t1 (x int primary key); -ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (t2) -create table t3 (x int); -create or replace table t1 like t3; -ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (t2) -create or replace table t1 like t3; -ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (t2) -create or replace table t1 select * from t3; -ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (t2) -create or replace table t1 select * from t3; -ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (t2) -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `x` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`x`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -drop tables t3, t2, t1; -# UNIQUE -create table t1 (pk int auto_increment primary key, a varchar(2300), unique (a)) engine aria; -insert into t1 (a) values ('a'), ('b'), ('c'); -create table t2 (x int); -create or replace table t2 engine aria select * from t1; -select * from t2; -pk a -1 a -2 b -3 c -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `pk` int(11) NOT NULL DEFAULT 0, - `a` varchar(2300) DEFAULT NULL -) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 -drop tables t2, t1; -# -# MDEV-28956 Locking is broken if CREATE OR REPLACE fails under LOCK TABLES -# -# Atomic CREATE OR REPLACE part: -# -create table t1 (pk int primary key) engine=innodb; -create or replace table t2 (a int primary key references t1 (pk)) engine=innodb; -lock tables t1 write, t2 write; -create or replace table t2 (c1 int not null, c1 varchar(255) ) engine=innodb; -ERROR 42S21: Duplicate column name 'c1' -select * from t1; -pk -select * from t2; -a -unlock tables; -drop tables t2, t1; -# -# MDEV-28933 CREATE OR REPLACE fails to recreate same constraint name -# -use test; -create table t (a int primary key) engine=innodb; -create or replace table u ( -a int primary key, -constraint c foreign key d (a) references t (a)) engine=innodb; -select * from information_schema.innodb_sys_foreign; -ID FOR_NAME REF_NAME N_COLS TYPE -test/c test/u test/t 1 0 -select * from information_schema.innodb_sys_foreign_cols; -ID FOR_COL_NAME REF_COL_NAME POS -test/c a a 0 -create or replace table u ( -a int primary key, -constraint c foreign key d (a) references t (a)) engine=innodb; -select * from information_schema.innodb_sys_foreign; -ID FOR_NAME REF_NAME N_COLS TYPE -test/c test/u test/t 1 0 -select * from information_schema.innodb_sys_foreign_cols; -ID FOR_COL_NAME REF_COL_NAME POS -test/c a a 0 -drop tables u, t; -select * from information_schema.innodb_sys_foreign; -ID FOR_NAME REF_NAME N_COLS TYPE -select * from information_schema.innodb_sys_foreign_cols; -ID FOR_COL_NAME REF_COL_NAME POS -# -# MDEV-29544 SIGSEGV in HA_CREATE_INFO::finalize_locked_tables -# -call mtr.add_suppression("mysql.innodb_index_stats"); -set sql_mode= ''; -create table t (x int) engine innodb; -insert into t values (77); -alter table mysql.innodb_index_stats modify stat_description char(10); -Warnings: -Warning 1265 Data truncated for column 'stat_description' at row 2 -Warning 1265 Data truncated for column 'stat_description' at row 3 -lock table t write; -create or replace table t (y int); -ERROR HY000: Error on rename of './test/t' to './test/#sql-backup-t' (errno: 168 "Unknown (generic) error from engine") -unlock tables; -alter table mysql.innodb_index_stats modify stat_description varchar(1024) not null; -select * from t; -x -77 -drop table t; -set sql_mode= default; -# -# MDEV-29620 Assertion `next_insert_id == 0' failed in handler::ha_external_lock -# -create or replace table t1 (i serial) as select * from (values(1), (2)) dt; -drop table t1; +SET GLOBAL innodb_stats_persistent=@save_persistent; diff --git a/mysql-test/main/create_or_replace.test b/mysql-test/main/create_or_replace.test index 3622d8342f4..05c5d25ba15 100644 --- a/mysql-test/main/create_or_replace.test +++ b/mysql-test/main/create_or_replace.test @@ -5,7 +5,8 @@ --source include/have_innodb.inc --source include/have_metadata_lock_info.inc -let $MYSQLD_DATADIR= `SELECT @@datadir`; +SET @save_persistent=@@GLOBAL.innodb_stats_persistent; +SET GLOBAL innodb_stats_persistent=OFF; # # Create help table @@ -217,23 +218,18 @@ create table mysqltest2.t2 like test.t1; lock table test.t1 write, mysqltest2.t2 write; --replace_column 1 # --sorted_result -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; --error ER_TABLE_MUST_HAVE_COLUMNS create or replace table test.t1; show tables; --replace_column 1 # --sorted_result -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; --error ER_TABLE_MUST_HAVE_COLUMNS create or replace table mysqltest2.t2; --replace_column 1 # --sorted_result -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; -drop table mysqltest2.t2; -drop table t1; +select * from information_schema.metadata_lock_info; create table t1 (i int); drop table t1; @@ -242,23 +238,18 @@ create table mysqltest2.t2 like test.t1; lock table test.t1 write, mysqltest2.t2 write; --replace_column 1 # --sorted_result -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; --error ER_DUP_FIELDNAME create or replace table test.t1 (a int) select 1 as 'a', 2 as 'a'; show tables; --replace_column 1 # --sorted_result -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; --error ER_DUP_FIELDNAME create or replace table mysqltest2.t2 (a int) select 1 as 'a', 2 as 'a'; --replace_column 1 # --sorted_result -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; -drop table mysqltest2.t2; -drop table t1; +select * from information_schema.metadata_lock_info; create table t1 (i int); drop table t1; @@ -267,8 +258,7 @@ create table mysqltest2.t2 like test.t1; lock table test.t1 write, mysqltest2.t2 write; --replace_column 1 # --sorted_result -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; unlock tables; drop table test.t1,mysqltest2.t2; @@ -277,8 +267,7 @@ create table mysqltest2.t2 like test.t1; lock table test.t1 write, mysqltest2.t2 write; --replace_column 1 # --sorted_result -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; unlock tables; drop table t1; @@ -294,16 +283,13 @@ create table t1 (i int); lock table t1 write; --replace_column 1 # --sorted_result -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; --error ER_DATA_TOO_LONG create or replace table t1 (a char(1)) engine=Innodb select 'foo' as a; -drop table t1; show tables; --replace_column 1 # --sorted_result -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; create table t1 (i int); drop table t1; --enable_view_protocol @@ -381,24 +367,20 @@ create table t1 (a int); lock table t1 write, t2 read; --replace_column 1 # --sorted_result -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; create or replace table t1 (i int); --replace_column 1 # --sorted_result -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; create or replace table t1 like t2; --replace_column 1 # --sorted_result -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; create or replace table t1 select 1 as f1; --replace_column 1 # --sorted_result -select * from information_schema.metadata_lock_info -where table_schema!='mysql' or table_name not like 'innodb_%_stats'; +select * from information_schema.metadata_lock_info; drop table t1; unlock tables; @@ -546,182 +528,4 @@ DROP TABLE IF EXISTS tm, t; --echo # End of 10.3 tests --echo # ---echo # End of 10.4 tests - ---echo # ---echo # MDEV-25292 Atomic CREATE OR REPLACE TABLE ---echo # -create table t1 (a int); -insert t1 values (1), (1); -create table t2 (c int); ---error ER_DUP_KEYNAME -create or replace table t2 (a int, b int, key k (a), key k (b)); -show create table t2; ---error ER_DUP_KEYNAME -create or replace table t2 (a int, b int, key k (a), key k (b)) as select a, a as b from t1; -show create table t2; ---error ER_DUP_ENTRY -create or replace table t2 (a int primary key) as select * from t1; -show create table t2; -set @old_mode= @@sql_mode; -set @@sql_mode='ALLOW_INVALID_DATES'; -create table t3 (dt datetime default '2008-02-31 00:00:00'); -set @@sql_mode= @old_mode; ---error ER_INVALID_DEFAULT -create or replace table t2 like t3; -show create table t2; ---echo # LOCK TABLES -lock tables t2 write, t1 write; -flush tables; -show open tables like 't2'; -create or replace table t2 (y int); -flush tables; -show open tables like 't2'; -create or replace table t2 like t1; -flush tables; -show open tables like 't2'; -create or replace table t2 (y int) as select * from t1; -flush tables; -show open tables like 't2'; -unlock tables; ---echo # SP ---delimiter $ -create or replace procedure sp(n int) -begin - select concat('sp call ', n, ':') as ''; - show open tables like 't2'; - create or replace table t2 (y int); - select 'create or replace table t2 (y int);' as ''; - show open tables like 't2'; - insert into t2 values (2); - select 'insert into t2 values (2);' as ''; - show open tables like 't2'; - create or replace table t2 like t1; - select 'create or replace table t2 like t1;' as ''; - show open tables like 't2'; - create or replace table t2 (y int) as select * from t1; - select 'create or replace table t2 (y int) as select * from t1;' as ''; - show open tables like 't2'; - select 'select * from t2;' as ''; - select * from t2; - show open tables like 't2'; -end $ ---delimiter ; -flush tables; -call sp(1); call sp(2); ---echo # SP under LOCK TABLES -lock tables t2 write, t1 write; -call sp(3); call sp(4); -unlock tables; -drop procedure sp; -drop tables t1, t2, t3; ---echo # Trigger -create table t1 (a int); -create trigger a before insert on t1 for each row set @s= 1; -create or replace table t1 (old int); ---error ER_TRG_DOES_NOT_EXIST -show create trigger a; -drop table t1; ---echo # PS: check thd->change_list sanity -create table t1 (a int not null, b char(10) as (concat('', dayname('2020-02-02')))) collate utf8_bin; -prepare stmt from 'insert into t1 (b) values (2)'; -create or replace table t1 (x int); -drop table t1; -drop prepare stmt; ---echo # Foreign keys ---list_files $MYSQLD_DATADIR/test *sql* -create table t1 (x int primary key, y int) engine innodb; -create table t2 (x int references t1(x)) engine innodb; ---error ER_ROW_IS_REFERENCED_2 -create or replace table t1 (x int primary key); ---list_files $MYSQLD_DATADIR/test *sql* ---error ER_ROW_IS_REFERENCED_2 -create or replace table t1 (x int primary key); -create table t3 (x int); ---error ER_ROW_IS_REFERENCED_2 -create or replace table t1 like t3; ---list_files $MYSQLD_DATADIR/test *sql* ---error ER_ROW_IS_REFERENCED_2 -create or replace table t1 like t3; ---error ER_ROW_IS_REFERENCED_2 -create or replace table t1 select * from t3; ---error ER_ROW_IS_REFERENCED_2 -create or replace table t1 select * from t3; ---list_files $MYSQLD_DATADIR/test *sql* -show create table t1; -drop tables t3, t2, t1; ---echo # UNIQUE -create table t1 (pk int auto_increment primary key, a varchar(2300), unique (a)) engine aria; -insert into t1 (a) values ('a'), ('b'), ('c'); -create table t2 (x int); -create or replace table t2 engine aria select * from t1; -select * from t2; -show create table t2; -drop tables t2, t1; - ---echo # ---echo # MDEV-28956 Locking is broken if CREATE OR REPLACE fails under LOCK TABLES ---echo # ---echo # Atomic CREATE OR REPLACE part: ---echo # ---disable_service_connection -create table t1 (pk int primary key) engine=innodb; -create or replace table t2 (a int primary key references t1 (pk)) engine=innodb; - -lock tables t1 write, t2 write; ---error ER_DUP_FIELDNAME -create or replace table t2 (c1 int not null, c1 varchar(255) ) engine=innodb; -select * from t1; -select * from t2; -unlock tables; - -drop tables t2, t1; ---enable_service_connection - ---echo # ---echo # MDEV-28933 CREATE OR REPLACE fails to recreate same constraint name ---echo # -use test; -create table t (a int primary key) engine=innodb; -create or replace table u ( - a int primary key, - constraint c foreign key d (a) references t (a)) engine=innodb; - -select * from information_schema.innodb_sys_foreign; -select * from information_schema.innodb_sys_foreign_cols; - -create or replace table u ( - a int primary key, - constraint c foreign key d (a) references t (a)) engine=innodb; - -select * from information_schema.innodb_sys_foreign; -select * from information_schema.innodb_sys_foreign_cols; -drop tables u, t; -select * from information_schema.innodb_sys_foreign; -select * from information_schema.innodb_sys_foreign_cols; - ---echo # ---echo # MDEV-29544 SIGSEGV in HA_CREATE_INFO::finalize_locked_tables ---echo # -call mtr.add_suppression("mysql.innodb_index_stats"); -set sql_mode= ''; -create table t (x int) engine innodb; -insert into t values (77); -alter table mysql.innodb_index_stats modify stat_description char(10); -lock table t write; ---replace_regex /#sql-backup-.+-.+-/#sql-backup-/ ---replace_result $MYSQLD_DATADIR ./ ---error ER_ERROR_ON_RENAME -create or replace table t (y int); -# cleanup -unlock tables; -alter table mysql.innodb_index_stats modify stat_description varchar(1024) not null; -select * from t; -drop table t; -set sql_mode= default; - ---echo # ---echo # MDEV-29620 Assertion `next_insert_id == 0' failed in handler::ha_external_lock ---echo # -create or replace table t1 (i serial) as select * from (values(1), (2)) dt; -drop table t1; +SET GLOBAL innodb_stats_persistent=@save_persistent; diff --git a/mysql-test/main/create_or_replace2.result b/mysql-test/main/create_or_replace2.result new file mode 100644 index 00000000000..c84d54004ca --- /dev/null +++ b/mysql-test/main/create_or_replace2.result @@ -0,0 +1,27 @@ +include/master-slave.inc +[connection master] +drop table if exists t1; +SET @old_debug= @@session.debug; +CREATE TABLE t1 (i INT, KEY(i)) ENGINE=InnoDB; +CREATE OR REPLACE TEMPORARY TABLE tmp (a int, b int, key(a)) engine=myisam; +SET debug_dbug='+d,send_kill_after_delete'; +CREATE OR REPLACE TABLE t1 LIKE tmp; +SET debug_dbug=@old_debug; +SHOW TABLES; +Tables_in_test +t1 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +connection slave; +SHOW TABLES; +Tables_in_test +t1 +connection master; +drop temporary table if exists tmp; +drop table t1; +include/rpl_end.inc diff --git a/mysql-test/main/create_or_replace2.test b/mysql-test/main/create_or_replace2.test new file mode 100644 index 00000000000..80c8b635d8d --- /dev/null +++ b/mysql-test/main/create_or_replace2.test @@ -0,0 +1,35 @@ +# +# Check CREATE OR REPLACE TABLE for test that requires DEBUG +# + +--source include/have_debug.inc +--source include/have_binlog_format_row.inc +--source include/have_innodb.inc +--source include/master-slave.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings +SET @old_debug= @@session.debug; + +# +# MDEV-5854 +# Interrupted CREATE OR REPLACE is written into binlog, and in a wrong format +# + +CREATE TABLE t1 (i INT, KEY(i)) ENGINE=InnoDB; +CREATE OR REPLACE TEMPORARY TABLE tmp (a int, b int, key(a)) engine=myisam; +SET debug_dbug='+d,send_kill_after_delete'; +CREATE OR REPLACE TABLE t1 LIKE tmp; +SET debug_dbug=@old_debug; +SHOW TABLES; +show create table t1; +--sync_slave_with_master +SHOW TABLES; +--connection master + +--disable_warnings +drop temporary table if exists tmp; +--enable_warnings +drop table t1; +--source include/rpl_end.inc diff --git a/mysql-test/main/create_replace_debug.result b/mysql-test/main/create_replace_debug.result deleted file mode 100644 index 3a3ef21bdec..00000000000 --- a/mysql-test/main/create_replace_debug.result +++ /dev/null @@ -1,103 +0,0 @@ -include/master-slave.inc -[connection master] -drop table if exists t1; -SET @old_debug= @@session.debug; -CREATE TABLE t1 (i INT, KEY(i)) ENGINE=InnoDB; -CREATE OR REPLACE TEMPORARY TABLE tmp (a int, b int, key(a)) engine=myisam; -SET debug_dbug='+d,send_kill_after_delete'; -CREATE OR REPLACE TABLE t1 LIKE tmp; -SET debug_dbug=@old_debug; -SHOW TABLES; -Tables_in_test -t1 -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL, - KEY `a` (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -connection slave; -SHOW TABLES; -Tables_in_test -t1 -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL, - KEY `a` (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -connection master; -drop temporary table if exists tmp; -drop table t1; -include/rpl_end.inc -# -# MDEV-25292 Atomic CREATE OR REPLACE TABLE -# -set @saved_debug_dbug= @@session.debug_dbug; -create table t1 (a int primary key) engine innodb; -insert t1 values (1), (2); -create table t2 (c int, a int constraint t1_a references t1 (a)) engine innodb; -insert into t2 values (2, 2); -lock tables t2 write, t1 write; -set session debug_dbug= '+d,atomic_replace_external_lock_fail'; -create or replace table t2 (y int) as select * from t1; -ERROR HY000: The total number of locks exceeds the lock table size -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` int(11) NOT NULL, - PRIMARY KEY (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `c` int(11) DEFAULT NULL, - `a` int(11) DEFAULT NULL, - KEY `t1_a` (`a`), - CONSTRAINT `t1_a` FOREIGN KEY (`a`) REFERENCES `t1` (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -select * from t2; -c a -2 2 -unlock tables; -drop tables t2, t1; -set session debug_dbug= @saved_debug_dbug; -# Test entry_pos in higher position, so drop chain executes before create chain -# (see commit message: On linking two chains together) -create table t1 (c int); -create or replace table t1 (a int, b int, key k (a), key k (b)); -ERROR 42000: Duplicate key name 'k' -create or replace table t1 (a int, b int, key k (a), key k (b)); -ERROR 42000: Duplicate key name 'k' -drop table t1; -# -# MDEV-28956 Locking is broken if CREATE OR REPLACE fails under LOCK TABLES -# -# Non-atomic CREATE OR REPLACE part: -# -set @saved_debug_dbug= @@session.debug_dbug; -set @@debug_dbug="+d,ddl_log_expensive_rename"; -create table t1 (pk int primary key) engine=innodb; -create or replace table t2 (a int primary key references t1 (pk)) engine=innodb; -lock tables t1 write, t2 write; -create or replace table t2 (c1 int not null, c1 varchar(255) ) engine=innodb; -ERROR 42S21: Duplicate column name 'c1' -select * from t1; -pk -select * from t2; -ERROR HY000: Table 't2' was not locked with LOCK TABLES -unlock tables; -drop tables t1; -set @@debug_dbug= @saved_debug_dbug; -# -# MDEV-29664 Assertion `!n_mysql_tables_in_use' failed in innobase_close_connection -# -create table t1 (x int); -set @old_dbug= @@debug_dbug; -set @@debug_dbug= '+d,ha_end_bulk_insert_fail'; -create or replace table t2 (y int) engine innodb select * from t1; -ERROR HY000: Out of memory. -set @@debug_dbug= @old_dbug; -drop table t1; diff --git a/mysql-test/main/create_replace_debug.test b/mysql-test/main/create_replace_debug.test deleted file mode 100644 index 86e68c47743..00000000000 --- a/mysql-test/main/create_replace_debug.test +++ /dev/null @@ -1,99 +0,0 @@ -# -# Check CREATE OR REPLACE TABLE for test that requires DEBUG -# - ---source include/have_debug.inc ---source include/have_binlog_format_row.inc ---source include/have_innodb.inc ---source include/master-slave.inc - ---disable_warnings -drop table if exists t1; ---enable_warnings -SET @old_debug= @@session.debug; - -# -# MDEV-5854 -# Interrupted CREATE OR REPLACE is written into binlog, and in a wrong format -# - -CREATE TABLE t1 (i INT, KEY(i)) ENGINE=InnoDB; -CREATE OR REPLACE TEMPORARY TABLE tmp (a int, b int, key(a)) engine=myisam; -SET debug_dbug='+d,send_kill_after_delete'; -CREATE OR REPLACE TABLE t1 LIKE tmp; -SET debug_dbug=@old_debug; -SHOW TABLES; -show create table t1; ---sync_slave_with_master -SHOW TABLES; -show create table t1; ---connection master - ---disable_warnings -drop temporary table if exists tmp; ---enable_warnings -drop table t1; ---source include/rpl_end.inc - - ---echo # ---echo # MDEV-25292 Atomic CREATE OR REPLACE TABLE ---echo # -set @saved_debug_dbug= @@session.debug_dbug; -create table t1 (a int primary key) engine innodb; -insert t1 values (1), (2); -create table t2 (c int, a int constraint t1_a references t1 (a)) engine innodb; -insert into t2 values (2, 2); -lock tables t2 write, t1 write; -set session debug_dbug= '+d,atomic_replace_external_lock_fail'; ---error ER_LOCK_TABLE_FULL -create or replace table t2 (y int) as select * from t1; -let $MYSQLD_DATADIR= `SELECT @@datadir`; ---list_files $MYSQLD_DATADIR/test *sql* -show create table t1; -show create table t2; -select * from t2; -unlock tables; -drop tables t2, t1; -set session debug_dbug= @saved_debug_dbug; - ---echo # Test entry_pos in higher position, so drop chain executes before create chain ---echo # (see commit message: On linking two chains together) -create table t1 (c int); ---error ER_DUP_KEYNAME -create or replace table t1 (a int, b int, key k (a), key k (b)); ---error ER_DUP_KEYNAME -create or replace table t1 (a int, b int, key k (a), key k (b)); -drop table t1; - ---echo # ---echo # MDEV-28956 Locking is broken if CREATE OR REPLACE fails under LOCK TABLES ---echo # ---echo # Non-atomic CREATE OR REPLACE part: ---echo # -set @saved_debug_dbug= @@session.debug_dbug; -set @@debug_dbug="+d,ddl_log_expensive_rename"; -create table t1 (pk int primary key) engine=innodb; -create or replace table t2 (a int primary key references t1 (pk)) engine=innodb; - -lock tables t1 write, t2 write; ---error ER_DUP_FIELDNAME -create or replace table t2 (c1 int not null, c1 varchar(255) ) engine=innodb; -select * from t1; ---error ER_TABLE_NOT_LOCKED -select * from t2; -unlock tables; - -drop tables t1; -set @@debug_dbug= @saved_debug_dbug; - ---echo # ---echo # MDEV-29664 Assertion `!n_mysql_tables_in_use' failed in innobase_close_connection ---echo # -create table t1 (x int); -set @old_dbug= @@debug_dbug; -set @@debug_dbug= '+d,ha_end_bulk_insert_fail'; ---error ER_OUT_OF_RESOURCES -create or replace table t2 (y int) engine innodb select * from t1; -set @@debug_dbug= @old_dbug; -drop table t1; diff --git a/mysql-test/main/default.result b/mysql-test/main/default.result index 874f3af25e0..abcf3b27c9c 100644 --- a/mysql-test/main/default.result +++ b/mysql-test/main/default.result @@ -428,6 +428,14 @@ a b c e 2 -1 1 1 drop table t1; # +# Create or replace can delete a table on error +# +create table t1 (a int); +create or replace table t1 (a int default b, b int default a); +ERROR 01000: Expression for field `a` is referring to uninitialized field `b` +show create table t1; +ERROR 42S02: Table 'test.t1' doesn't exist +# # Refering to other columns # create or replace table t1 (a int default 1, b int default a); @@ -445,11 +453,11 @@ ERROR 01000: Expression for field `a` is referring to uninitialized field `a` create or replace table t1 (a int default b, b int default (1+1)); create or replace table t1 (a int default 1, b int as (c), c int as (a+1)); ERROR 01000: Expression for field `b` is referring to uninitialized field `c` -CREATE OR REPLACE TABLE t1 (a INT DEFAULT (DEFAULT(a))); +CREATE TABLE t1 (a INT DEFAULT (DEFAULT(a))); ERROR 01000: Expression for field `a` is referring to uninitialized field `a` -CREATE OR REPLACE TABLE t1 (a INT DEFAULT(DEFAULT(b)), b INT DEFAULT(DEFAULT(a))); +CREATE TABLE t1 (a INT DEFAULT(DEFAULT(b)), b INT DEFAULT(DEFAULT(a))); ERROR 01000: Expression for field `a` is referring to uninitialized field `b` -CREATE OR REPLACE TABLE t1 (a INT DEFAULT(DEFAULT(b)) NOT NULL, b INT DEFAULT(DEFAULT(a)) NOT NULL); +CREATE TABLE t1 (a INT DEFAULT(DEFAULT(b)) NOT NULL, b INT DEFAULT(DEFAULT(a)) NOT NULL); ERROR 01000: Expression for field `a` is referring to uninitialized field `b` # # Allow defaults to refer to not default fields diff --git a/mysql-test/main/default.test b/mysql-test/main/default.test index 36a616551d7..26fc2186533 100644 --- a/mysql-test/main/default.test +++ b/mysql-test/main/default.test @@ -307,6 +307,15 @@ insert into t1 values(); select * from t1; drop table t1; +--echo # +--echo # Create or replace can delete a table on error +--echo # +create table t1 (a int); +--error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD +create or replace table t1 (a int default b, b int default a); +--error ER_NO_SUCH_TABLE +show create table t1; + --echo # --echo # Refering to other columns --echo # @@ -329,11 +338,11 @@ create or replace table t1 (a int default b, b int default (1+1)); --error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD create or replace table t1 (a int default 1, b int as (c), c int as (a+1)); --error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD -CREATE OR REPLACE TABLE t1 (a INT DEFAULT (DEFAULT(a))); +CREATE TABLE t1 (a INT DEFAULT (DEFAULT(a))); --error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD -CREATE OR REPLACE TABLE t1 (a INT DEFAULT(DEFAULT(b)), b INT DEFAULT(DEFAULT(a))); +CREATE TABLE t1 (a INT DEFAULT(DEFAULT(b)), b INT DEFAULT(DEFAULT(a))); --error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD -CREATE OR REPLACE TABLE t1 (a INT DEFAULT(DEFAULT(b)) NOT NULL, b INT DEFAULT(DEFAULT(a)) NOT NULL); +CREATE TABLE t1 (a INT DEFAULT(DEFAULT(b)) NOT NULL, b INT DEFAULT(DEFAULT(a)) NOT NULL); --echo # --echo # Allow defaults to refer to not default fields diff --git a/mysql-test/main/long_unique_bugs.result b/mysql-test/main/long_unique_bugs.result index b0d64c1f284..31fa5f8c8d5 100644 --- a/mysql-test/main/long_unique_bugs.result +++ b/mysql-test/main/long_unique_bugs.result @@ -397,8 +397,7 @@ c d create or replace table t2 (a int, b blob, unique(b)) as select * from t1; ERROR 23000: Duplicate entry 'bar' for key 'b' select * from t2; -c d -3 bar +ERROR 42S02: Table 'test.t2' doesn't exist create or replace table t2 (a int, b blob, unique(b)) ignore as select * from t1; Warnings: Warning 1062 Duplicate entry 'bar' for key 'b' diff --git a/mysql-test/main/long_unique_bugs.test b/mysql-test/main/long_unique_bugs.test index e522f5140ba..18e430858b0 100644 --- a/mysql-test/main/long_unique_bugs.test +++ b/mysql-test/main/long_unique_bugs.test @@ -480,6 +480,7 @@ delete from t2 using t1, t2 where t1.a=t2.c and t1.b='foo'; # CREATE...SELECT --error ER_DUP_ENTRY create or replace table t2 (a int, b blob, unique(b)) as select * from t1; +--error ER_NO_SUCH_TABLE select * from t2; create or replace table t2 (a int, b blob, unique(b)) ignore as select * from t1; select * from t2; diff --git a/mysql-test/suite/atomic/create_replace,aria_notrans,row.result b/mysql-test/suite/atomic/create_replace,aria_notrans,row.result deleted file mode 100644 index c8df035b23a..00000000000 --- a/mysql-test/suite/atomic/create_replace,aria_notrans,row.result +++ /dev/null @@ -1,710 +0,0 @@ -# Crash recovery -Table Create Table -const_table CREATE TABLE `const_table` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -insert into const_table values (1, 1), (2, 2); -flush tables; -# QUERY: CREATE OR REPLACE TABLE t1 (new int) engine=aria,transactional=0 -# CRASH POINT: ddl_log_create_before_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_drop_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_rename_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_frm -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_drop -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) engine=aria,transactional=0 -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) engine=aria,transactional=0 -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_save_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_binlog -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_prepare_eof -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) engine=aria,transactional=0 -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_binlog -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) engine=aria,transactional=0 -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) engine=aria,transactional=0 -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) engine=aria,transactional=0 -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) engine=aria,transactional=0 -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# QUERY: CREATE OR REPLACE TABLE t1 LIKE const_table -# CRASH POINT: ddl_log_create_before_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_drop_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_rename_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_frm -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_drop -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_save_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_binlog -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_prepare_eof -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_binlog -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# QUERY: CREATE OR REPLACE TABLE t1 engine=aria,transactional=0 SELECT * from const_table -# CRASH POINT: ddl_log_create_before_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_drop_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_rename_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_frm -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_drop -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=Aria PAGE_CHECKSUM=1 TRANSACTIONAL=0 -master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t1 engine=aria,transactional=0 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_save_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_binlog -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_prepare_eof -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_binlog -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=Aria PAGE_CHECKSUM=1 TRANSACTIONAL=0 -master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t1 engine=aria,transactional=0 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=Aria PAGE_CHECKSUM=1 TRANSACTIONAL=0 -master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t1 engine=aria,transactional=0 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=Aria PAGE_CHECKSUM=1 TRANSACTIONAL=0 -master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t1 engine=aria,transactional=0 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -Warnings: -Note 1051 Unknown table 'test.t1' diff --git a/mysql-test/suite/atomic/create_replace,aria_notrans.result b/mysql-test/suite/atomic/create_replace,aria_notrans.result deleted file mode 100644 index 7a3e47f1312..00000000000 --- a/mysql-test/suite/atomic/create_replace,aria_notrans.result +++ /dev/null @@ -1,696 +0,0 @@ -# Crash recovery -Table Create Table -const_table CREATE TABLE `const_table` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -insert into const_table values (1, 1), (2, 2); -flush tables; -# QUERY: CREATE OR REPLACE TABLE t1 (new int) engine=aria,transactional=0 -# CRASH POINT: ddl_log_create_before_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_drop_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_rename_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_frm -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_drop -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) engine=aria,transactional=0 -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) engine=aria,transactional=0 -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_save_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_binlog -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_prepare_eof -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) engine=aria,transactional=0 -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_binlog -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) engine=aria,transactional=0 -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) engine=aria,transactional=0 -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) engine=aria,transactional=0 -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) engine=aria,transactional=0 -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# QUERY: CREATE OR REPLACE TABLE t1 LIKE const_table -# CRASH POINT: ddl_log_create_before_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_drop_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_rename_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_frm -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_drop -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_save_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_binlog -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_prepare_eof -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_binlog -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# QUERY: CREATE OR REPLACE TABLE t1 engine=aria,transactional=0 SELECT * from const_table -# CRASH POINT: ddl_log_create_before_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_drop_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_rename_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_frm -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_drop -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 engine=aria,transactional=0 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_save_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_binlog -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_prepare_eof -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_binlog -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 engine=aria,transactional=0 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 engine=aria,transactional=0 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 engine=aria,transactional=0 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 engine=aria,transactional=0 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -Warnings: -Note 1051 Unknown table 'test.t1' diff --git a/mysql-test/suite/atomic/create_replace,expensive_rename,row.result b/mysql-test/suite/atomic/create_replace,expensive_rename,row.result deleted file mode 100644 index 5095b1fea03..00000000000 --- a/mysql-test/suite/atomic/create_replace,expensive_rename,row.result +++ /dev/null @@ -1,584 +0,0 @@ -# Crash recovery -Table Create Table -const_table CREATE TABLE `const_table` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -insert into const_table values (1, 1), (2, 2); -flush tables; -# QUERY: CREATE OR REPLACE TABLE t1 (new int) -# CRASH POINT: ddl_log_create_before_install_new -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_log_drop_backup -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_log_rename_backup -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_before_create_frm -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_before_create_table -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_create_table -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_drop -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_save_backup -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_install_new -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_before_binlog -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_prepare_eof -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_binlog -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# QUERY: CREATE OR REPLACE TABLE t1 LIKE const_table -# CRASH POINT: ddl_log_create_before_install_new -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_log_drop_backup -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_log_rename_backup -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_before_create_frm -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_before_create_table -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_create_table -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_drop -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_save_backup -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_install_new -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_before_binlog -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_prepare_eof -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_binlog -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# QUERY: CREATE OR REPLACE TABLE t1 SELECT * from const_table -# CRASH POINT: ddl_log_create_before_install_new -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) -master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_log_drop_backup -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) -master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_log_rename_backup -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) -master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_before_create_frm -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_before_create_table -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_create_table -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_drop -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_save_backup -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) -master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_install_new -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) -master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_before_binlog -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_prepare_eof -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_binlog -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) -master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) -master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) -master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -Warnings: -Note 1051 Unknown table 'test.t1' diff --git a/mysql-test/suite/atomic/create_replace,expensive_rename.result b/mysql-test/suite/atomic/create_replace,expensive_rename.result deleted file mode 100644 index 41405a2c217..00000000000 --- a/mysql-test/suite/atomic/create_replace,expensive_rename.result +++ /dev/null @@ -1,561 +0,0 @@ -# Crash recovery -Table Create Table -const_table CREATE TABLE `const_table` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -insert into const_table values (1, 1), (2, 2); -flush tables; -# QUERY: CREATE OR REPLACE TABLE t1 (new int) -# CRASH POINT: ddl_log_create_before_install_new -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_log_drop_backup -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_log_rename_backup -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_before_create_frm -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_before_create_table -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_create_table -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_drop -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_save_backup -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_install_new -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_before_binlog -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_prepare_eof -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_binlog -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# QUERY: CREATE OR REPLACE TABLE t1 LIKE const_table -# CRASH POINT: ddl_log_create_before_install_new -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_log_drop_backup -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_log_rename_backup -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_before_create_frm -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_before_create_table -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_create_table -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_drop -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_save_backup -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_install_new -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_before_binlog -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_prepare_eof -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_binlog -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# QUERY: CREATE OR REPLACE TABLE t1 SELECT * from const_table -# CRASH POINT: ddl_log_create_before_install_new -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_log_drop_backup -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_log_rename_backup -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_before_create_frm -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_before_create_table -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_create_table -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_drop -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_save_backup -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_install_new -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_before_binlog -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_prepare_eof -master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by ddl recovery */ -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_binlog -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -Warnings: -Note 1051 Unknown table 'test.t1' diff --git a/mysql-test/suite/atomic/create_replace,ib,row.result b/mysql-test/suite/atomic/create_replace,ib,row.result deleted file mode 100644 index a98ff0acbac..00000000000 --- a/mysql-test/suite/atomic/create_replace,ib,row.result +++ /dev/null @@ -1,661 +0,0 @@ -# Crash recovery -Table Create Table -const_table CREATE TABLE `const_table` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -insert into const_table values (1, 1), (2, 2); -flush tables; -# QUERY: CREATE OR REPLACE TABLE t1 (new int) -# CRASH POINT: ddl_log_create_before_install_new -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_drop_backup -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_rename_backup -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_frm -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_table -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_create_table -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_drop -# No crash! -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -# No crash! -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_save_backup -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_install_new -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_binlog -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_prepare_eof -# No crash! -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_binlog -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# QUERY: CREATE OR REPLACE TABLE t1 LIKE const_table -# CRASH POINT: ddl_log_create_before_install_new -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_drop_backup -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_rename_backup -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_frm -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_table -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_create_table -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_drop -# No crash! -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -# No crash! -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_save_backup -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_install_new -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_binlog -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_prepare_eof -# No crash! -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_binlog -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# QUERY: CREATE OR REPLACE TABLE t1 SELECT * from const_table -# CRASH POINT: ddl_log_create_before_install_new -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_drop_backup -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_rename_backup -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_frm -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_table -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_create_table -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_drop -# No crash! -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) -master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_save_backup -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_install_new -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_binlog -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_prepare_eof -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_binlog -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.TRG -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) -master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete2 -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) -master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) -master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -Warnings: -Note 1051 Unknown table 'test.t1' diff --git a/mysql-test/suite/atomic/create_replace,ib.result b/mysql-test/suite/atomic/create_replace,ib.result deleted file mode 100644 index 82041ed7aeb..00000000000 --- a/mysql-test/suite/atomic/create_replace,ib.result +++ /dev/null @@ -1,648 +0,0 @@ -# Crash recovery -Table Create Table -const_table CREATE TABLE `const_table` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -insert into const_table values (1, 1), (2, 2); -flush tables; -# QUERY: CREATE OR REPLACE TABLE t1 (new int) -# CRASH POINT: ddl_log_create_before_install_new -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_drop_backup -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_rename_backup -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_frm -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_table -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_create_table -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_drop -# No crash! -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -# No crash! -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_save_backup -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_install_new -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_binlog -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_prepare_eof -# No crash! -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_binlog -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# QUERY: CREATE OR REPLACE TABLE t1 LIKE const_table -# CRASH POINT: ddl_log_create_before_install_new -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_drop_backup -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_rename_backup -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_frm -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_table -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_create_table -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_drop -# No crash! -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -# No crash! -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_save_backup -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_install_new -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_binlog -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_prepare_eof -# No crash! -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_binlog -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# QUERY: CREATE OR REPLACE TABLE t1 SELECT * from const_table -# CRASH POINT: ddl_log_create_before_install_new -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_drop_backup -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_rename_backup -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_frm -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_table -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_create_table -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_drop -# No crash! -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_save_backup -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_install_new -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_binlog -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_prepare_eof -t1.TRG -t1.frm -t1.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_binlog -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.frm -t1.ibd -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -Warnings: -Note 1051 Unknown table 'test.t1' diff --git a/mysql-test/suite/atomic/create_replace,myisam,row.result b/mysql-test/suite/atomic/create_replace,myisam,row.result deleted file mode 100644 index 507969c557a..00000000000 --- a/mysql-test/suite/atomic/create_replace,myisam,row.result +++ /dev/null @@ -1,710 +0,0 @@ -# Crash recovery -Table Create Table -const_table CREATE TABLE `const_table` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -insert into const_table values (1, 1), (2, 2); -flush tables; -# QUERY: CREATE OR REPLACE TABLE t1 (new int) -# CRASH POINT: ddl_log_create_before_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_drop_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_rename_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_frm -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_drop -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_save_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_binlog -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_prepare_eof -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_binlog -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# QUERY: CREATE OR REPLACE TABLE t1 LIKE const_table -# CRASH POINT: ddl_log_create_before_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_drop_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_rename_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_frm -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_drop -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_save_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_binlog -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_prepare_eof -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_binlog -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# QUERY: CREATE OR REPLACE TABLE t1 SELECT * from const_table -# CRASH POINT: ddl_log_create_before_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_drop_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_rename_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_frm -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_drop -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) -master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_save_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_binlog -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_prepare_eof -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_binlog -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) -master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) -master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) -master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -Warnings: -Note 1051 Unknown table 'test.t1' diff --git a/mysql-test/suite/atomic/create_replace,row.result b/mysql-test/suite/atomic/create_replace,row.result deleted file mode 100644 index d081b92953f..00000000000 --- a/mysql-test/suite/atomic/create_replace,row.result +++ /dev/null @@ -1,710 +0,0 @@ -# Crash recovery -Table Create Table -const_table CREATE TABLE `const_table` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -insert into const_table values (1, 1), (2, 2); -flush tables; -# QUERY: CREATE OR REPLACE TABLE t1 (new int) -# CRASH POINT: ddl_log_create_before_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_drop_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_rename_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_frm -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_drop -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_save_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_binlog -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_prepare_eof -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_binlog -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# QUERY: CREATE OR REPLACE TABLE t1 LIKE const_table -# CRASH POINT: ddl_log_create_before_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_drop_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_rename_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_frm -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_drop -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_save_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_binlog -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_prepare_eof -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_binlog -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# QUERY: CREATE OR REPLACE TABLE t1 SELECT * from const_table -# CRASH POINT: ddl_log_create_before_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_drop_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_rename_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_frm -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_drop -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) PAGE_CHECKSUM=1 -master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_save_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_binlog -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_prepare_eof -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_binlog -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) PAGE_CHECKSUM=1 -master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) PAGE_CHECKSUM=1 -master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) PAGE_CHECKSUM=1 -master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -Warnings: -Note 1051 Unknown table 'test.t1' diff --git a/mysql-test/suite/atomic/create_replace.combinations b/mysql-test/suite/atomic/create_replace.combinations deleted file mode 100644 index 09eb352b1cd..00000000000 --- a/mysql-test/suite/atomic/create_replace.combinations +++ /dev/null @@ -1,6 +0,0 @@ -[ib] -[myisam] -[aria] -[aria_notrans] -[expensive_rename] -[lock_tables] diff --git a/mysql-test/suite/atomic/create_replace.result b/mysql-test/suite/atomic/create_replace.result deleted file mode 100644 index 2c82dbce03e..00000000000 --- a/mysql-test/suite/atomic/create_replace.result +++ /dev/null @@ -1,696 +0,0 @@ -# Crash recovery -Table Create Table -const_table CREATE TABLE `const_table` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -insert into const_table values (1, 1), (2, 2); -flush tables; -# QUERY: CREATE OR REPLACE TABLE t1 (new int) -# CRASH POINT: ddl_log_create_before_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_drop_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_rename_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_frm -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_drop -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_save_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_binlog -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_prepare_eof -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_binlog -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 (new int) -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# QUERY: CREATE OR REPLACE TABLE t1 LIKE const_table -# CRASH POINT: ddl_log_create_before_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_drop_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_rename_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_frm -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_drop -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_save_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_binlog -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_prepare_eof -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_binlog -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# QUERY: CREATE OR REPLACE TABLE t1 SELECT * from const_table -# CRASH POINT: ddl_log_create_before_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_drop_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_log_rename_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_frm -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_create_table -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_drop -# No crash! -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_after_send_data -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_save_backup -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_install_new -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_before_binlog -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_prepare_eof -t1.DATA1 -t1.DATA2 -t1.TRG -t1.frm -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_after_binlog -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_fk_fail -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail2 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_fk_fail3 -t1.TRG -t1.frm -t1.ibd -t2.frm -t2.ibd -Table Create Table -t1 CREATE TABLE `t1` ( - `old` int(11) NOT NULL, - `y` int(11) DEFAULT NULL, - PRIMARY KEY (`old`) -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -old y -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -a INSERT t1 set @s= 1 BEFORE -# CRASH POINT: ddl_log_create_log_complete -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete2 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -# CRASH POINT: ddl_log_create_log_complete3 -t1.DATA1 -t1.DATA2 -t1.frm -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 SELECT * from const_table -Table Create Table -t1 CREATE TABLE `t1` ( - `new` int(11) DEFAULT NULL, - `b` int(11) DEFAULT NULL -) ENGINE=ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -new b -1 1 -2 2 -Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation -Warnings: -Note 1051 Unknown table 'test.t1' diff --git a/mysql-test/suite/atomic/create_replace.test b/mysql-test/suite/atomic/create_replace.test deleted file mode 100644 index 7cb6d349444..00000000000 --- a/mysql-test/suite/atomic/create_replace.test +++ /dev/null @@ -1,211 +0,0 @@ ---source include/have_debug.inc ---source include/have_sequence.inc ---source include/have_innodb.inc ---source include/binlog_formats.inc ---source include/not_valgrind.inc - ---disable_query_log -let $default_engine=InnoDB; -let $extra_option= ''; -let $save_debug=`select @@debug_dbug`; -let $show_error=0; -let $drop_error=0; - -if ($MTR_COMBINATION_MYISAM) -{ - let $default_engine=MyISAM; -} -if ($MTR_COMBINATION_ARIA) -{ - let $default_engine=Aria; - call mtr.add_suppression("Checking table"); - call mtr.add_suppression("marked as crashed"); -} -if ($MTR_COMBINATION_ARIA_NOTRANS) -{ - let $default_engine=Aria; - let $extra_option=' engine=aria,transactional=0'; - call mtr.add_suppression("Checking table"); - call mtr.add_suppression("marked as crashed"); -} -if ($MTR_COMBINATION_EXPENSIVE_RENAME) -{ - # Disable atomic CREATE OR REPLACE (emulates HTON_EXPENSIVE_RENAME flag) - let $default_engine=MyISAM; - let $show_error=0, ER_NO_SUCH_TABLE; - let $drop_error=0, ER_BAD_TABLE_ERROR; - set @@debug_dbug="+d,ddl_log_expensive_rename"; -} -if ($MTR_COMBINATION_LOCK_TABLES) -{ - let $default_engine=Aria; - call mtr.add_suppression("Checking table"); - call mtr.add_suppression("marked as crashed"); -} - -if ($MTR_COMBINATION_STMT) -{ - let $binlog_format=include/set_binlog_format_statement.sql; -} -if ($MTR_COMBINATION_ROW) -{ - let $binlog_format=include/set_binlog_format_row.sql; -} -if ($MTR_COMBINATION_MIX) -{ - --skip same as stmt -} - ---eval set @@default_storage_engine=$default_engine ---enable_query_log - ---echo # Crash recovery - -let $MYSQLD_DATADIR= `SELECT @@datadir`; - -let $crash_count=19; -let $crash_points='ddl_log_create_before_install_new', - 'ddl_log_create_after_log_drop_backup', - 'ddl_log_create_after_log_rename_backup', - 'ddl_log_create_before_create_frm', - 'ddl_log_create_before_create_table', - 'ddl_log_create_after_create_table', - 'ddl_log_create_after_drop', - 'ddl_log_create_after_send_data', - 'ddl_log_create_after_save_backup', - 'ddl_log_create_after_install_new', - 'ddl_log_create_before_binlog', - 'ddl_log_create_after_prepare_eof', - 'ddl_log_create_after_binlog', - 'ddl_log_create_fk_fail', - 'ddl_log_create_fk_fail2', - 'ddl_log_create_fk_fail3', - 'ddl_log_create_log_complete', - 'ddl_log_create_log_complete2', - 'ddl_log_create_log_complete3'; - -#let $crash_count=1; -#let $crash_points='ddl_log_create_fk_fail'; -# 'ddl_log_create_before_binlog3', -# 'ddl_log_create_before_binlog4'; - -let $statement_count=3; -let $statements='CREATE OR REPLACE TABLE t1 (new int) EXTRA_OPTION', - 'CREATE OR REPLACE TABLE t1 LIKE const_table', - 'CREATE OR REPLACE TABLE t1 EXTRA_OPTION SELECT * from const_table'; - -#let $statement_count=1; -#let $statements='CREATE OR REPLACE TABLE t1 EXTRA_OPTION SELECT * from const_table'; - ---disable_query_log -let create_const=`select REPLACE('create table const_table (new int, b int) EXTRA_OPTION', ' EXTRA_OPTION', $extra_option)`; -eval $create_const; ---replace_result $default_engine ENGINE ' PAGE_CHECKSUM=1' '' ' TRANSACTIONAL=0' '' -show create table const_table; ---enable_query_log -insert into const_table values (1, 1), (2, 2); -flush tables; - -let $old_debug=`select @@debug_dbug`; - -let $keep_include_silent=1; -let $grep_script=CREATE|DROP; ---disable_query_log - -let $r=0; -while ($r < $statement_count) -{ - inc $r; - let $STATEMENT=`select REPLACE(ELT($r, $statements), ' EXTRA_OPTION', $extra_option)`; - --echo # QUERY: $STATEMENT - - let $c=0; - while ($c < $crash_count) - { - inc $c; - let $crash= `select ELT($c, $crash_points)`; - let $fk_error= `select '$crash' like 'ddl_log_create_fk_fail%'`; - - --eval set @@default_storage_engine=$default_engine - create or replace table t1 (old int); - if ($fk_error) - { - create or replace table t1 (old int primary key, y int) engine innodb; - create table t2 (x int references t1(old)) engine innodb; - } - create trigger a before insert on t1 for each row set @s= 1; - flush tables; - if ($MTR_COMBINATION_LOCK_TABLES) - { - lock tables t1 write, const_table read; - } - - --source $binlog_format - - RESET MASTER; - --echo # CRASH POINT: $crash - --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect - --disable_reconnect - --eval set @@debug_dbug="+d,$crash",@debug_crash_counter=1 - let $errno=0; - --error 0,2013 - eval $STATEMENT; - let $error=$errno; - --enable_reconnect - --source include/wait_until_connected_again.inc - --disable_query_log - --eval set @@debug_dbug="$old_debug" - - if ($error == 0) - { - --echo # No crash! - if ($MTR_COMBINATION_LOCK_TABLES) - { - unlock tables; - } - } - # Check which tables still exists - --replace_result .MAD .DATA1 .MYD .DATA1 .MAI .DATA2 .MYI .DATA2 - --list_files $MYSQLD_DATADIR/test t* - --list_files $MYSQLD_DATADIR/test *sql* - - --let $binlog_file=master-bin.000001 - --source include/show_binlog_events.inc - if ($error) - { - --let $binlog_file=master-bin.000002 - --source include/show_binlog_events.inc - } - - if ($default_engine == Aria) - { - # Again we suppress 'marked as crashed', it works differently in --ps - --disable_warnings - } - --replace_result $default_engine ENGINE InnoDB ENGINE ' PAGE_CHECKSUM=1' '' ' TRANSACTIONAL=0' '' - --error $show_error - show create table t1; - --enable_warnings - if (`select locate('SELECT', '$STATEMENT')`) - { - --error $show_error - select * from t1; - } - --enable_warnings - --replace_column 6 '' 7 '' 8 '' 9 '' 10 '' 11 '' - show triggers; - # Drop the tables. The warnings will show what was dropped - if ($fk_error) - { - drop table t2; - } - --disable_warnings - --error $drop_error - drop table t1; - --enable_warnings - } -} -drop table if exists t1,const_table; ---eval set @@debug_dbug="$save_debug" - ---enable_query_log diff --git a/mysql-test/suite/atomic/create_table.result b/mysql-test/suite/atomic/create_table.result index aa22e3cb0ed..acc78c76d25 100644 --- a/mysql-test/suite/atomic/create_table.result +++ b/mysql-test/suite/atomic/create_table.result @@ -55,6 +55,7 @@ t2.MYI t2.frm master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int) crash point: ddl_log_create_log_complete +"No crash!" t1.MYD t1.MYI t1.frm @@ -62,6 +63,40 @@ t2.MYD t2.MYI t2.frm master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int) +query: CREATE OR REPLACE TABLE t2 (a int) +crash point: ddl_log_create_before_create_frm +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: storage_engine_middle_of_create +"No crash!" +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 (a int) +crash point: ddl_log_create_before_create_table +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_create_table +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_drop +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_before_binlog +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_prepare_eof +"No crash!" +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 (a int) +crash point: ddl_log_create_after_binlog +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 (a int) +crash point: ddl_log_create_log_complete +"No crash!" +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 (a int) query: CREATE TABLE t1 LIKE const_table crash point: ddl_log_create_before_create_frm t2.MYD @@ -115,6 +150,7 @@ t2.MYI t2.frm master-bin.000001 # Query # # use `test`; CREATE TABLE t1 LIKE const_table crash point: ddl_log_create_log_complete +"No crash!" t1.MYD t1.MYI t1.frm @@ -122,6 +158,40 @@ t2.MYD t2.MYI t2.frm master-bin.000001 # Query # # use `test`; CREATE TABLE t1 LIKE const_table +query: CREATE OR REPLACE TABLE t2 LIKE const_table +crash point: ddl_log_create_before_create_frm +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: storage_engine_middle_of_create +"No crash!" +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 LIKE const_table +crash point: ddl_log_create_before_create_table +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_create_table +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_drop +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_before_binlog +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_prepare_eof +"No crash!" +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 LIKE const_table +crash point: ddl_log_create_after_binlog +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 LIKE const_table +crash point: ddl_log_create_log_complete +"No crash!" +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 LIKE const_table query: CREATE TABLE t1 SELECT * from t2 crash point: ddl_log_create_before_create_frm t2.MYD @@ -168,9 +238,16 @@ t2.MYD t2.MYI t2.frm crash point: ddl_log_create_after_binlog +t1.MYD +t1.MYI +t1.frm t2.MYD t2.MYI t2.frm +master-bin.000001 # Query # # use `test`; CREATE TABLE `t1` ( + `seq` bigint(20) unsigned NOT NULL +) +master-bin.000001 # Annotate_rows # # CREATE TABLE t1 SELECT * from t2 crash point: ddl_log_create_log_complete t1.MYD t1.MYI @@ -182,6 +259,47 @@ master-bin.000001 # Query # # use `test`; CREATE TABLE `t1` ( `seq` bigint(20) unsigned NOT NULL ) master-bin.000001 # Annotate_rows # # CREATE TABLE t1 SELECT * from t2 +query: CREATE OR REPLACE TABLE t2 SELECT * from const_table +crash point: ddl_log_create_before_create_frm +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: storage_engine_middle_of_create +"No crash!" +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) +master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t2 SELECT * from const_table +crash point: ddl_log_create_before_create_table +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_create_table +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_drop +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_before_binlog +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_prepare_eof +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_binlog +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) +master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t2 SELECT * from const_table +crash point: ddl_log_create_log_complete +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) +master-bin.000001 # Annotate_rows # # CREATE OR REPLACE TABLE t2 SELECT * from const_table engine: innodb query: CREATE TABLE t1 (a int) crash point: ddl_log_create_before_create_frm @@ -224,11 +342,42 @@ t2.frm t2.ibd master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int) crash point: ddl_log_create_log_complete +"No crash!" t1.frm t1.ibd t2.frm t2.ibd master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int) +query: CREATE OR REPLACE TABLE t2 (a int) +crash point: ddl_log_create_before_create_frm +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: storage_engine_middle_of_create +"No crash!" +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 (a int) +crash point: ddl_log_create_before_create_table +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_create_table +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_drop +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_before_binlog +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_prepare_eof +"No crash!" +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 (a int) +crash point: ddl_log_create_after_binlog +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 (a int) +crash point: ddl_log_create_log_complete +"No crash!" +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 (a int) query: CREATE TABLE t1 LIKE const_table crash point: ddl_log_create_before_create_frm t2.frm @@ -274,12 +423,47 @@ t2.frm t2.ibd master-bin.000001 # Query # # use `test`; CREATE TABLE t1 LIKE const_table crash point: ddl_log_create_log_complete +"No crash!" t1.MYD t1.MYI t1.frm t2.frm t2.ibd master-bin.000001 # Query # # use `test`; CREATE TABLE t1 LIKE const_table +query: CREATE OR REPLACE TABLE t2 LIKE const_table +crash point: ddl_log_create_before_create_frm +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: storage_engine_middle_of_create +"No crash!" +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 LIKE const_table +crash point: ddl_log_create_before_create_table +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_create_table +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_drop +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_before_binlog +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_prepare_eof +"No crash!" +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 LIKE const_table +crash point: ddl_log_create_after_binlog +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 LIKE const_table +crash point: ddl_log_create_log_complete +"No crash!" +t2.MYD +t2.MYI +t2.frm +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 LIKE const_table query: CREATE TABLE t1 SELECT * from t2 crash point: ddl_log_create_before_create_frm t2.frm @@ -310,17 +494,44 @@ t2.ibd crash point: ddl_log_create_after_prepare_eof t2.frm t2.ibd +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 SELECT * from t2 +master-bin.000002 # Query # # DROP TABLE IF EXISTS `test`.`t1` /* generated by ddl recovery */ crash point: ddl_log_create_after_binlog -t1.frm -t1.ibd t2.frm t2.ibd master-bin.000001 # Query # # use `test`; CREATE TABLE t1 SELECT * from t2 +master-bin.000002 # Query # # DROP TABLE IF EXISTS `test`.`t1` /* generated by ddl recovery */ crash point: ddl_log_create_log_complete t1.frm t1.ibd t2.frm t2.ibd master-bin.000001 # Query # # use `test`; CREATE TABLE t1 SELECT * from t2 +query: CREATE OR REPLACE TABLE t2 SELECT * from const_table +crash point: ddl_log_create_before_create_frm +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: storage_engine_middle_of_create +"No crash!" +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 SELECT * from const_table +crash point: ddl_log_create_before_create_table +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_create_table +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_drop +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_before_binlog +master-bin.000002 # Query # # use `test`; DROP TABLE IF EXISTS `t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_prepare_eof +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 SELECT * from const_table +master-bin.000002 # Query # # DROP TABLE IF EXISTS `test`.`t2` /* generated by ddl recovery */ +crash point: ddl_log_create_after_binlog +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 SELECT * from const_table +master-bin.000002 # Query # # DROP TABLE IF EXISTS `test`.`t2` /* generated by ddl recovery */ +crash point: ddl_log_create_log_complete +t2.frm +t2.ibd +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t2 SELECT * from const_table Warnings: Note 1051 Unknown table 'test.t1,test.t2' diff --git a/mysql-test/suite/atomic/create_table.test b/mysql-test/suite/atomic/create_table.test index d2b63de877d..ff53a12ebab 100644 --- a/mysql-test/suite/atomic/create_table.test +++ b/mysql-test/suite/atomic/create_table.test @@ -30,10 +30,13 @@ if ($engine_count == "") let $crash_count=9; let $crash_points='ddl_log_create_before_create_frm', 'storage_engine_middle_of_create', 'ddl_log_create_before_create_table', 'ddl_log_create_after_create_table', 'ddl_log_create_after_drop', 'ddl_log_create_before_binlog', 'ddl_log_create_after_prepare_eof', 'ddl_log_create_after_binlog', 'ddl_log_create_log_complete'; -let $statement_count=3; +let $statement_count=6; let $statements='CREATE TABLE t1 (a int)', + 'CREATE OR REPLACE TABLE t2 (a int)', 'CREATE TABLE t1 LIKE const_table', - 'CREATE TABLE t1 SELECT * from t2'; + 'CREATE OR REPLACE TABLE t2 LIKE const_table', + 'CREATE TABLE t1 SELECT * from t2', + 'CREATE OR REPLACE TABLE t2 SELECT * from const_table'; create table const_table (a int, b int) engine=myisam; insert into const_table values (1,1),(2,2); @@ -51,8 +54,6 @@ while ($e < $engine_count) inc $e; let $engine=`select ELT($e, $engines)`; let $default_engine=$engine; - # Note: $extra_option is not used. This dead code here is for conformity with - # other tests. let $extra_option=; if ($engine == "aria") diff --git a/mysql-test/suite/binlog/include/binlog.test b/mysql-test/suite/binlog/include/binlog.test index 1061cf51018..9f3288b52f0 100644 --- a/mysql-test/suite/binlog/include/binlog.test +++ b/mysql-test/suite/binlog/include/binlog.test @@ -419,7 +419,6 @@ create table t (old_table_field int); create or replace table t as select 1 as b, 2 as b; --error ER_DUP_FIELDNAME create or replace temporary table t as select 1 as b, 2 as b; -drop table t; create table t (new_table_field int); --source include/show_binlog_events.inc diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result index c0e4e6f46be..fa111106cd6 100644 --- a/mysql-test/suite/binlog/r/binlog_row_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result @@ -1085,14 +1085,14 @@ create or replace table t as select 1 as b, 2 as b; ERROR 42S21: Duplicate column name 'b' create or replace temporary table t as select 1 as b, 2 as b; ERROR 42S21: Duplicate column name 'b' -drop table t; create table t (new_table_field int); include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; create table t (old_table_field int) -master-bin.000001 # Gtid # # GTID #-#-# -master-bin.000001 # Query # # use `test`; DROP TABLE `t` /* generated by server */ +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `test`.`t`/* Generated to handle failed CREATE OR REPLACE */ +master-bin.000001 # Query # # ROLLBACK master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; create table t (new_table_field int) drop table t; diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result index dc0b3c2b4a1..f48b624ec21 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result @@ -682,16 +682,15 @@ create or replace table t as select 1 as b, 2 as b; ERROR 42S21: Duplicate column name 'b' create or replace temporary table t as select 1 as b, 2 as b; ERROR 42S21: Duplicate column name 'b' -drop table t; create table t (new_table_field int); include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; create table t (old_table_field int) master-bin.000001 # Gtid # # GTID #-#-# -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t`/* Generated to handle failed CREATE OR REPLACE */ +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `test`.`t`/* Generated to handle failed CREATE OR REPLACE */ master-bin.000001 # Gtid # # GTID #-#-# -master-bin.000001 # Query # # use `test`; DROP TABLE `t` /* generated by server */ +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t`/* Generated to handle failed CREATE OR REPLACE */ master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; create table t (new_table_field int) drop table t; diff --git a/mysql-test/suite/binlog/r/binlog_write_error.result b/mysql-test/suite/binlog/r/binlog_write_error.result index eb83a1805e6..46a233718d9 100644 --- a/mysql-test/suite/binlog/r/binlog_write_error.result +++ b/mysql-test/suite/binlog/r/binlog_write_error.result @@ -9,8 +9,6 @@ CREATE TABLE t1 (a INT); ERROR HY000: Error writing file 'master-bin' ((errno: #) set @@global.debug_dbug = @saved_dbug; INSERT INTO t1 VALUES (1),(2),(3); -ERROR 42S02: Table 'test.t1' doesn't exist -CREATE TABLE t1 (a INT); set @saved_dbug = @@global.debug_dbug; SET GLOBAL debug_dbug='d,injecting_fault_writing'; INSERT INTO t1 VALUES (4),(5),(6); diff --git a/mysql-test/suite/binlog/t/binlog_write_error.test b/mysql-test/suite/binlog/t/binlog_write_error.test index f62d1f1fd49..bd1cb5301b3 100644 --- a/mysql-test/suite/binlog/t/binlog_write_error.test +++ b/mysql-test/suite/binlog/t/binlog_write_error.test @@ -30,11 +30,8 @@ call mtr.add_suppression("Write to binary log failed: Error writing file*"); let $query= CREATE TABLE t1 (a INT); source include/binlog_inject_error.inc; ---error ER_NO_SUCH_TABLE INSERT INTO t1 VALUES (1),(2),(3); -CREATE TABLE t1 (a INT); - let $query= INSERT INTO t1 VALUES (4),(5),(6); source include/binlog_inject_error.inc; diff --git a/mysql-test/suite/binlog_encryption/binlog_write_error.result b/mysql-test/suite/binlog_encryption/binlog_write_error.result index eb83a1805e6..46a233718d9 100644 --- a/mysql-test/suite/binlog_encryption/binlog_write_error.result +++ b/mysql-test/suite/binlog_encryption/binlog_write_error.result @@ -9,8 +9,6 @@ CREATE TABLE t1 (a INT); ERROR HY000: Error writing file 'master-bin' ((errno: #) set @@global.debug_dbug = @saved_dbug; INSERT INTO t1 VALUES (1),(2),(3); -ERROR 42S02: Table 'test.t1' doesn't exist -CREATE TABLE t1 (a INT); set @saved_dbug = @@global.debug_dbug; SET GLOBAL debug_dbug='d,injecting_fault_writing'; INSERT INTO t1 VALUES (4),(5),(6); diff --git a/mysql-test/suite/innodb/r/foreign_key_not_windows.result b/mysql-test/suite/innodb/r/foreign_key_not_windows.result index 02b2e3c29af..aaff06f8d68 100644 --- a/mysql-test/suite/innodb/r/foreign_key_not_windows.result +++ b/mysql-test/suite/innodb/r/foreign_key_not_windows.result @@ -6,20 +6,11 @@ CREATE DATABASE `d255`; CREATE TABLE `d255`.`d255` (a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB; ERROR HY000: Long database name and identifier for object resulted in path length exceeding 512 characters. Path: './@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023/@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@ -CREATE OR REPLACE TABLE `d255`.`d255` -(a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB; -ERROR HY000: Long database name and identifier for object resulted in path length exceeding 511 characters. Path: './@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023/@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@ CREATE TABLE `d255`.`_##################################################` (a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB; ERROR HY000: Long database name and identifier for object resulted in path length exceeding 512 characters. Path: './@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023/_@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023 -CREATE OR REPLACE TABLE `d255`.`_##################################################` -(a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB; -ERROR HY000: Long database name and identifier for object resulted in path length exceeding 511 characters. Path: './@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023/_@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023@0023 CREATE TABLE `d255`.`##################################################` (a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB; -CREATE OR REPLACE TABLE `d255`.`d245` -(a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB; -DROP TABLE `d255`.`d245`; # # MDEV-29258 Failing assertion for name length on RENAME TABLE # @@ -38,37 +29,3 @@ RENAME TABLE `d255`.u TO u; DROP TABLE u; DROP DATABASE `d255`; # End of 10.3 tests -# -# MDEV-28933 CREATE OR REPLACE fails to recreate same constraint name -# -set names utf8; -create database `❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎`; -use `❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎`; -create table t (a int primary key) engine=innodb; -create table u ( -a int primary key, -constraint `❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎` foreign key d (a) references t (a)) engine=innodb; -select * from information_schema.innodb_sys_foreign; -ID FOR_NAME REF_NAME N_COLS TYPE -@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@27 @274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@27 @274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@27 1 0 -select * from information_schema.innodb_sys_foreign_cols; -ID FOR_COL_NAME REF_COL_NAME POS -@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@27 a a 0 -create or replace table u ( -a int primary key, -constraint `❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎` foreign key d (a) references t (a)) engine=innodb; -select * from information_schema.innodb_sys_foreign; -ID FOR_NAME REF_NAME N_COLS TYPE -@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@27 @274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@27 @274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@27 1 0 -select * from information_schema.innodb_sys_foreign_cols; -ID FOR_COL_NAME REF_COL_NAME POS -@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@274e@27 a a 0 -show create table u; -Table Create Table -u CREATE TABLE `u` ( - `a` int(11) NOT NULL, - PRIMARY KEY (`a`), - CONSTRAINT `❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎` FOREIGN KEY (`a`) REFERENCES `t` (`a`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci -use test; -drop database `❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎❎`; diff --git a/mysql-test/suite/innodb/t/foreign_key_not_windows.test b/mysql-test/suite/innodb/t/foreign_key_not_windows.test index 67e8935c660..e5f42a0ddab 100644 --- a/mysql-test/suite/innodb/t/foreign_key_not_windows.test +++ b/mysql-test/suite/innodb/t/foreign_key_not_windows.test @@ -25,43 +25,20 @@ CREATE TABLE t (a INT PRIMARY KEY) ENGINE=InnoDB; # corresponding to the 51 characters below: 5*51=255. let $d255=###################################################; let $d250=##################################################; -let $d245=#####################; -# FIXME: MDEV-29258 -# let $d245=#################################################; --replace_result $d255 d255 eval CREATE DATABASE `$d255`; - --replace_result $d255 d255 --error ER_IDENT_CAUSES_TOO_LONG_PATH eval CREATE TABLE `$d255`.`$d255` (a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB; - ---replace_result $d255 d255 ---error ER_IDENT_CAUSES_TOO_LONG_PATH -eval CREATE OR REPLACE TABLE `$d255`.`$d255` -(a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB; - --replace_result $d255 d255 --error ER_IDENT_CAUSES_TOO_LONG_PATH eval CREATE TABLE `$d255`.`_$d250` (a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB; - ---replace_result $d255 d255 ---error ER_IDENT_CAUSES_TOO_LONG_PATH -eval CREATE OR REPLACE TABLE `$d255`.`_$d250` -(a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB; - --replace_result $d255 d255 eval CREATE TABLE `$d255`.`$d250` (a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB; ---replace_result $d255 d255 $d245 d245 -eval CREATE OR REPLACE TABLE `$d255`.`$d245` -(a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB; - ---replace_result $d255 d255 $d245 d245 -eval DROP TABLE `$d255`.`$d245`; - --echo # --echo # MDEV-29258 Failing assertion for name length on RENAME TABLE --echo # @@ -76,6 +53,7 @@ eval DROP TABLE `$d255`.`$d250`; eval RENAME TABLE `$d255`.`$d245` TO `$d255`.`$d250`; --replace_result $d250 d250 $d255 d255 eval RENAME TABLE `$d255`.`$d250` TO a; +--replace_result $d255 d255 DROP TABLE a,t; --echo # @@ -97,26 +75,3 @@ DROP TABLE u; eval DROP DATABASE `$d255`; --echo # End of 10.3 tests - ---echo # ---echo # MDEV-28933 CREATE OR REPLACE fails to recreate same constraint name ---echo # -set names utf8; -let $d= `select repeat('❎', 45)`; -let $t= `select repeat('❎', 64)`; -eval create database `$d`; -eval use `$d`; -create table t (a int primary key) engine=innodb; -eval create table u ( - a int primary key, - constraint `$t` foreign key d (a) references t (a)) engine=innodb; -select * from information_schema.innodb_sys_foreign; -select * from information_schema.innodb_sys_foreign_cols; -eval create or replace table u ( - a int primary key, - constraint `$t` foreign key d (a) references t (a)) engine=innodb; -select * from information_schema.innodb_sys_foreign; -select * from information_schema.innodb_sys_foreign_cols; -show create table u; -use test; -eval drop database `$d`; diff --git a/mysql-test/suite/parts/r/backup_log.result b/mysql-test/suite/parts/r/backup_log.result index df1dd0e4cdb..be4109965bc 100644 --- a/mysql-test/suite/parts/r/backup_log.result +++ b/mysql-test/suite/parts/r/backup_log.result @@ -2,7 +2,7 @@ connect con1,localhost,root,,; BACKUP STAGE START; connection default; # -# Testing normal tables +# Testing with normal tables # create table t1 (a int) engine=myisam PARTITION BY HASH(a) PARTITIONS 2; insert into t1 values (1),(2); @@ -17,17 +17,6 @@ optimize table t1; Table Op Msg_type Msg_text test.t1 optimize status OK drop table t1; -# -# Reading backup ddl log file -# -CREATE,MyISAM,1,test,t1,id: 1,,0,,, -ALTER,MyISAM,1,test,t1,id: 1,MyISAM,1,test,t1,id: 2 -RENAME,MyISAM,1,test,t1,id: 2,MyISAM,1,test,t2,id: 2 -RENAME,MyISAM,1,test,t2,id: 2,MyISAM,1,test,t1,id: 2 -TRUNCATE,MyISAM,1,test,t1,id: 2,,0,,, -repair,MyISAM,1,test,t1,id: 2,,0,,, -optimize,MyISAM,1,test,t1,id: 2,,0,,, -DROP,MyISAM,1,test,t1,id: 2,,0,,, create table t1_innodb (a int) engine=innodb PARTITION BY HASH(a) PARTITIONS 2; insert into t1_innodb values (1),(2); alter table t1_innodb add column b int; @@ -43,17 +32,6 @@ test.t1_innodb optimize note Table does not support optimize, doing recreate + a test.t1_innodb optimize status OK drop table t1_innodb; # -# Reading backup ddl log file -# -CREATE,InnoDB,1,test,t1_innodb,id: 1,,0,,, -ALTER,InnoDB,1,test,t1_innodb,id: 1,InnoDB,1,test,t1_innodb,id: 2 -RENAME,InnoDB,1,test,t1_innodb,id: 2,InnoDB,1,test,t2_innodb,id: 2 -RENAME,InnoDB,1,test,t2_innodb,id: 2,InnoDB,1,test,t1_innodb,id: 2 -TRUNCATE,InnoDB,1,test,t1_innodb,id: 2,,0,,, -repair,InnoDB,1,test,t1_innodb,id: 2,,0,,, -ALTER,InnoDB,1,test,t1_innodb,id: 2,InnoDB,1,test,t1_innodb,id: 3 -DROP,InnoDB,1,test,t1_innodb,id: 3,,0,,, -# # Testing with temporary tables (should not be logged) # create temporary table tmp_t10 (a int) engine=myisam; @@ -63,9 +41,6 @@ rename table tmp_t11 to tmp_t10; truncate table tmp_t10; drop table tmp_t10; # -# Reading backup ddl log file -# -# # Testing with mix of normal and temporary tables # create temporary table tmp_t20 (a int); @@ -80,13 +55,6 @@ drop table if exists tmp_t21,t21; Warnings: Note 1051 Unknown table 'test.tmp_t21' # -# Reading backup ddl log file -# -CREATE,MyISAM,1,test,t20,id: 1,,0,,, -DROP,MyISAM,1,test,t20,id: 1,,0,,, -CREATE,MyISAM,1,test,t21,id: 2,,0,,, -DROP,MyISAM,1,test,t21,id: 2,,0,,, -# # Testing create select # create table t30 (a int) PARTITION BY HASH(a) PARTITIONS 2; @@ -99,18 +67,7 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY' create table t32 (a int) PARTITION BY HASH(a) PARTITIONS 2; drop table if exists t30,t31,t32,tmp_t30; Warnings: -Note 1051 Unknown table 'test.tmp_t30' -# -# Reading backup ddl log file -# -CREATE,MyISAM,1,test,t30,id: 1,,0,,, -CREATE,MyISAM,1,test,t31,id: 2,,0,,, -DROP,MyISAM,1,test,t31,id: 2,,0,,, -CREATE,MyISAM,0,test,t31,id: 3,,0,,, -CREATE,MyISAM,1,test,t32,id: 4,,0,,, -DROP,MyISAM,1,test,t30,id: 1,,0,,, -DROP,MyISAM,0,test,t31,id: 3,,0,,, -DROP,MyISAM,1,test,t32,id: 4,,0,,, +Note 1051 Unknown table 'test.t31,test.tmp_t30' # # Testing create LIKE # @@ -128,17 +85,6 @@ t42 CREATE TABLE `t42` ( PARTITIONS 2 drop table t40, t41, t42; # -# Reading backup ddl log file -# -CREATE,MyISAM,1,test,t40,id: 1,,0,,, -CREATE,InnoDB,1,test,t41,id: 2,,0,,, -CREATE,partition,0,test,t42,id: 3,,0,,, -DROP,MyISAM,1,test,t42,id: 3,,0,,, -CREATE,partition,0,test,t42,id: 4,,0,,, -DROP,MyISAM,1,test,t40,id: 1,,0,,, -DROP,InnoDB,1,test,t41,id: 2,,0,,, -DROP,InnoDB,1,test,t42,id: 4,,0,,, -# # Testing rename # create table t50 (a int) PARTITION BY HASH(a) PARTITIONS 2; @@ -147,18 +93,6 @@ rename table t50 to t52, t51 to t53; rename table t52 to tmp, t53 to t52, tmp to t53; drop table t52,t53; # -# Reading backup ddl log file -# -CREATE,MyISAM,1,test,t50,id: 1,,0,,, -CREATE,MyISAM,1,test,t51,id: 2,,0,,, -RENAME,MyISAM,1,test,t50,id: 1,MyISAM,1,test,t52,id: 1 -RENAME,MyISAM,1,test,t51,id: 2,MyISAM,1,test,t53,id: 2 -RENAME,MyISAM,1,test,t52,id: 1,MyISAM,1,test,tmp,id: 1 -RENAME,MyISAM,1,test,t53,id: 2,MyISAM,1,test,t52,id: 2 -RENAME,MyISAM,1,test,tmp,id: 1,MyISAM,1,test,t53,id: 1 -DROP,MyISAM,1,test,t52,id: 2,,0,,, -DROP,MyISAM,1,test,t53,id: 1,,0,,, -# # Testing enable/disable keys # CREATE TABLE t60 (a int(10), index(a) ) ENGINE=Aria PARTITION BY HASH(a) PARTITIONS 2; @@ -172,13 +106,6 @@ INSERT INTO t61 VALUES(1),(2),(3); ALTER TABLE t61 DISABLE KEYS; DROP TABLE t61; # -# Reading backup ddl log file -# -CREATE,Aria,1,test,t60,id: 1,,0,,, -CHANGE_INDEX,Aria,1,test,t60,id: 1,,0,,, -CHANGE_INDEX,Aria,1,test,t60,id: 1,,0,,, -DROP,Aria,1,test,t60,id: 1,,0,,, -# # Testing load data # create table t70 (a date, b date, c date not null, d date) engine=aria PARTITION BY HASH(YEAR(a)) PARTITIONS 2; @@ -195,30 +122,11 @@ insert into t71 select * from t70; unlock tables; drop table t70,t71; # -# Reading backup ddl log file -# -CREATE,Aria,1,test,t70,id: 1,,0,,, -BULK_INSERT,Aria,1,test,t70,id: 1,,0,,, -BULK_INSERT,Aria,1,test,t70,id: 1,,0,,, -TRUNCATE,Aria,1,test,t70,id: 1,,0,,, -BULK_INSERT,Aria,1,test,t70,id: 1,,0,,, -BULK_INSERT,Aria,1,test,t70,id: 1,,0,,, -CREATE,Aria,1,test,t71,id: 2,,0,,, -BULK_INSERT,Aria,1,test,t71,id: 2,,0,,, -BULK_INSERT,Aria,1,test,t71,id: 2,,0,,, -DROP,Aria,1,test,t70,id: 1,,0,,, -DROP,Aria,1,test,t71,id: 2,,0,,, -# # Testing strange table names # create table `t 1` (a int) PARTITION BY HASH(a) PARTITIONS 2; drop table `t 1`; # -# Reading backup ddl log file -# -CREATE,MyISAM,1,test,t@00201,id: 1,,0,,, -DROP,MyISAM,1,test,t@00201,id: 1,,0,,, -# # Testing views and triggers # create table t80 (a int, b int) engine=myisam PARTITION BY HASH(a) PARTITIONS 2; @@ -228,27 +136,12 @@ drop trigger trg; drop view v1; drop table t80; # -# Reading backup ddl log file -# -CREATE,MyISAM,1,test,t80,id: 1,,0,,, -CREATE,VIEW,0,test,v1,,,0,,, -CREATE,TRIGGER,0,test,trg,,,0,,, -DROP,TRIGGER,0,test,trg,,,0,,, -DROP,VIEW,0,test,v1,,,0,,, -DROP,MyISAM,1,test,t80,id: 1,,0,,, -# # Testing alter to a new storage engine # create table t85 (a int primary key, b int) engine=myisam PARTITION BY HASH(a) PARTITIONS 2; alter table t85 engine=innodb; drop table t85; # -# Reading backup ddl log file -# -CREATE,MyISAM,1,test,t85,id: 1,,0,,, -ALTER,MyISAM,1,test,t85,id: 1,InnoDB,1,test,t85,id: 2 -DROP,InnoDB,1,test,t85,id: 2,,0,,, -# # Testing backup ddl log for partitioned tables # CREATE TABLE t200(a INT, b INT) ENGINE ARIA TRANSACTIONAL = 1 PAGE_CHECKSUM = 1; @@ -291,22 +184,94 @@ DROP TABLE t220; # # Reading backup ddl log file # -CREATE,Aria,0,test,t200,id: 1,,0,,, -ALTER,Aria,0,test,t200,id: 1,Aria,1,test,t200,id: 2 -CREATE,Aria,0,test,t210,id: 3,,0,,, -EXCHANGE_PARTITION,Aria,1,test,t200,id: 2,Aria,0,test,t210,id: 3 -ALTER,Aria,1,test,t200,id: 2,Aria,1,test,t200,id: 4 -ALTER,Aria,1,test,t200,id: 4,Aria,1,test,t200,id: 5 -ALTER,Aria,1,test,t200,id: 5,Aria,1,test,t200,id: 6 -ALTER,Aria,1,test,t200,id: 6,Aria,1,test,t200,id: 7 -ALTER,Aria,1,test,t200,id: 7,Aria,1,test,t200,id: 8 -ALTER,Aria,1,test,t200,id: 8,Aria,1,test,t200,id: 9 -ALTER,Aria,1,test,t200,id: 9,Aria,1,test,t200,id: 10 -ALTER,Aria,1,test,t200,id: 10,Aria,0,test,t200,id: 11 -DROP,Aria,0,test,t200,id: 11,,0,,, -DROP,Aria,0,test,t210,id: 3,,0,,, -CREATE,Aria,1,test,t220,id: 12,,0,,, -DROP,Aria,1,test,t220,id: 12,,0,,, +CREATE,MyISAM,1,test,t1,id: 1,,0,,, +ALTER,MyISAM,1,test,t1,id: 1,MyISAM,1,test,t1,id: 2 +RENAME,MyISAM,1,test,t1,id: 2,MyISAM,1,test,t2,id: 2 +RENAME,MyISAM,1,test,t2,id: 2,MyISAM,1,test,t1,id: 2 +TRUNCATE,MyISAM,1,test,t1,id: 2,,0,,, +repair,MyISAM,1,test,t1,id: 2,,0,,, +optimize,MyISAM,1,test,t1,id: 2,,0,,, +DROP,MyISAM,1,test,t1,id: 2,,0,,, +CREATE,InnoDB,1,test,t1_innodb,id: 3,,0,,, +ALTER,InnoDB,1,test,t1_innodb,id: 3,InnoDB,1,test,t1_innodb,id: 4 +RENAME,InnoDB,1,test,t1_innodb,id: 4,InnoDB,1,test,t2_innodb,id: 4 +RENAME,InnoDB,1,test,t2_innodb,id: 4,InnoDB,1,test,t1_innodb,id: 4 +TRUNCATE,InnoDB,1,test,t1_innodb,id: 4,,0,,, +repair,InnoDB,1,test,t1_innodb,id: 4,,0,,, +ALTER,InnoDB,1,test,t1_innodb,id: 4,InnoDB,1,test,t1_innodb,id: 5 +DROP,InnoDB,1,test,t1_innodb,id: 5,,0,,, +CREATE,MyISAM,1,test,t20,id: 6,,0,,, +DROP,MyISAM,1,test,t20,id: 6,,0,,, +CREATE,MyISAM,1,test,t21,id: 7,,0,,, +DROP,MyISAM,1,test,t21,id: 7,,0,,, +CREATE,MyISAM,1,test,t30,id: 8,,0,,, +CREATE,MyISAM,1,test,t31,id: 9,,0,,, +DROP,MyISAM,1,test,t31,id: 9,,0,,, +CREATE,MyISAM,0,test,t31,id: 10,,0,,, +DROP,MyISAM,0,test,t31,id: 10,,0,,, +DROP_AFTER_CREATE,MyISAM,1,test,t31,id: 11,,0,,, +CREATE,MyISAM,1,test,t32,id: 12,,0,,, +DROP,MyISAM,1,test,t30,id: 8,,0,,, +DROP,MyISAM,1,test,t32,id: 12,,0,,, +CREATE,MyISAM,1,test,t40,id: 13,,0,,, +CREATE,InnoDB,1,test,t41,id: 14,,0,,, +CREATE,partition,0,test,t42,id: 15,,0,,, +DROP,MyISAM,1,test,t42,id: 15,,0,,, +CREATE,partition,0,test,t42,id: 16,,0,,, +DROP,MyISAM,1,test,t40,id: 13,,0,,, +DROP,InnoDB,1,test,t41,id: 14,,0,,, +DROP,InnoDB,1,test,t42,id: 16,,0,,, +CREATE,MyISAM,1,test,t50,id: 17,,0,,, +CREATE,MyISAM,1,test,t51,id: 18,,0,,, +RENAME,MyISAM,1,test,t50,id: 17,MyISAM,1,test,t52,id: 17 +RENAME,MyISAM,1,test,t51,id: 18,MyISAM,1,test,t53,id: 18 +RENAME,MyISAM,1,test,t52,id: 17,MyISAM,1,test,tmp,id: 17 +RENAME,MyISAM,1,test,t53,id: 18,MyISAM,1,test,t52,id: 18 +RENAME,MyISAM,1,test,tmp,id: 17,MyISAM,1,test,t53,id: 17 +DROP,MyISAM,1,test,t52,id: 18,,0,,, +DROP,MyISAM,1,test,t53,id: 17,,0,,, +CREATE,Aria,1,test,t60,id: 19,,0,,, +CHANGE_INDEX,Aria,1,test,t60,id: 19,,0,,, +CHANGE_INDEX,Aria,1,test,t60,id: 19,,0,,, +DROP,Aria,1,test,t60,id: 19,,0,,, +CREATE,Aria,1,test,t70,id: 20,,0,,, +BULK_INSERT,Aria,1,test,t70,id: 20,,0,,, +BULK_INSERT,Aria,1,test,t70,id: 20,,0,,, +TRUNCATE,Aria,1,test,t70,id: 20,,0,,, +BULK_INSERT,Aria,1,test,t70,id: 20,,0,,, +BULK_INSERT,Aria,1,test,t70,id: 20,,0,,, +CREATE,Aria,1,test,t71,id: 21,,0,,, +BULK_INSERT,Aria,1,test,t71,id: 21,,0,,, +BULK_INSERT,Aria,1,test,t71,id: 21,,0,,, +DROP,Aria,1,test,t70,id: 20,,0,,, +DROP,Aria,1,test,t71,id: 21,,0,,, +CREATE,MyISAM,1,test,t@00201,id: 22,,0,,, +DROP,MyISAM,1,test,t@00201,id: 22,,0,,, +CREATE,MyISAM,1,test,t80,id: 23,,0,,, +CREATE,VIEW,0,test,v1,,,0,,, +CREATE,TRIGGER,0,test,trg,,,0,,, +DROP,TRIGGER,0,test,trg,,,0,,, +DROP,VIEW,0,test,v1,,,0,,, +DROP,MyISAM,1,test,t80,id: 23,,0,,, +CREATE,MyISAM,1,test,t85,id: 24,,0,,, +ALTER,MyISAM,1,test,t85,id: 24,InnoDB,1,test,t85,id: 25 +DROP,InnoDB,1,test,t85,id: 25,,0,,, +CREATE,Aria,0,test,t200,id: 26,,0,,, +ALTER,Aria,0,test,t200,id: 26,Aria,1,test,t200,id: 27 +CREATE,Aria,0,test,t210,id: 28,,0,,, +EXCHANGE_PARTITION,Aria,1,test,t200,id: 27,Aria,0,test,t210,id: 28 +ALTER,Aria,1,test,t200,id: 27,Aria,1,test,t200,id: 29 +ALTER,Aria,1,test,t200,id: 29,Aria,1,test,t200,id: 30 +ALTER,Aria,1,test,t200,id: 30,Aria,1,test,t200,id: 31 +ALTER,Aria,1,test,t200,id: 31,Aria,1,test,t200,id: 32 +ALTER,Aria,1,test,t200,id: 32,Aria,1,test,t200,id: 33 +ALTER,Aria,1,test,t200,id: 33,Aria,1,test,t200,id: 34 +ALTER,Aria,1,test,t200,id: 34,Aria,1,test,t200,id: 35 +ALTER,Aria,1,test,t200,id: 35,Aria,0,test,t200,id: 36 +DROP,Aria,0,test,t200,id: 36,,0,,, +DROP,Aria,0,test,t210,id: 28,,0,,, +CREATE,Aria,1,test,t220,id: 37,,0,,, +DROP,Aria,1,test,t220,id: 37,,0,,, # # Cleanup # diff --git a/mysql-test/suite/rpl/r/create_or_replace2,stmt.rdiff b/mysql-test/suite/rpl/r/create_or_replace2,stmt.rdiff deleted file mode 100644 index 52dd3828b38..00000000000 --- a/mysql-test/suite/rpl/r/create_or_replace2,stmt.rdiff +++ /dev/null @@ -1,17 +0,0 @@ ---- create_or_replace2.result -+++ create_or_replace2,stmt.reject -@@ -34,9 +34,11 @@ - master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) - RETURN ( SELECT MAX(a) FROM t1 ) - master-bin.000001 # Gtid # # GTID #-#-# --master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( -- `b` int(11) DEFAULT NULL --) ENGINE=InnoDB -+master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp (b INT) ENGINE=InnoDB -+master-bin.000001 # Gtid # # GTID #-#-# -+master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE t1 LIKE tmp -+master-bin.000001 # Gtid # # GTID #-#-# -+master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `tmp` - drop function f1; - drop table t1; - include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/create_or_replace2.result b/mysql-test/suite/rpl/r/create_or_replace2.result index 149fe545778..adcceaf97dd 100644 --- a/mysql-test/suite/rpl/r/create_or_replace2.result +++ b/mysql-test/suite/rpl/r/create_or_replace2.result @@ -26,17 +26,6 @@ unlock tables; connection default; ERROR 42S22: Unknown column 'a' in 'field list' disconnect con1; -include/show_binlog_events.inc -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Gtid # # GTID #-#-# -master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) ENGINE=InnoDB -master-bin.000001 # Gtid # # GTID #-#-# -master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) -RETURN ( SELECT MAX(a) FROM t1 ) -master-bin.000001 # Gtid # # GTID #-#-# -master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` ( - `b` int(11) DEFAULT NULL -) ENGINE=InnoDB drop function f1; drop table t1; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/create_or_replace_mix.result b/mysql-test/suite/rpl/r/create_or_replace_mix.result index fbcdc0ecc44..3917b5b7c05 100644 --- a/mysql-test/suite/rpl/r/create_or_replace_mix.result +++ b/mysql-test/suite/rpl/r/create_or_replace_mix.result @@ -64,12 +64,13 @@ create table t1 (a int); create or replace table t1; ERROR 42000: A table must have at least 1 column drop table if exists t1; -create or replace table t1 (b int primary key) select a as b from t2; +Warnings: +Note 1051 Unknown table 'test.t1' +create or replace table t1 (a int primary key) select a from t2; ERROR 23000: Duplicate entry '2' for key 'PRIMARY' -create table t1 (c int); -create or replace table t1 (d int primary key) select a as d from t2; +create table t1 (a int); +create or replace table t1 (a int primary key) select a from t2; ERROR 23000: Duplicate entry '2' for key 'PRIMARY' -drop table t1; create temporary table t9 (a int); create or replace temporary table t9 (a int primary key) select a from t2; ERROR 23000: Duplicate entry '2' for key 'PRIMARY' @@ -79,26 +80,34 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; create table t1 (a int) master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; create or replace table t1 +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */ master-bin.000001 # Gtid # # GTID #-#-# -master-bin.000001 # Query # # use `test`; create table t1 (c int) +master-bin.000001 # Query # # use `test`; create table t1 (a int) master-bin.000001 # Gtid # # GTID #-#-# -master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `test`.`t1`/* Generated to handle failed CREATE OR REPLACE */ master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; create temporary table t9 (a int) +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t9`/* Generated to handle failed CREATE OR REPLACE */ connection server_2; show tables; Tables_in_test t2 connection server_1; -create table t1 (e int); +create table t1 (a int); create or replace table t1 (a int, a int) select * from t2; ERROR 42S21: Duplicate column name 'a' include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Gtid # # GTID #-#-# -master-bin.000001 # Query # # use `test`; create table t1 (e int) +master-bin.000001 # Query # # use `test`; create table t1 (a int) +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `test`.`t1`/* Generated to handle failed CREATE OR REPLACE */ drop table if exists t1,t2; +Warnings: +Note 1051 Unknown table 'test.t1' drop temporary table if exists t9; Warnings: Note 1051 Unknown table 'test.t9' @@ -208,7 +217,7 @@ drop table t1; # connection server_2; connection server_1; -create table t1 (f int); +create table t1 (a int); insert into t1 values (0),(1),(2); create table t2 engine=myisam select * from t1; create or replace table t2 engine=innodb select * from t1; @@ -217,7 +226,7 @@ binlog from server 2 include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Gtid # # GTID #-#-# -slave-bin.000001 # Query # # use `test`; create table t1 (f int) +slave-bin.000001 # Query # # use `test`; create table t1 (a int) slave-bin.000001 # Gtid # # BEGIN GTID #-#-# slave-bin.000001 # Query # # use `test`; insert into t1 values (0),(1),(2) slave-bin.000001 # Query # # COMMIT diff --git a/mysql-test/suite/rpl/r/create_or_replace_row.result b/mysql-test/suite/rpl/r/create_or_replace_row.result index 18c077bd549..3bb99839751 100644 --- a/mysql-test/suite/rpl/r/create_or_replace_row.result +++ b/mysql-test/suite/rpl/r/create_or_replace_row.result @@ -92,12 +92,13 @@ create table t1 (a int); create or replace table t1; ERROR 42000: A table must have at least 1 column drop table if exists t1; -create or replace table t1 (b int primary key) select a as b from t2; +Warnings: +Note 1051 Unknown table 'test.t1' +create or replace table t1 (a int primary key) select a from t2; ERROR 23000: Duplicate entry '2' for key 'PRIMARY' -create table t1 (c int); -create or replace table t1 (d int primary key) select a as d from t2; +create table t1 (a int); +create or replace table t1 (a int primary key) select a from t2; ERROR 23000: Duplicate entry '2' for key 'PRIMARY' -drop table t1; create temporary table t9 (a int); create or replace temporary table t9 (a int primary key) select a from t2; ERROR 23000: Duplicate entry '2' for key 'PRIMARY' @@ -107,24 +108,32 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; create table t1 (a int) master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; create or replace table t1 +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */ master-bin.000001 # Gtid # # GTID #-#-# -master-bin.000001 # Query # # use `test`; create table t1 (c int) -master-bin.000001 # Gtid # # GTID #-#-# -master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +master-bin.000001 # Query # # use `test`; create table t1 (a int) +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `test`.`t1`/* Generated to handle failed CREATE OR REPLACE */ +master-bin.000001 # Query # # ROLLBACK connection server_2; show tables; Tables_in_test t2 connection server_1; -create table t1 (e int); +create table t1 (a int); create or replace table t1 (a int, a int) select * from t2; ERROR 42S21: Duplicate column name 'a' include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Gtid # # GTID #-#-# -master-bin.000001 # Query # # use `test`; create table t1 (e int) +master-bin.000001 # Query # # use `test`; create table t1 (a int) +master-bin.000001 # Gtid # # BEGIN GTID #-#-# +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `test`.`t1`/* Generated to handle failed CREATE OR REPLACE */ +master-bin.000001 # Query # # ROLLBACK drop table if exists t1,t2; +Warnings: +Note 1051 Unknown table 'test.t1' drop temporary table if exists t9; Warnings: Note 1051 Unknown table 'test.t9' @@ -234,7 +243,7 @@ drop table t1; # connection server_2; connection server_1; -create table t1 (f int); +create table t1 (a int); insert into t1 values (0),(1),(2); create table t2 engine=myisam select * from t1; create or replace table t2 engine=innodb select * from t1; @@ -243,7 +252,7 @@ binlog from server 2 include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Gtid # # GTID #-#-# -slave-bin.000001 # Query # # use `test`; create table t1 (f int) +slave-bin.000001 # Query # # use `test`; create table t1 (a int) slave-bin.000001 # Gtid # # BEGIN GTID #-#-# slave-bin.000001 # Annotate_rows # # insert into t1 values (0),(1),(2) slave-bin.000001 # Table_map # # table_id: # (test.t1) @@ -251,7 +260,7 @@ slave-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F slave-bin.000001 # Query # # COMMIT slave-bin.000001 # Gtid # # BEGIN GTID #-#-# slave-bin.000001 # Query # # use `test`; CREATE TABLE `t2` ( - `f` int(11) DEFAULT NULL + `a` int(11) DEFAULT NULL ) ENGINE=MyISAM slave-bin.000001 # Annotate_rows # # create table t2 engine=myisam select * from t1 slave-bin.000001 # Table_map # # table_id: # (test.t2) @@ -259,7 +268,7 @@ slave-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F slave-bin.000001 # Query # # COMMIT slave-bin.000001 # Gtid # # BEGIN GTID #-#-# slave-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t2` ( - `f` int(11) DEFAULT NULL + `a` int(11) DEFAULT NULL ) ENGINE=InnoDB slave-bin.000001 # Annotate_rows # # create or replace table t2 engine=innodb select * from t1 slave-bin.000001 # Table_map # # table_id: # (test.t2) diff --git a/mysql-test/suite/rpl/r/create_or_replace_statement.result b/mysql-test/suite/rpl/r/create_or_replace_statement.result index fbcdc0ecc44..3917b5b7c05 100644 --- a/mysql-test/suite/rpl/r/create_or_replace_statement.result +++ b/mysql-test/suite/rpl/r/create_or_replace_statement.result @@ -64,12 +64,13 @@ create table t1 (a int); create or replace table t1; ERROR 42000: A table must have at least 1 column drop table if exists t1; -create or replace table t1 (b int primary key) select a as b from t2; +Warnings: +Note 1051 Unknown table 'test.t1' +create or replace table t1 (a int primary key) select a from t2; ERROR 23000: Duplicate entry '2' for key 'PRIMARY' -create table t1 (c int); -create or replace table t1 (d int primary key) select a as d from t2; +create table t1 (a int); +create or replace table t1 (a int primary key) select a from t2; ERROR 23000: Duplicate entry '2' for key 'PRIMARY' -drop table t1; create temporary table t9 (a int); create or replace temporary table t9 (a int primary key) select a from t2; ERROR 23000: Duplicate entry '2' for key 'PRIMARY' @@ -79,26 +80,34 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; create table t1 (a int) master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; create or replace table t1 +master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */ master-bin.000001 # Gtid # # GTID #-#-# -master-bin.000001 # Query # # use `test`; create table t1 (c int) +master-bin.000001 # Query # # use `test`; create table t1 (a int) master-bin.000001 # Gtid # # GTID #-#-# -master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `test`.`t1`/* Generated to handle failed CREATE OR REPLACE */ master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; create temporary table t9 (a int) +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t9`/* Generated to handle failed CREATE OR REPLACE */ connection server_2; show tables; Tables_in_test t2 connection server_1; -create table t1 (e int); +create table t1 (a int); create or replace table t1 (a int, a int) select * from t2; ERROR 42S21: Duplicate column name 'a' include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Gtid # # GTID #-#-# -master-bin.000001 # Query # # use `test`; create table t1 (e int) +master-bin.000001 # Query # # use `test`; create table t1 (a int) +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `test`.`t1`/* Generated to handle failed CREATE OR REPLACE */ drop table if exists t1,t2; +Warnings: +Note 1051 Unknown table 'test.t1' drop temporary table if exists t9; Warnings: Note 1051 Unknown table 'test.t9' @@ -208,7 +217,7 @@ drop table t1; # connection server_2; connection server_1; -create table t1 (f int); +create table t1 (a int); insert into t1 values (0),(1),(2); create table t2 engine=myisam select * from t1; create or replace table t2 engine=innodb select * from t1; @@ -217,7 +226,7 @@ binlog from server 2 include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Gtid # # GTID #-#-# -slave-bin.000001 # Query # # use `test`; create table t1 (f int) +slave-bin.000001 # Query # # use `test`; create table t1 (a int) slave-bin.000001 # Gtid # # BEGIN GTID #-#-# slave-bin.000001 # Query # # use `test`; insert into t1 values (0),(1),(2) slave-bin.000001 # Query # # COMMIT diff --git a/mysql-test/suite/rpl/r/rpl_gtid_strict.result b/mysql-test/suite/rpl/r/rpl_gtid_strict.result index d246bb31713..7a1e18c4dfd 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_strict.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_strict.result @@ -59,7 +59,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4) master-bin.000001 # Xid # # COMMIT /* XID */ -*** Test non-transactional GTID error. *** +*** Test non-transactional GTID error (cannot be rolled back). *** SET server_id= 3; SET gtid_seq_no= 1; ERROR HY000: An attempt was made to binlog GTID 0-3-1 which would create an out-of-order sequence number with existing GTID 0-1-4, and gtid strict mode is enabled @@ -68,6 +68,9 @@ SET gtid_seq_no= 1; SET SESSION debug_dbug=@old_dbug; CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=MyISAM; ERROR HY000: An attempt was made to binlog GTID 0-3-1 which would create an out-of-order sequence number with existing GTID 0-1-4, and gtid strict mode is enabled +SET sql_log_bin= 0; +DROP TABLE t2; +SET sql_log_bin= 1; CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=MyISAM; SET gtid_seq_no= 1; ERROR HY000: An attempt was made to binlog GTID 0-3-1 which would create an out-of-order sequence number with existing GTID 0-3-5, and gtid strict mode is enabled diff --git a/mysql-test/suite/rpl/t/create_or_replace.inc b/mysql-test/suite/rpl/t/create_or_replace.inc index bdde953f7dc..df46cc36e97 100644 --- a/mysql-test/suite/rpl/t/create_or_replace.inc +++ b/mysql-test/suite/rpl/t/create_or_replace.inc @@ -47,13 +47,12 @@ create or replace table t1; drop table if exists t1; # The following is not logged as t1 does not exists; --error ER_DUP_ENTRY -create or replace table t1 (b int primary key) select a as b from t2; +create or replace table t1 (a int primary key) select a from t2; -create table t1 (c int); +create table t1 (a int); # This should as a delete as we will delete t1 --error ER_DUP_ENTRY -create or replace table t1 (d int primary key) select a as d from t2; -drop table t1; +create or replace table t1 (a int primary key) select a from t2; # Same with temporary table create temporary table t9 (a int); @@ -70,7 +69,7 @@ show tables; connection server_1; --let $binlog_start=query_get_value(SHOW MASTER STATUS, Position, 1) -create table t1 (e int); +create table t1 (a int); --error ER_DUP_FIELDNAME create or replace table t1 (a int, a int) select * from t2; --source include/show_binlog_events.inc @@ -170,7 +169,7 @@ sync_with_master; --let $binlog_start=query_get_value(SHOW MASTER STATUS, Position, 1) connection server_1; -create table t1 (f int); +create table t1 (a int); insert into t1 values (0),(1),(2); create table t2 engine=myisam select * from t1; create or replace table t2 engine=innodb select * from t1; diff --git a/mysql-test/suite/rpl/t/create_or_replace2.test b/mysql-test/suite/rpl/t/create_or_replace2.test index 0208be577a7..f0091db7fb9 100644 --- a/mysql-test/suite/rpl/t/create_or_replace2.test +++ b/mysql-test/suite/rpl/t/create_or_replace2.test @@ -36,8 +36,6 @@ unlock tables; --reap --disconnect con1 ---source include/show_binlog_events.inc - # Cleanup drop function f1; drop table t1; diff --git a/mysql-test/suite/rpl/t/rpl_gtid_strict.test b/mysql-test/suite/rpl/t/rpl_gtid_strict.test index 7cbd6304c10..56ebba824c4 100644 --- a/mysql-test/suite/rpl/t/rpl_gtid_strict.test +++ b/mysql-test/suite/rpl/t/rpl_gtid_strict.test @@ -49,7 +49,7 @@ INSERT INTO t1 VALUES (4); SELECT * FROM t1 ORDER BY 1; --source include/show_binlog_events.inc ---echo *** Test non-transactional GTID error. *** +--echo *** Test non-transactional GTID error (cannot be rolled back). *** SET server_id= 3; --error ER_GTID_STRICT_OUT_OF_ORDER SET gtid_seq_no= 1; @@ -58,6 +58,11 @@ SET gtid_seq_no= 1; SET SESSION debug_dbug=@old_dbug; --error ER_GTID_STRICT_OUT_OF_ORDER CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=MyISAM; +# The table is still created, DDL cannot be rolled back. +# Fix it up for replication. +SET sql_log_bin= 0; +DROP TABLE t2; +SET sql_log_bin= 1; CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=MyISAM; --error ER_GTID_STRICT_OUT_OF_ORDER diff --git a/mysql-test/suite/versioning/r/foreign.result b/mysql-test/suite/versioning/r/foreign.result index 8df5a042275..3c8508507fd 100644 --- a/mysql-test/suite/versioning/r/foreign.result +++ b/mysql-test/suite/versioning/r/foreign.result @@ -263,13 +263,6 @@ constraint `fk_child_parent` on delete cascade on update cascade ) engine = innodb with system versioning; -select * from information_schema.innodb_sys_foreign; -ID FOR_NAME REF_NAME N_COLS TYPE -test/fk_child_parent test/child test/parent 2 5 -select * from information_schema.innodb_sys_foreign_cols; -ID FOR_COL_NAME REF_COL_NAME POS -test/fk_child_parent parent_id id 0 -test/fk_child_parent parent_value value 1 create or replace table subchild ( id int not null auto_increment primary key, parent_id smallint unsigned not null, @@ -279,16 +272,6 @@ constraint `fk_subchild_child_parent` on delete cascade on update cascade ) engine=innodb; -select * from information_schema.innodb_sys_foreign; -ID FOR_NAME REF_NAME N_COLS TYPE -test/fk_child_parent test/child test/parent 2 5 -test/fk_subchild_child_parent test/subchild test/child 2 5 -select * from information_schema.innodb_sys_foreign_cols; -ID FOR_COL_NAME REF_COL_NAME POS -test/fk_child_parent parent_id id 0 -test/fk_child_parent parent_value value 1 -test/fk_subchild_child_parent parent_id parent_id 0 -test/fk_subchild_child_parent parent_value parent_value 1 insert into parent (value) values (23); select id, value from parent into @id, @value; Warnings: diff --git a/mysql-test/suite/versioning/t/foreign.test b/mysql-test/suite/versioning/t/foreign.test index acd6dde2e4b..934053f83ba 100644 --- a/mysql-test/suite/versioning/t/foreign.test +++ b/mysql-test/suite/versioning/t/foreign.test @@ -303,9 +303,6 @@ eval create or replace table child ( on update cascade ) engine = innodb with system versioning; -select * from information_schema.innodb_sys_foreign; -select * from information_schema.innodb_sys_foreign_cols; - create or replace table subchild ( id int not null auto_increment primary key, parent_id smallint unsigned not null, @@ -316,9 +313,6 @@ create or replace table subchild ( on update cascade ) engine=innodb; -select * from information_schema.innodb_sys_foreign; -select * from information_schema.innodb_sys_foreign_cols; - insert into parent (value) values (23); --enable_prepare_warnings select id, value from parent into @id, @value; diff --git a/sql/ddl_log.cc b/sql/ddl_log.cc index afcf2e6497e..67c8a8bca4f 100644 --- a/sql/ddl_log.cc +++ b/sql/ddl_log.cc @@ -1,6 +1,6 @@ /* Copyright (c) 2000, 2019, Oracle and/or its affiliates. - Copyright (c) 2010, 2022, MariaDB + Copyright (c) 2010, 2021, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -135,13 +135,6 @@ public: char current_db[NAME_LEN]; uint execute_entry_pos; ulonglong xid; - void free() - { - drop_table.free(); - drop_view.free(); - query.free(); - db.free(); - } }; static st_global_ddl_log global_ddl_log; @@ -462,7 +455,7 @@ bool ddl_log_disable_execute_entry(DDL_LOG_MEMORY_ENTRY **active_entry) static bool is_execute_entry_active(uint entry_pos) { uchar buff[1]; - DBUG_ENTER("is_execute_entry_active"); + DBUG_ENTER("disable_execute_entry"); if (mysql_file_pread(global_ddl_log.file_id, buff, sizeof(buff), global_ddl_log.io_size * entry_pos + @@ -970,12 +963,11 @@ static bool build_filename_and_delete_tmp_file(char *path, size_t path_length, const LEX_CSTRING *db, const LEX_CSTRING *name, const char *ext, - PSI_file_key psi_key, - uint flags) + PSI_file_key psi_key) { bool deleted; uint length= build_table_filename(path, path_length-1, - db->str, name->str, ext, flags); + db->str, name->str, ext, 0); path[length]= '~'; path[length+1]= 0; deleted= mysql_file_delete(psi_key, path, MYF(0)) != 0; @@ -1089,15 +1081,15 @@ static handler *create_handler(THD *thd, MEM_ROOT *mem_root, like connect, needs the .frm file to exists to be able to do an rename. */ -static int execute_rename_table(DDL_LOG_ENTRY *ddl_log_entry, handler *file, - const LEX_CSTRING *from_db, - const LEX_CSTRING *from_table, - const LEX_CSTRING *to_db, - const LEX_CSTRING *to_table, uint flags, - char *from_path, char *to_path) +static void execute_rename_table(DDL_LOG_ENTRY *ddl_log_entry, handler *file, + const LEX_CSTRING *from_db, + const LEX_CSTRING *from_table, + const LEX_CSTRING *to_db, + const LEX_CSTRING *to_table, + uint flags, + char *from_path, char *to_path) { uint to_length=0, fr_length=0; - int error; DBUG_ENTER("execute_rename_table"); if (file->needs_lower_case_filenames()) @@ -1112,12 +1104,12 @@ static int execute_rename_table(DDL_LOG_ENTRY *ddl_log_entry, handler *file, { fr_length= build_table_filename(from_path, FN_REFLEN, from_db->str, from_table->str, "", - flags & FN_FROM_IS_TMP); + flags & FN_TO_IS_TMP); to_length= build_table_filename(to_path, FN_REFLEN, to_db->str, to_table->str, "", flags & FN_TO_IS_TMP); } - error= file->ha_rename_table(from_path, to_path); + file->ha_rename_table(from_path, to_path); if (file->needs_lower_case_filenames()) { /* @@ -1138,7 +1130,7 @@ static int execute_rename_table(DDL_LOG_ENTRY *ddl_log_entry, handler *file, } if (!access(from_path, F_OK)) (void) mysql_file_rename(key_file_frm, from_path, to_path, MYF(MY_WME)); - DBUG_RETURN(error); + DBUG_VOID_RETURN; } @@ -1152,7 +1144,7 @@ static int execute_rename_table(DDL_LOG_ENTRY *ddl_log_entry, handler *file, */ static void rename_triggers(THD *thd, DDL_LOG_ENTRY *ddl_log_entry, - bool swap_tables, uint flags) + bool swap_tables) { LEX_CSTRING to_table, from_table, to_db, from_db, from_converted_name; char to_path[FN_REFLEN+1], from_path[FN_REFLEN+1], conv_path[FN_REFLEN+1]; @@ -1174,10 +1166,10 @@ static void rename_triggers(THD *thd, DDL_LOG_ENTRY *ddl_log_entry, build_filename_and_delete_tmp_file(from_path, sizeof(from_path), &from_db, &from_table, - TRG_EXT, key_file_trg, flags & FN_FROM_IS_TMP); + TRG_EXT, key_file_trg); build_filename_and_delete_tmp_file(to_path, sizeof(to_path), &to_db, &to_table, - TRG_EXT, key_file_trg, flags & FN_TO_IS_TMP); + TRG_EXT, key_file_trg); if (lower_case_table_names) { uint errors; @@ -1303,15 +1295,15 @@ static int ddl_log_execute_action(THD *thd, MEM_ROOT *mem_root, handlerton *hton= 0; ddl_log_error_handler no_such_table_handler; uint entry_pos= ddl_log_entry->entry_pos; - int error= 0; - uint fn_flags= 0; + int error; bool frm_action= FALSE; DBUG_ENTER("ddl_log_execute_action"); mysql_mutex_assert_owner(&LOCK_gdl); DBUG_PRINT("ddl_log", - ("pos: %u->%u type: %u action: %u (%s) phase: %u " + ("pos: %u=>%u->%u type: %u action: %u (%s) phase: %u " "handler: '%s' name: '%s' from_name: '%s' tmp_name: '%s'", + recovery_state.execute_entry_pos, ddl_log_entry->entry_pos, ddl_log_entry->next_entry, (uint) ddl_log_entry->entry_type, @@ -1339,11 +1331,6 @@ static int ddl_log_execute_action(THD *thd, MEM_ROOT *mem_root, hton= file->ht; } - if (ddl_log_entry->flags & DDL_LOG_FLAG_FROM_IS_TMP) - fn_flags|= FN_FROM_IS_TMP; - if (ddl_log_entry->flags & DDL_LOG_FLAG_TO_IS_TMP) - fn_flags|= FN_TO_IS_TMP; - switch (ddl_log_entry->action_type) { case DDL_LOG_REPLACE_ACTION: case DDL_LOG_DELETE_ACTION: @@ -1387,28 +1374,24 @@ static int ddl_log_execute_action(THD *thd, MEM_ROOT *mem_root, /* fall through */ case DDL_LOG_RENAME_ACTION: { + error= TRUE; if (frm_action) { strxmov(to_path, ddl_log_entry->name.str, reg_ext, NullS); strxmov(from_path, ddl_log_entry->from_name.str, reg_ext, NullS); - error= mysql_file_rename(key_file_frm, from_path, to_path, MYF(MY_WME)); + (void) mysql_file_rename(key_file_frm, from_path, to_path, MYF(MY_WME)); #ifdef WITH_PARTITION_STORAGE_ENGINE strxmov(to_path, ddl_log_entry->name.str, PAR_EXT, NullS); strxmov(from_path, ddl_log_entry->from_name.str, PAR_EXT, NullS); - int err2= mysql_file_rename(key_file_partition_ddl_log, from_path, - to_path, MYF(MY_WME)); - if (!error) - error= err2; + (void) mysql_file_rename(key_file_partition_ddl_log, from_path, to_path, + MYF(MY_WME)); #endif } else - error= file->ha_rename_table(ddl_log_entry->from_name.str, + (void) file->ha_rename_table(ddl_log_entry->from_name.str, ddl_log_entry->name.str); if (increment_phase(entry_pos)) - { - error= -1; break; - } break; } case DDL_LOG_EXCHANGE_ACTION: @@ -1462,40 +1445,25 @@ static int ddl_log_execute_action(THD *thd, MEM_ROOT *mem_root, */ switch (ddl_log_entry->phase) { case DDL_RENAME_PHASE_TRIGGER: - rename_triggers(thd, ddl_log_entry, 0, fn_flags); + rename_triggers(thd, ddl_log_entry, 0); if (increment_phase(entry_pos)) break; /* fall through */ case DDL_RENAME_PHASE_STAT: - if (fn_flags & FN_TO_IS_TMP) - { - /* - Only executed in case of CREATE OR REPLACE table when renaming - the orignal table to a temporary name. - - If new code is added here please finish this block like this: - - if (increment_phase(entry_pos)) - break; - */ - } - else - { - /* - Stat tables must be updated last so that we can handle a rename of - a stat table. For now we just remember that we have to update it. - */ - update_flags(ddl_log_entry->entry_pos, DDL_LOG_FLAG_UPDATE_STAT); - ddl_log_entry->flags|= DDL_LOG_FLAG_UPDATE_STAT; - } + /* + Stat tables must be updated last so that we can handle a rename of + a stat table. For now we just rememeber that we have to update it + */ + update_flags(ddl_log_entry->entry_pos, DDL_LOG_FLAG_UPDATE_STAT); + ddl_log_entry->flags|= DDL_LOG_FLAG_UPDATE_STAT; /* fall through */ case DDL_RENAME_PHASE_TABLE: /* Restore frm and table to original names */ - error= execute_rename_table(ddl_log_entry, file, - &ddl_log_entry->db, &ddl_log_entry->name, - &ddl_log_entry->from_db, - &ddl_log_entry->from_name, - fn_flags, from_path, to_path); + execute_rename_table(ddl_log_entry, file, + &ddl_log_entry->db, &ddl_log_entry->name, + &ddl_log_entry->from_db, &ddl_log_entry->from_name, + 0, + from_path, to_path); if (ddl_log_entry->flags & DDL_LOG_FLAG_UPDATE_STAT) { @@ -1523,11 +1491,11 @@ static int ddl_log_execute_action(THD *thd, MEM_ROOT *mem_root, &ddl_log_entry->db, &ddl_log_entry->name, reg_ext, - key_file_fileparser, 0); + key_file_fileparser); build_filename_and_delete_tmp_file(from_path, sizeof(from_path) - 1, &ddl_log_entry->from_db, &ddl_log_entry->from_name, - reg_ext, key_file_fileparser, 0); + reg_ext, key_file_fileparser); /* Rename view back if the original rename did succeed */ if (!access(to_path, F_OK)) @@ -1602,39 +1570,25 @@ static int ddl_log_execute_action(THD *thd, MEM_ROOT *mem_root, /* Fall through */ case DDL_DROP_PHASE_TRIGGER: Table_triggers_list::drop_all_triggers(thd, &db, &table, - fn_flags, MYF(MY_WME | MY_IGNORE_ENOENT)); if (increment_phase(entry_pos)) break; /* Fall through */ case DDL_DROP_PHASE_BINLOG: - if (fn_flags & FN_IS_TMP) + if (strcmp(recovery_state.current_db, db.str)) { - /* - If new code is added here please finish this block like this: - - if (increment_phase(entry_pos)) - break; - */ + append_identifier(thd, &recovery_state.drop_table, &db); + recovery_state.drop_table.append('.'); } - else + append_identifier(thd, &recovery_state.drop_table, &table); + recovery_state.drop_table.append(','); + /* We don't increment phase as we want to retry this in case of crash */ + + if (ddl_log_drop_to_binary_log(thd, ddl_log_entry, + &recovery_state.drop_table)) { - if (strcmp(recovery_state.current_db, db.str)) - { - append_identifier(thd, &recovery_state.drop_table, &db); - recovery_state.drop_table.append('.'); - } - append_identifier(thd, &recovery_state.drop_table, &table); - recovery_state.drop_table.append(','); - /* - We don't increment phase as we want to retry this in case of crash. - */ - if (ddl_log_drop_to_binary_log(thd, ddl_log_entry, - &recovery_state.drop_table)) - { - if (increment_phase(entry_pos)) - break; - } + if (increment_phase(entry_pos)) + break; } break; case DDL_DROP_PHASE_RESET: @@ -1690,7 +1644,7 @@ static int ddl_log_execute_action(THD *thd, MEM_ROOT *mem_root, &ddl_log_entry->db, &ddl_log_entry->name, TRG_EXT, - key_file_fileparser, 0)) + key_file_fileparser)) { /* Temporary file existed and was deleted, nothing left to do */ (void) update_phase(entry_pos, DDL_LOG_FINAL_PHASE); @@ -1915,11 +1869,11 @@ static int ddl_log_execute_action(THD *thd, MEM_ROOT *mem_root, (void) build_filename_and_delete_tmp_file(to_path, sizeof(to_path) - 1, &db, &table, TRG_EXT, - key_file_fileparser, 0); + key_file_fileparser); (void) build_filename_and_delete_tmp_file(to_path, sizeof(to_path) - 1, &db, &trigger, TRN_EXT, - key_file_fileparser, 0); + key_file_fileparser); switch (ddl_log_entry->phase) { case DDL_CREATE_TRIGGER_PHASE_DELETE_COPY: { @@ -2228,7 +2182,7 @@ static int ddl_log_execute_action(THD *thd, MEM_ROOT *mem_root, if (is_renamed) { // rename_triggers will rename from: from_db.from_name -> db.extra_name - rename_triggers(thd, ddl_log_entry, 1, 0); + rename_triggers(thd, ddl_log_entry, 1); (void) update_phase(entry_pos, DDL_ALTER_TABLE_PHASE_UPDATE_STATS); } } @@ -2807,7 +2761,7 @@ int ddl_log_execute_recovery() if (ddl_log_entry.entry_type == DDL_LOG_EXECUTE_CODE) { /* - Remember information about executive ddl log entry, + Remeber information about executive ddl log entry, used for binary logging during recovery */ recovery_state.execute_entry_pos= i; @@ -2904,7 +2858,6 @@ void ddl_log_release() } my_free(global_ddl_log.file_entry_buf); global_ddl_log.file_entry_buf= 0; - recovery_state.free(); close_ddl_log(); create_ddl_log_file_name(file_name, 0); @@ -3088,8 +3041,7 @@ static bool ddl_log_write(DDL_LOG_STATE *ddl_state, mysql_mutex_lock(&LOCK_gdl); error= ((ddl_log_write_entry(ddl_log_entry, &log_entry)) || - ddl_log_write_execute_entry(log_entry->entry_pos, - ddl_state->master_chain_pos, + ddl_log_write_execute_entry(log_entry->entry_pos, 0, &ddl_state->execute_entry)); mysql_mutex_unlock(&LOCK_gdl); if (error) @@ -3105,10 +3057,7 @@ static bool ddl_log_write(DDL_LOG_STATE *ddl_state, /** - Logging of rename - - @param phase Starting phase (usually DDL_RENAME_PHASE_TABLE) - @param flags Rename flags (FN_FROM_IS_TMP, FN_TO_IS_TMP) + Logging of rename table */ bool ddl_log_rename_table(DDL_LOG_STATE *ddl_state, @@ -3116,9 +3065,7 @@ bool ddl_log_rename_table(DDL_LOG_STATE *ddl_state, const LEX_CSTRING *org_db, const LEX_CSTRING *org_alias, const LEX_CSTRING *new_db, - const LEX_CSTRING *new_alias, - enum_ddl_log_rename_table_phase phase, - uint16 flags) + const LEX_CSTRING *new_alias) { DDL_LOG_ENTRY ddl_log_entry; DBUG_ENTER("ddl_log_rename_file"); @@ -3133,8 +3080,7 @@ bool ddl_log_rename_table(DDL_LOG_STATE *ddl_state, ddl_log_entry.name= *const_cast(new_alias); ddl_log_entry.from_db= *const_cast(org_db); ddl_log_entry.from_name= *const_cast(org_alias); - ddl_log_entry.phase= (uchar) phase; - ddl_log_entry.flags= flags; + ddl_log_entry.phase= DDL_RENAME_PHASE_TABLE; DBUG_RETURN(ddl_log_write(ddl_state, &ddl_log_entry)); } @@ -3180,7 +3126,7 @@ static bool ddl_log_drop_init(DDL_LOG_STATE *ddl_state, const LEX_CSTRING *comment) { DDL_LOG_ENTRY ddl_log_entry; - DBUG_ENTER("ddl_log_drop_init"); + DBUG_ENTER("ddl_log_drop_file"); bzero(&ddl_log_entry, sizeof(ddl_log_entry)); @@ -3215,15 +3161,6 @@ bool ddl_log_drop_view_init(DDL_LOG_STATE *ddl_state, be stored in call order instead of reverse order, which is the normal case for all other events. See also comment before ddl_log_drop_init(). - - @param ddl_state DDL log chain - @param action_code DDL_LOG_DROP_TABLE_ACTION or DDL_LOG_DROP_VIEW_ACTION - @param phase Starting phase (for table DDL_DROP_PHASE_TABLE) - @param hton Handlerton - @param path Table filepath without extension - @param db DB name - @param table Table name - @param flags DDL_LOG_FLAG_FROM_IS_TMP or DDL_LOG_FLAG_TO_IS_TMP */ static bool ddl_log_drop(DDL_LOG_STATE *ddl_state, @@ -3232,16 +3169,13 @@ static bool ddl_log_drop(DDL_LOG_STATE *ddl_state, handlerton *hton, const LEX_CSTRING *path, const LEX_CSTRING *db, - const LEX_CSTRING *table, - uint16 flags) + const LEX_CSTRING *table) { DDL_LOG_ENTRY ddl_log_entry; DDL_LOG_MEMORY_ENTRY *log_entry; DBUG_ENTER("ddl_log_drop"); DBUG_ASSERT(ddl_state->list); - DBUG_ASSERT(action_code == DDL_LOG_DROP_TABLE_ACTION || - action_code == DDL_LOG_DROP_VIEW_ACTION); bzero(&ddl_log_entry, sizeof(ddl_log_entry)); ddl_log_entry.action_type= action_code; @@ -3252,7 +3186,6 @@ static bool ddl_log_drop(DDL_LOG_STATE *ddl_state, ddl_log_entry.name= *const_cast(table); ddl_log_entry.tmp_name= *const_cast(path); ddl_log_entry.phase= (uchar) phase; - ddl_log_entry.flags= flags; mysql_mutex_lock(&LOCK_gdl); if (ddl_log_write_entry(&ddl_log_entry, &log_entry)) @@ -3276,36 +3209,19 @@ error: } -/** - @param ddl_state DDL log chain - @param hton Handlerton - @param path Table filepath without extension - @param db DB name - @param table Table name - @param flags DDL_LOG_FLAG_FROM_IS_TMP or DDL_LOG_FLAG_TO_IS_TMP -*/ - bool ddl_log_drop_table(DDL_LOG_STATE *ddl_state, handlerton *hton, const LEX_CSTRING *path, const LEX_CSTRING *db, - const LEX_CSTRING *table, - uint16 flags) + const LEX_CSTRING *table) { DBUG_ENTER("ddl_log_drop_table"); DBUG_RETURN(ddl_log_drop(ddl_state, DDL_LOG_DROP_TABLE_ACTION, DDL_DROP_PHASE_TABLE, - hton, path, db, table, flags)); + hton, path, db, table)); } -/** - @param ddl_state DDL log chain - @param path Table filepath without extension - @param db DB name - @param table Table name -*/ - bool ddl_log_drop_view(DDL_LOG_STATE *ddl_state, const LEX_CSTRING *path, const LEX_CSTRING *db, @@ -3314,7 +3230,7 @@ bool ddl_log_drop_view(DDL_LOG_STATE *ddl_state, DBUG_ENTER("ddl_log_drop_view"); DBUG_RETURN(ddl_log_drop(ddl_state, DDL_LOG_DROP_VIEW_ACTION, 0, - (handlerton*) 0, path, db, table, 0)); + (handlerton*) 0, path, db, table)); } @@ -3408,8 +3324,6 @@ bool ddl_log_create_table(DDL_LOG_STATE *ddl_state, ddl_log_entry.name= *const_cast(table); ddl_log_entry.tmp_name= *const_cast(path); ddl_log_entry.flags= only_frm ? DDL_LOG_FLAG_ONLY_FRM : 0; - /* Needed for finalize_atomic_replace() which logs 2 events. */ - ddl_log_entry.next_entry= ddl_state->list ? ddl_state->list->entry_pos : 0; DBUG_RETURN(ddl_log_write(ddl_state, &ddl_log_entry)); } @@ -3617,7 +3531,7 @@ bool ddl_log_store_query(THD *thd, DDL_LOG_STATE *ddl_state, ddl_log_entry.extra_name.length= 0; max_query_length= ddl_log_free_space_in_entry(&ddl_log_entry); } - if (ddl_log_write_execute_entry(first_entry->entry_pos, 0, + if (ddl_log_write_execute_entry(first_entry->entry_pos, &ddl_state->execute_entry)) goto err; @@ -3662,17 +3576,3 @@ bool ddl_log_delete_frm(DDL_LOG_STATE *ddl_state, const char *to_path) ddl_log_add_entry(ddl_state, log_entry); DBUG_RETURN(0); } - -/* - Link the ddl_log_state to another (master) chain. If the master - chain is active during DDL recovery, this event will not be executed. - - This is used for DROP TABLE of the original table when - CREATE OR REPLACE ... is used. -*/ - -void ddl_log_link_chains(DDL_LOG_STATE *state, DDL_LOG_STATE *master_state) -{ - DBUG_ASSERT(master_state->execute_entry); - state->master_chain_pos= master_state->execute_entry->entry_pos; -} diff --git a/sql/ddl_log.h b/sql/ddl_log.h index 809b51a0e10..88f6695fc72 100644 --- a/sql/ddl_log.h +++ b/sql/ddl_log.h @@ -1,6 +1,6 @@ /* Copyright (c) 2000, 2019, Oracle and/or its affiliates. - Copyright (c) 2010, 2022, MariaDB + Copyright (c) 2010, 2021, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -173,8 +173,6 @@ enum enum_ddl_log_alter_table_phase { engine is not changed */ #define DDL_LOG_FLAG_ALTER_PARTITION (1 << 4) -#define DDL_LOG_FLAG_FROM_IS_TMP (1 << 5) -#define DDL_LOG_FLAG_TO_IS_TMP (1 << 6) /* Setting ddl_log_entry.phase to this has the same effect as setting @@ -250,7 +248,6 @@ typedef struct st_ddl_log_state */ DDL_LOG_MEMORY_ENTRY *main_entry; uint16 flags; /* Cache for flags */ - uint master_chain_pos; bool is_active() { return list != 0; } } DDL_LOG_STATE; @@ -267,6 +264,12 @@ bool ddl_log_write_entry(DDL_LOG_ENTRY *ddl_log_entry, bool ddl_log_write_execute_entry(uint first_entry, uint cond_entry, DDL_LOG_MEMORY_ENTRY** active_entry); +inline +bool ddl_log_write_execute_entry(uint first_entry, + DDL_LOG_MEMORY_ENTRY **active_entry) +{ + return ddl_log_write_execute_entry(first_entry, 0, active_entry); +} bool ddl_log_disable_execute_entry(DDL_LOG_MEMORY_ENTRY **active_entry); void ddl_log_complete(DDL_LOG_STATE *ddl_log_state); @@ -289,9 +292,7 @@ bool ddl_log_rename_table(DDL_LOG_STATE *ddl_state, const LEX_CSTRING *org_db, const LEX_CSTRING *org_alias, const LEX_CSTRING *new_db, - const LEX_CSTRING *new_alias, - enum_ddl_log_rename_table_phase phase, - uint16 flags); + const LEX_CSTRING *new_alias); bool ddl_log_rename_view(DDL_LOG_STATE *ddl_state, const LEX_CSTRING *org_db, const LEX_CSTRING *org_alias, @@ -306,8 +307,7 @@ bool ddl_log_drop_table(DDL_LOG_STATE *ddl_state, handlerton *hton, const LEX_CSTRING *path, const LEX_CSTRING *db, - const LEX_CSTRING *table, - uint16 flags); + const LEX_CSTRING *table); bool ddl_log_drop_view(DDL_LOG_STATE *ddl_state, const LEX_CSTRING *path, const LEX_CSTRING *db, @@ -354,6 +354,5 @@ bool ddl_log_alter_table(DDL_LOG_STATE *ddl_state, bool ddl_log_store_query(THD *thd, DDL_LOG_STATE *ddl_log_state, const char *query, size_t length); bool ddl_log_delete_frm(DDL_LOG_STATE *ddl_state, const char *to_path); -void ddl_log_link_chains(DDL_LOG_STATE *state, DDL_LOG_STATE *master_state); extern mysql_mutex_t LOCK_gdl; #endif /* DDL_LOG_INCLUDED */ diff --git a/sql/handler.cc b/sql/handler.cc index 4a8b58951d3..21d9b434a72 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -4992,7 +4992,7 @@ void handler::mark_trx_read_write_internal() table_share can be NULL, for example, in ha_delete_table() or ha_rename_table(). */ - if (table_share == NULL || table_share->tmp_table <= NO_TMP_TABLE) + if (table_share == NULL || table_share->tmp_table == NO_TMP_TABLE) ha_info->set_trx_read_write(); } } @@ -5029,11 +5029,6 @@ int handler::ha_end_bulk_insert() DBUG_ENTER("handler::ha_end_bulk_insert"); DBUG_EXECUTE_IF("crash_end_bulk_insert", { extra(HA_EXTRA_FLUSH) ; DBUG_SUICIDE();}); - if (DBUG_IF("ha_end_bulk_insert_fail")) - { - my_error(ER_OUT_OF_RESOURCES, MYF(0)); - DBUG_RETURN(HA_ERR_OUT_OF_MEM); - } estimation_rows_to_insert= 0; DBUG_RETURN(end_bulk_insert()); } @@ -6205,7 +6200,7 @@ static my_bool discover_existence(THD *thd, plugin_ref plugin, bool ha_table_exists(THD *thd, const LEX_CSTRING *db, const LEX_CSTRING *table_name, LEX_CUSTRING *table_id, LEX_CSTRING *partition_engine_name, - handlerton **hton, bool *is_sequence, uint flags) + handlerton **hton, bool *is_sequence) { handlerton *dummy; bool dummy2; @@ -6260,7 +6255,7 @@ retry_from_frm: #endif char path[FN_REFLEN + 1]; size_t path_len = build_table_filename(path, sizeof(path) - 1, - db->str, table_name->str, "", flags); + db->str, table_name->str, "", 0); st_discover_existence_args args= {path, path_len, db->str, table_name->str, 0, true}; if (file_ext_exists(path, path_len, reg_ext)) @@ -7041,7 +7036,8 @@ int handler::binlog_log_row(TABLE *table, THD *thd= table->in_use; DBUG_ENTER("binlog_log_row"); - if (!thd->binlog_table_maps && thd->binlog_write_table_maps(table)) + if (!thd->binlog_table_maps && + thd->binlog_write_table_maps()) DBUG_RETURN(HA_ERR_RBR_LOGGING_FAILED); error= (*log_func)(thd, table, row_logging_has_trans, @@ -7590,7 +7586,7 @@ int handler::ha_write_row(const uchar *buf) error= binlog_log_row(table, 0, buf, log_func); } #ifdef WITH_WSREP - if (WSREP_NNULL(ha_thd()) && table_share->tmp_table <= NO_TMP_TABLE && + if (WSREP_NNULL(ha_thd()) && table_share->tmp_table == NO_TMP_TABLE && ht->flags & HTON_WSREP_REPLICATION && !error && (error= wsrep_after_row(ha_thd()))) { @@ -7664,7 +7660,7 @@ int handler::ha_update_row(const uchar *old_data, const uchar *new_data) " can not mark as PA unsafe"); } - if (!error && table_share->tmp_table <= NO_TMP_TABLE && + if (!error && table_share->tmp_table == NO_TMP_TABLE && ht->flags & HTON_WSREP_REPLICATION) error= wsrep_after_row(thd); } @@ -7742,7 +7738,7 @@ int handler::ha_delete_row(const uchar *buf) " can not mark as PA unsafe"); } - if (!error && table_share->tmp_table <= NO_TMP_TABLE && + if (!error && table_share->tmp_table == NO_TMP_TABLE && ht->flags & HTON_WSREP_REPLICATION) error= wsrep_after_row(thd); } @@ -8190,7 +8186,7 @@ bool Table_scope_and_contents_source_st::vers_fix_system_fields( bool Table_scope_and_contents_source_st::vers_check_system_fields( THD *thd, Alter_info *alter_info, const Lex_table_name &table_name, - const Lex_table_name &db) + const Lex_table_name &db, int select_count) { if (!(options & HA_VERSIONED_TABLE)) return false; @@ -8211,7 +8207,7 @@ bool Table_scope_and_contents_source_st::vers_check_system_fields( SELECT go last there. */ bool is_dup= false; - if (fieldnr >= alter_info->field_count()) + if (fieldnr >= alter_info->create_list.elements - select_count) { List_iterator dup_it(alter_info->create_list); for (Create_field *dup= dup_it++; !is_dup && dup != f; dup= dup_it++) @@ -8618,11 +8614,12 @@ bool Table_period_info::check_field(const Create_field* f, } bool Table_scope_and_contents_source_st::check_fields( - THD *thd, Alter_info *alter_info, const Lex_table_name &table_name, - const Lex_table_name &db) + THD *thd, Alter_info *alter_info, + const Lex_table_name &table_name, const Lex_table_name &db, int select_count) { - return (vers_check_system_fields(thd, alter_info, table_name, db) || - check_period_fields(thd, alter_info)); + return vers_check_system_fields(thd, alter_info, + table_name, db, select_count) || + check_period_fields(thd, alter_info); } bool Table_scope_and_contents_source_st::check_period_fields( diff --git a/sql/handler.h b/sql/handler.h index d4ea7687f15..049f7a7b699 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -35,7 +35,6 @@ #include "sql_array.h" /* Dynamic_array<> */ #include "mdl.h" #include "vers_string.h" -#include "backup.h" #include "sql_analyze_stmt.h" // for Exec_time_tracker @@ -1781,12 +1780,6 @@ handlerton *ha_default_tmp_handlerton(THD *thd); */ #define HTON_REQUIRES_NOTIFY_TABLEDEF_CHANGED_AFTER_COMMIT (1 << 20) -/* - Indicates that rename table is expensive operation. - When set atomic CREATE OR REPLACE TABLE is not used. -*/ -#define HTON_EXPENSIVE_RENAME (1 << 21) - class Ha_trx_info; struct THD_TRANS @@ -2232,11 +2225,6 @@ struct Table_scope_and_contents_source_pod_st // For trivial members { bzero(this, sizeof(*this)); } - /* - NOTE: share->tmp_table (tmp_table_type) is superset of this - HA_LEX_CREATE_TMP_TABLE which means TEMPORARY keyword in - CREATE TEMPORARY TABLE statement. - */ bool tmp_table() const { return options & HA_LEX_CREATE_TMP_TABLE; } void use_default_db_type(THD *thd) { @@ -2269,7 +2257,8 @@ struct Table_scope_and_contents_source_st: bool fix_period_fields(THD *thd, Alter_info *alter_info); bool check_fields(THD *thd, Alter_info *alter_info, const Lex_table_name &table_name, - const Lex_table_name &db); + const Lex_table_name &db, + int select_count= 0); bool check_period_fields(THD *thd, Alter_info *alter_info); bool vers_fix_system_fields(THD *thd, Alter_info *alter_info, @@ -2277,73 +2266,11 @@ struct Table_scope_and_contents_source_st: bool vers_check_system_fields(THD *thd, Alter_info *alter_info, const Lex_table_name &table_name, - const Lex_table_name &db); + const Lex_table_name &db, + int select_count= 0); + }; -typedef struct st_ddl_log_state DDL_LOG_STATE; - -struct Atomic_info -{ - Table_name tmp_name; - Table_name backup_name; - DDL_LOG_STATE *ddl_log_state_create; - DDL_LOG_STATE *ddl_log_state_rm; - handlerton *old_hton; - backup_log_info drop_entry; - - Atomic_info() - { - bzero(this, sizeof(*this)); - } - - Atomic_info(DDL_LOG_STATE *ddl_log_state_rm) - { - bzero(this, sizeof(*this)); - Atomic_info::ddl_log_state_rm= ddl_log_state_rm; - } - - bool is_atomic_replace() const - { - return tmp_name.table_name.str != NULL; - } -}; - - -/* - mysql_create_table_no_lock can be called in one of the following - mutually exclusive situations: - - - Just a normal ordinary CREATE TABLE statement that explicitly - defines the table structure. - - - CREATE TABLE ... SELECT. It is special, because only in this case, - the list of fields is allowed to have duplicates, as long as one of the - duplicates comes from the select list, and the other doesn't. For - example in - - CREATE TABLE t1 (a int(5) NOT NUL) SELECT b+10 as a FROM t2; - - the list in alter_info->create_list will have two fields `a`. - - - ALTER TABLE, that creates a temporary table #sql-xxx, which will be later - renamed to replace the original table. - - - ALTER TABLE as above, but which only modifies the frm file, it only - creates an frm file for the #sql-xxx, the table in the engine is not - created. - - - Assisted discovery, CREATE TABLE statement without the table structure. - - These situations are distinguished by the following "create table mode" - values, except CREATE ... SELECT which is denoted by non-zero - Alter_info::select_field_count. -*/ - -#define C_ORDINARY_CREATE 0 -#define C_ALTER_TABLE 1 -#define C_ALTER_TABLE_FRM_ONLY 2 -#define C_ASSISTED_DISCOVERY 4 - /** This struct is passed to handler table routines, e.g. ha_create(). @@ -2351,8 +2278,7 @@ struct Atomic_info parts are handled on the SQL level and are not needed on the handler level. */ struct HA_CREATE_INFO: public Table_scope_and_contents_source_st, - public Schema_specification_st, - public Atomic_info + public Schema_specification_st { /* TODO: remove after MDEV-20865 */ Alter_info *alter_info; @@ -2374,17 +2300,6 @@ struct HA_CREATE_INFO: public Table_scope_and_contents_source_st, const Lex_table_charset_collation_attrs_st &default_cscl, const Lex_table_charset_collation_attrs_st &convert_cscl, const Charset_collation_context &ctx); - bool is_atomic_replace_usable() const - { - return !tmp_table() && !sequence && - !(db_type->flags & HTON_EXPENSIVE_RENAME) && - !DBUG_IF("ddl_log_expensive_rename"); - } - bool finalize_atomic_replace(THD *thd, TABLE_LIST *orig_table); - void finalize_ddl(THD *thd, bool roll_back); - bool finalize_locked_tables(THD *thd, bool operation_failed); - bool make_tmp_table_list(THD *thd, TABLE_LIST **create_table, - int *create_table_mode); }; @@ -2464,11 +2379,6 @@ struct Table_specification_st: public HA_CREATE_INFO, convert_charset_collation, ctx); } - bool is_atomic_replace() const - { - return or_replace() && !or_replace_slave_generated() && - is_atomic_replace_usable(); - } }; @@ -5331,10 +5241,9 @@ int ha_discover_table_names(THD *thd, LEX_CSTRING *db, MY_DIR *dirp, Discovered_table_list *result, bool reusable); bool ha_table_exists(THD *thd, const LEX_CSTRING *db, const LEX_CSTRING *table_name, - LEX_CUSTRING *table_version, - LEX_CSTRING *partition_engine_name, - handlerton **hton, bool *is_sequence, - uint flags); + LEX_CUSTRING *table_version= 0, + LEX_CSTRING *partition_engine_name= 0, + handlerton **hton= 0, bool *is_sequence= 0); bool ha_check_if_updates_are_ignored(THD *thd, handlerton *hton, const char *op); #endif /* MYSQL_SERVER */ diff --git a/sql/log.cc b/sql/log.cc index f5664c1fe74..ddcbecf511b 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -6103,12 +6103,9 @@ bool THD::binlog_write_annotated_row(Log_event_writer *writer) Also write annotate events and start transactions. This is using the "tables_with_row_logging" list prepared by THD::binlog_prepare_for_row_logging - - Atomic CREATE OR REPLACE .. SELECT logs row events via temporary table, - so it is missed in locks. We write table map for that specially via cur_table. */ -bool THD::binlog_write_table_maps(TABLE *cur_table) +bool THD::binlog_write_table_maps() { bool with_annotate; MYSQL_LOCK *locks[2], **locks_end= locks; @@ -6161,16 +6158,6 @@ bool THD::binlog_write_table_maps(TABLE *cur_table) } } } - if (cur_table->s->tmp_table && cur_table->file->row_logging) - { - /* - This is a temporary table created with CREATE OR REPLACE ... SELECT. - As these types of tables are not locked, we have to write the bitmap - separately. - */ - if (binlog_write_table_map(cur_table, with_annotate)) - DBUG_RETURN(1); - } binlog_table_maps= 1; // Table maps written DBUG_RETURN(0); } diff --git a/sql/log_event.h b/sql/log_event.h index 5267227b373..4976fcaaa17 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -681,11 +681,9 @@ enum Log_event_type /* New MySQL/Sun events are to be added right above this comment */ MYSQL_EVENTS_END, + MARIA_EVENTS_BEGIN= 160, /* New Maria event numbers start from here */ ANNOTATE_ROWS_EVENT= 160, - /* Keep that here for GDB to display ANNOTATE_ROWS_EVENT */ - MARIA_EVENTS_BEGIN= 160, - /* Binlog checkpoint event. Used for XA crash recovery on the master, not used in replication. diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index e49089ce678..20293c613f2 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -7125,8 +7125,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, { if (!(rights & CREATE_ACL)) { - if (!ha_table_exists(thd, &table_list->db, &table_list->table_name, - NULL, NULL, NULL, NULL, 0)) + if (!ha_table_exists(thd, &table_list->db, &table_list->table_name)) { my_error(ER_NO_SUCH_TABLE, MYF(0), table_list->db.str, table_list->alias.str); diff --git a/sql/sql_alter.cc b/sql/sql_alter.cc index 9546d011a37..ffcc7679273 100644 --- a/sql/sql_alter.cc +++ b/sql/sql_alter.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - Copyright (c) 2016, 2022, MariaDB Corporation + Copyright (c) 2016, 2020, MariaDB Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,7 +30,6 @@ Alter_info::Alter_info(const Alter_info &rhs, MEM_ROOT *mem_root) key_list(rhs.key_list, mem_root), alter_rename_key_list(rhs.alter_rename_key_list, mem_root), create_list(rhs.create_list, mem_root), - select_field_count(rhs.select_field_count), alter_index_ignorability_list(rhs.alter_index_ignorability_list, mem_root), check_constraint_list(rhs.check_constraint_list, mem_root), flags(rhs.flags), partition_flags(rhs.partition_flags), diff --git a/sql/sql_alter.h b/sql/sql_alter.h index 142b71c725a..bf1edd4c964 100644 --- a/sql/sql_alter.h +++ b/sql/sql_alter.h @@ -96,7 +96,6 @@ public: List alter_rename_key_list; // List of columns, used by both CREATE and ALTER TABLE. List create_list; - uint select_field_count; // Indexes whose ignorability needs to be changed. List alter_index_ignorability_list; List check_constraint_list; @@ -119,7 +118,6 @@ public: Alter_info() : - select_field_count(0), flags(0), partition_flags(0), keys_onoff(LEAVE_AS_IS), num_parts(0), @@ -136,7 +134,6 @@ public: create_list.empty(); alter_index_ignorability_list.empty(); check_constraint_list.empty(); - select_field_count= 0; flags= 0; partition_flags= 0; keys_onoff= LEAVE_AS_IS; @@ -237,11 +234,6 @@ public: */ enum_alter_table_algorithm algorithm(const THD *thd) const; - uint field_count() const - { - return create_list.elements - select_field_count; - } - private: Alter_info &operator=(const Alter_info &rhs); // not implemented Alter_info(const Alter_info &rhs); // not implemented diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 59d1c18bb35..a2b79f1899a 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1950,9 +1950,8 @@ bool open_table(THD *thd, TABLE_LIST *table_list, Open_table_context *ot_ctx) DBUG_PRINT("info",("Using locked table")); #ifdef WITH_PARTITION_STORAGE_ENGINE part_names_error= set_partitions_as_used(table_list, table); - if (!part_names_error && - table_list->lock_type >= TL_WRITE_ALLOW_WRITE && - table->vers_switch_partition(thd, table_list, ot_ctx)) + if (!part_names_error + && table->vers_switch_partition(thd, table_list, ot_ctx)) DBUG_RETURN(true); #endif goto reset; @@ -2009,8 +2008,7 @@ bool open_table(THD *thd, TABLE_LIST *table_list, Open_table_context *ot_ctx) if (table_list->open_strategy == TABLE_LIST::OPEN_IF_EXISTS) { - if (!ha_table_exists(thd, &table_list->db, &table_list->table_name, - NULL, NULL, NULL, NULL, 0)) + if (!ha_table_exists(thd, &table_list->db, &table_list->table_name)) DBUG_RETURN(FALSE); } else if (table_list->open_strategy == TABLE_LIST::OPEN_STUB) @@ -2214,7 +2212,6 @@ retry_share: #ifdef WITH_PARTITION_STORAGE_ENGINE if (!part_names_error && - table_list->lock_type >= TL_WRITE_ALLOW_WRITE && table->vers_switch_partition(thd, table_list, ot_ctx)) { MYSQL_UNBIND_TABLE(table->file); @@ -3156,7 +3153,7 @@ ret: static bool open_table_entry_fini(THD *thd, TABLE_SHARE *share, TABLE *entry) { if (Table_triggers_list::check_n_load(thd, &share->db, - &share->table_name, entry, false, 0)) + &share->table_name, entry, 0)) return TRUE; /* @@ -4228,7 +4225,7 @@ static bool upgrade_lock_if_not_exists(THD *thd, DEBUG_SYNC(thd,"create_table_before_check_if_exists"); if (!create_info.or_replace() && ha_table_exists(thd, &create_table->db, &create_table->table_name, - NULL, NULL, &create_table->db_type, NULL, 0)) + NULL, NULL, &create_table->db_type)) { if (create_info.if_not_exists()) { diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 7c1064c5c54..68dfa249449 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -2915,7 +2915,7 @@ struct Item_change_record: public ilink /* - Register an item tree transformation, performed by the query + Register an item tree tree transformation, performed by the query optimizer. We need a pointer to runtime_memroot because it may be != thd->mem_root (due to possible set_n_backup_active_arena called for thd). */ diff --git a/sql/sql_class.h b/sql/sql_class.h index 5085db8f837..1f44bf792c9 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -2931,7 +2931,7 @@ public: bool prepare_handlers_for_update(uint flag); bool binlog_write_annotated_row(Log_event_writer *writer); void binlog_prepare_for_row_logging(); - bool binlog_write_table_maps(TABLE *cur_table); + bool binlog_write_table_maps(); bool binlog_write_table_map(TABLE *table, bool with_annotate); static void binlog_prepare_row_images(TABLE* table); @@ -6140,11 +6140,6 @@ class select_insert :public select_result_interceptor { ulonglong autoinc_value_of_last_inserted_row; // autogenerated or not COPY_INFO info; bool insert_into_view; - bool binary_logged; // true if query was binlogged - bool atomic_replace; // true for atomic create or replace - bool tmp_table; - Table_specification_st *create_info; - select_insert(THD *thd_arg, TABLE_LIST *table_list_par, TABLE *table_par, List *fields_par, List *update_fields, List *update_values, enum_duplicates duplic, @@ -6156,7 +6151,6 @@ class select_insert :public select_result_interceptor { virtual void store_values(List &values); virtual bool can_rollback_data() { return 0; } bool prepare_eof(); - bool binlog_query(); bool send_ok_packet(); bool send_eof(); virtual void abort_result_set(); @@ -6166,7 +6160,7 @@ class select_insert :public select_result_interceptor { class select_create: public select_insert { - TABLE_LIST *orig_table; + Table_specification_st *create_info; TABLE_LIST *select_tables; Alter_info *alter_info; Field **field; @@ -6183,7 +6177,19 @@ public: Table_specification_st *create_info_par, Alter_info *alter_info_arg, List &select_fields,enum_duplicates duplic, bool ignore, - TABLE_LIST *select_tables_arg); + TABLE_LIST *select_tables_arg): + select_insert(thd_arg, table_arg, NULL, &select_fields, 0, 0, duplic, + ignore, NULL), + create_info(create_info_par), + select_tables(select_tables_arg), + alter_info(alter_info_arg), + m_plock(NULL), exit_done(0), + saved_tmp_table_share(0) + { + DBUG_ASSERT(create_info->default_table_charset); + bzero(&ddl_log_state_create, sizeof(ddl_log_state_create)); + bzero(&ddl_log_state_rm, sizeof(ddl_log_state_rm)); + } int prepare(List &list, SELECT_LEX_UNIT *u); void store_values(List &values); diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 765509056b5..7be4ba00b86 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -1236,8 +1236,7 @@ update_binlog: char quoted_name[FN_REFLEN+3]; // Only write drop table to the binlog for tables that no longer exist. - if (ha_table_exists(thd, &tbl->db, &tbl->table_name, - NULL, NULL, NULL, NULL, 0)) + if (ha_table_exists(thd, &tbl->db, &tbl->table_name)) continue; tbl_name_len= my_snprintf(quoted_name, sizeof(quoted_name), "%`s", diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index ba03fe991c2..73ffa9dd219 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -3887,8 +3887,7 @@ select_insert::select_insert(THD *thd_arg, TABLE_LIST *table_list_par, sel_result(result), table_list(table_list_par), table(table_par), fields(fields_par), autoinc_value_of_last_inserted_row(0), - insert_into_view(table_list_par && table_list_par->view != 0), - binary_logged(false), atomic_replace(false), create_info(NULL) + insert_into_view(table_list_par && table_list_par->view != 0) { bzero((char*) &info,sizeof(info)); info.handle_duplicates= duplic; @@ -3897,37 +3896,6 @@ select_insert::select_insert(THD *thd_arg, TABLE_LIST *table_list_par, info.update_values= update_values; info.view= (table_list_par->view ? table_list_par : 0); info.table_list= table_list_par; - tmp_table= table ? table->s->tmp_table != NO_TMP_TABLE : false; -} - - -select_create::select_create(THD *thd, TABLE_LIST *table_arg, - Table_specification_st *create_info_par, - Alter_info *alter_info_arg, - List &select_fields, - enum_duplicates duplic, bool ignore, - TABLE_LIST *select_tables_arg): - select_insert(thd, table_arg, NULL, &select_fields, 0, 0, duplic, - ignore, NULL), - orig_table(table_arg), - select_tables(select_tables_arg), - alter_info(alter_info_arg), - m_plock(NULL), exit_done(0), - saved_tmp_table_share(0) -{ - DBUG_ASSERT(create_info_par->default_table_charset); - bzero(&ddl_log_state_create, sizeof(ddl_log_state_create)); - bzero(&ddl_log_state_rm, sizeof(ddl_log_state_rm)); - create_info= create_info_par; - if (!thd->is_current_stmt_binlog_format_row() || - !ha_check_storage_engine_flag(create_info->db_type, - HTON_NO_BINLOG_ROW_OPT)) - atomic_replace= create_info->is_atomic_replace(); - else - DBUG_ASSERT(!atomic_replace); - create_info->ddl_log_state_create= &ddl_log_state_create; - create_info->ddl_log_state_rm= &ddl_log_state_rm; - tmp_table= create_info->tmp_table(); } @@ -4266,10 +4234,10 @@ void select_insert::store_values(List &values) bool select_insert::prepare_eof() { int error; -#ifndef DBUG_OFF bool const trans_table= table->file->has_transactions_and_rollback(); -#endif bool changed; + bool binary_logged= 0; + killed_state killed_status= thd->killed; DBUG_ENTER("select_insert::prepare_eof"); DBUG_PRINT("enter", ("trans_table: %d, table_type: '%s'", @@ -4287,33 +4255,12 @@ bool select_insert::prepare_eof() error= thd->get_stmt_da()->sql_errno(); if (info.ignore || info.handle_duplicates != DUP_ERROR) - if (table->file->ha_table_flags() & HA_DUPLICATE_POS) - table->file->ha_rnd_end(); + if (table->file->ha_table_flags() & HA_DUPLICATE_POS) + table->file->ha_rnd_end(); table->file->extra(HA_EXTRA_END_ALTER_COPY); table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE); - if (atomic_replace && !error) - { - DBUG_ASSERT(table->s->tmp_table); - - table->file->ha_release_auto_increment(); - - /* - Note: InnoDB does autocommit on external unlock. - We cannot do commit twice and we must commit after binlog - (flush row events is done at commit), so we cannot do it here. - Test: rpl.create_or_replace_row - */ - ulonglong save_options_bits= thd->variables.option_bits; - thd->variables.option_bits|= OPTION_NOT_AUTOCOMMIT; - int lock_error= table->file->ha_external_lock(thd, F_UNLCK); - thd->variables.option_bits= save_options_bits; - - if (lock_error) - DBUG_RETURN(true); /* purecov: inspected */ - } - if (likely((changed= (info.copied || info.deleted || info.updated)))) { /* @@ -4331,54 +4278,19 @@ bool select_insert::prepare_eof() DBUG_ASSERT(trans_table || !changed || thd->transaction->stmt.modified_non_trans_table); - if (unlikely(error)) - { - if ((thd->transaction->stmt.modified_non_trans_table || - thd->log_current_statement()) && !atomic_replace) - { - if (binlog_query()) - table->file->print_error(error,MYF(0)); - } - else - table->file->ha_release_auto_increment(); - DBUG_RETURN(true); - } - - DBUG_RETURN(false); -} - -bool select_insert::binlog_query() -{ - /* For atomic_replace table was already closed in send_eof(). */ - DBUG_ASSERT(table || atomic_replace); - const bool trans_table= table ? table->file->has_transactions_and_rollback() : - false; - killed_state killed_status= thd->killed; - DBUG_ENTER("select_insert::binlog_query"); - /* Write to binlog before commiting transaction. No statement will be written by the binlog_query() below in RBR mode. All the events are in the transaction cache and will be written when ha_autocommit_or_rollback() is issued below. */ - if ((WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open())) + if ((WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open()) && + (likely(!error) || thd->transaction->stmt.modified_non_trans_table || + thd->log_current_statement())) { - - debug_crash_here("ddl_log_create_before_binlog"); - - if (create_info && !create_info->tmp_table()) - { - thd->binlog_xid= thd->query_id; - /* Remember xid's for the case of row based logging */ - ddl_log_update_xid(create_info->ddl_log_state_create, thd->binlog_xid); - if (create_info->ddl_log_state_rm->is_active() && !atomic_replace) - ddl_log_update_xid(create_info->ddl_log_state_rm, thd->binlog_xid); - } - int errcode= 0; int res; - if (thd->is_error()) + if (likely(!error)) thd->clear_error(); else errcode= query_error_code(thd, killed_status == NOT_KILLED); @@ -4387,24 +4299,20 @@ bool select_insert::binlog_query() res= thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query(), thd->query_length(), trans_table, FALSE, FALSE, errcode); - /* - NOTE: binlog_xid must be cleared after commit because pending row events - are written at commit phase. - */ if (res > 0) { - thd->binlog_xid= 0; - if (table) - table->file->ha_release_auto_increment(); + table->file->ha_release_auto_increment(); DBUG_RETURN(true); } - binary_logged= res == 0 || !tmp_table; + binary_logged= res == 0 || !table->s->tmp_table; } - if (table) + table->s->table_creation_was_logged|= binary_logged; + table->file->ha_release_auto_increment(); + + if (unlikely(error)) { - /* NOTE: used in binlog_drop_table(), not needed for atomic_replace */ - table->s->table_creation_was_logged|= binary_logged; - table->file->ha_release_auto_increment(); + table->file->print_error(error,MYF(0)); + DBUG_RETURN(true); } DBUG_RETURN(false); @@ -4451,8 +4359,7 @@ bool select_insert::send_eof() { bool res; DBUG_ENTER("select_insert::send_eof"); - res= (prepare_eof() || binlog_query() || - (!suppress_my_ok && send_ok_packet())); + res= (prepare_eof() || (!suppress_my_ok && send_ok_packet())); DBUG_RETURN(res); } @@ -4517,11 +4424,7 @@ void select_insert::abort_result_set() res= thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query(), thd->query_length(), transactional_table, FALSE, FALSE, errcode); - - /* TODO: Update binary_logged in do_postlock() for RBR? */ - const bool tmp_table= create_info ? create_info->tmp_table() : - (bool) table->s->tmp_table; - binary_logged= res == 0 || !tmp_table; + binary_logged= res == 0 || !table->s->tmp_table; } if (changed) query_cache_invalidate3(thd, table, 1); @@ -4594,13 +4497,11 @@ TABLE *select_create::create_table_from_items(THD *thd, List *items, TABLE tmp_table; // Used during 'Create_field()' TABLE_SHARE share; TABLE *table= 0; - alter_info->select_field_count= items->elements; + uint select_field_count= items->elements; /* Add selected items to field list */ List_iterator_fast it(*items); Item *item; bool save_table_creation_was_logged; - int create_table_mode= C_ORDINARY_CREATE; - LEX_CUSTRING frm= {0, 0}; DBUG_ENTER("select_create::create_table_from_items"); tmp_table.s= &share; @@ -4656,7 +4557,8 @@ TABLE *select_create::create_table_from_items(THD *thd, List *items, if (create_info->check_fields(thd, alter_info, table_list->table_name, - table_list->db)) + table_list->db, + select_field_count)) DBUG_RETURN(NULL); DEBUG_SYNC(thd,"create_table_select_before_create"); @@ -4671,13 +4573,6 @@ TABLE *select_create::create_table_from_items(THD *thd, List *items, create_info->mdl_ticket= table_list->table->mdl_ticket; } - if (atomic_replace) - { - if (create_info->make_tmp_table_list(thd, &table_list, - &create_table_mode)) - DBUG_RETURN(NULL); - } - /* Create and lock table. @@ -4695,14 +4590,11 @@ TABLE *select_create::create_table_from_items(THD *thd, List *items, open_table(). */ - if (!mysql_create_table_no_lock(thd, - &orig_table->db, - &orig_table->table_name, + if (!mysql_create_table_no_lock(thd, &ddl_log_state_create, &ddl_log_state_rm, &table_list->db, &table_list->table_name, create_info, alter_info, NULL, - create_table_mode, table_list, - atomic_replace ? &frm : NULL)) + select_field_count, table_list)) { DEBUG_SYNC(thd,"create_table_select_before_open"); @@ -4712,58 +4604,7 @@ TABLE *select_create::create_table_from_items(THD *thd, List *items, */ table_list->table= 0; - if (atomic_replace) - { - char tmp_path[FN_REFLEN + 1]; - build_table_filename(tmp_path, sizeof(tmp_path) - 1, table_list->db.str, - table_list->table_name.str, "", FN_IS_TMP); - - table_list->table= - thd->create_and_open_tmp_table(&frm, tmp_path, orig_table->db.str, - orig_table->table_name.str, false); - /* - NOTE: if create_and_open_tmp_table() fails the table is dropped by - ddl_log_state_create - */ - if (table_list->table) - { - table_list->table->s->tmp_table= TMP_TABLE_ATOMIC_REPLACE; - /* - NOTE: Aria tables require table locking to work in transactional - mode. Since we don't lock our temporary table we get problems with - unproperly initialized transactional mode: seg-fault while accessing - uninitialized trn member (reproduced by - atomic.create_replace,aria,stmt). - - This hack disables logging for Aria table (that is not needed anyway - for a temporary table). - */ - TABLE *table= table_list->table; - int error; - - /* Disable logging of inserted rows */ - mysql_trans_prepare_alter_copy_data(thd); - - if ((DBUG_IF("atomic_replace_external_lock_fail") && - (error= HA_ERR_LOCK_TABLE_FULL)) || - (error= table->file->ha_external_lock(thd, F_WRLCK))) - { - table->file->print_error(error, MYF(0)); - /* - Enable transaction logging. We cannot call ha_enable_transaction() - as this would write the transaction to the binary log - */ - thd->transaction->on= true; - table->file->ha_reset(); - thd->drop_temporary_table(table, NULL, false); - table_list->table= 0; - goto err; - } - - table_list->table->s->can_do_row_logging= 1; - } - } - else if (!create_info->tmp_table()) + if (!create_info->tmp_table()) { Open_table_context ot_ctx(thd, MYSQL_OPEN_REOPEN); TABLE_LIST::enum_open_strategy save_open_strategy; @@ -4804,18 +4645,13 @@ TABLE *select_create::create_table_from_items(THD *thd, List *items, } else table_list->table= 0; // Create failed - -err: - DBUG_ASSERT(!table_list->table || frm.str || !atomic_replace); - my_free(const_cast(frm.str)); - + if (unlikely(!(table= table_list->table))) { - const bool error= thd->is_error(); - /* CREATE ... IF NOT EXISTS succeed, but did nothing */ - if (likely(!error)) - my_ok(thd); - create_info->finalize_ddl(thd, error); + if (likely(!thd->is_error())) // CREATE ... IF NOT EXISTS + my_ok(thd); // succeed, but did nothing + ddl_log_complete(&ddl_log_state_rm); + ddl_log_complete(&ddl_log_state_create); DBUG_RETURN(NULL); } @@ -4834,13 +4670,9 @@ err: mysql_lock_tables() below should never fail with request to reopen table since it won't wait for the table lock (we have exclusive metadata lock on the table) and thus can't get aborted. - - In case of atomic_replace we have already called ha_external_lock() above - on the newly created temporary table. */ - if ((!atomic_replace && - unlikely(!((*lock)= mysql_lock_tables(thd, &table, 1, 0)))) || - postlock(thd, &table)) + if (unlikely(!((*lock)= mysql_lock_tables(thd, &table, 1, 0)) || + postlock(thd, &table))) { /* purecov: begin tested */ /* @@ -4857,24 +4689,13 @@ err: *lock= 0; } drop_open_table(thd, table, &table_list->db, &table_list->table_name); - if (atomic_replace) - create_info->finalize_ddl(thd, 1); - else - { - debug_crash_here("ddl_log_create_log_complete"); - ddl_log_complete(&ddl_log_state_create); - debug_crash_here("ddl_log_create_log_complete2"); - } - thd->transaction->on= true; + ddl_log_complete(&ddl_log_state_rm); + ddl_log_complete(&ddl_log_state_create); DBUG_RETURN(NULL); /* purecov: end */ } - DBUG_ASSERT( - create_info->tmp_table() || - thd->mdl_context.is_lock_owner(MDL_key::TABLE, orig_table->db.str, - orig_table->table_name.str, MDL_SHARED)); table->s->table_creation_was_logged= save_table_creation_was_logged; - if (!create_info->tmp_table()) + if (!table->s->tmp_table) table->file->prepare_for_row_logging(); /* @@ -4922,10 +4743,11 @@ int select_create::postlock(THD *thd, TABLE **tables) if (unlikely(error)) return error; - if (thd->is_current_stmt_binlog_format_row() && !create_info->tmp_table()) - error= binlog_show_create_table(thd, *tables, create_info); - - return error; + TABLE const *const table = *tables; + if (thd->is_current_stmt_binlog_format_row() && + !table->s->tmp_table) + return binlog_show_create_table(thd, *tables, create_info); + return 0; } @@ -4952,11 +4774,7 @@ select_create::prepare(List &_values, SELECT_LEX_UNIT *u) if (!(table= create_table_from_items(thd, &values, &extra_lock))) { - /* - TODO: Use create_info->table_was_deleted - (now binlog.binlog_stm_binlog fails). - */ - if (create_info->or_replace() && !atomic_replace) + if (create_info->or_replace()) { /* Original table was deleted. We have to log it */ log_drop_table(thd, &table_list->db, &table_list->table_name, @@ -4970,8 +4788,6 @@ select_create::prepare(List &_values, SELECT_LEX_UNIT *u) DBUG_RETURN(-1); } - DBUG_ASSERT(table == table_list->table); - if (create_info->tmp_table()) { /* @@ -4981,26 +4797,17 @@ select_create::prepare(List &_values, SELECT_LEX_UNIT *u) list to keep them inaccessible from inner statements. e.g. CREATE TEMPORARY TABLE `t1` AS SELECT * FROM `t1`; */ - saved_tmp_table_share= thd->save_tmp_table_share(table); + saved_tmp_table_share= thd->save_tmp_table_share(table_list->table); } if (extra_lock) { DBUG_ASSERT(m_plock == NULL); - if (table->s->tmp_table) - { - /* Table is a temporary table, don't write table map to binary log */ + if (create_info->tmp_table()) m_plock= &m_lock; - } else - { - /* - Table is a normal table. Inform binlog_write_table_maps() that - it should write the table map for the current table. - */ m_plock= &thd->extra_lock; - } *m_plock= extra_lock; } @@ -5092,14 +4899,6 @@ static int binlog_show_create_table(THD *thd, TABLE *table, create_info, WITH_DB_NAME); DBUG_ASSERT(result == 0); /* show_create_table() always return 0 */ - /* - NOTE: why it does show_create_table() even if !mysql_bin_log.is_open()? - - Because Galera needs it even if there is no binlog. - (I assume Galera will hijack the binlog information and use it itself - if there is no binlog). That is the the only thing that makes sence - looking at the if statement... Monty - */ if (WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open()) { int errcode= query_error_code(thd, thd->killed == NOT_KILLED); @@ -5221,12 +5020,30 @@ bool select_create::send_eof() is in select_insert::prepare_eof(). For that reason, we mark the flag at this point. */ - if (create_info->tmp_table()) + if (table->s->tmp_table) thd->transaction->stmt.mark_created_temp_table(); if (thd->slave_thread) thd->variables.binlog_annotate_row_events= 0; + debug_crash_here("ddl_log_create_before_binlog"); + + /* + In case of crash, we have to add DROP TABLE to the binary log as + the CREATE TABLE will already be logged if we are not using row based + replication. + */ + if (!thd->is_current_stmt_binlog_format_row()) + { + if (ddl_log_state_create.is_active()) // Not temporary table + ddl_log_update_phase(&ddl_log_state_create, DDL_CREATE_TABLE_PHASE_LOG); + /* + We can ignore if we replaced an old table as ddl_log_state_create will + now handle the logging of the drop if needed. + */ + ddl_log_complete(&ddl_log_state_rm); + } + if (prepare_eof()) { abort_result_set(); @@ -5234,7 +5051,7 @@ bool select_create::send_eof() } debug_crash_here("ddl_log_create_after_prepare_eof"); - if (create_info->tmp_table()) + if (table->s->tmp_table) { /* Now is good time to add the new table to THD temporary tables list. @@ -5260,11 +5077,11 @@ bool select_create::send_eof() tables. This can fail, but we should unlock the table nevertheless. */ - if (!create_info->tmp_table()) + if (!table->s->tmp_table) { #ifdef WITH_WSREP if (WSREP(thd) && - create_info->db_type->db_type == DB_TYPE_INNODB) + table->file->ht->db_type == DB_TYPE_INNODB) { if (thd->wsrep_trx_id() == WSREP_UNDEFINED_TRX_ID) { @@ -5299,46 +5116,15 @@ bool select_create::send_eof() thd->get_stmt_da()->set_overwrite_status(true); } #endif /* WITH_WSREP */ - if (atomic_replace) - { - table_list= orig_table; - create_info->table= orig_table->table; - thd->transaction->on= true; - table->file->ha_reset(); - /* - Remove the temporary table structures from memory but keep the table - files. - */ - thd->drop_temporary_table(table, NULL, false); - table= NULL; - - if (create_info->finalize_atomic_replace(thd, orig_table)) - { - abort_result_set(); - DBUG_RETURN(true); - } - } - - if (binlog_query()) - { - abort_result_set(); - DBUG_RETURN(true); - } - - debug_crash_here("ddl_log_create_after_binlog"); + thd->binlog_xid= thd->query_id; + /* Remember xid's for the case of row based logging */ + ddl_log_update_xid(&ddl_log_state_create, thd->binlog_xid); + ddl_log_update_xid(&ddl_log_state_rm, thd->binlog_xid); trans_commit_stmt(thd); if (!(thd->variables.option_bits & OPTION_GTID_BEGIN)) trans_commit_implicit(thd); thd->binlog_xid= 0; - /* - If are using statement based replication the table will be deleted here - in case of a crash as we can't use xid to check if the query was logged - (as the query was logged before commit!) - */ - create_info->finalize_ddl(thd, false); - - #ifdef WITH_WSREP if (WSREP(thd)) { @@ -5370,22 +5156,17 @@ bool select_create::send_eof() ddl_log.org_database= table_list->db; ddl_log.org_table= table_list->table_name; ddl_log.org_table_id= create_info->tabledef_version; - /* - Since atomic replace doesn't do mysql_rm_table_no_locks() we have - to log DROP entry now. It was already prepared in create_table_impl(). - */ - if (create_info->drop_entry.query.length) - { - DBUG_ASSERT(atomic_replace); - backup_log_ddl(&create_info->drop_entry); - } backup_log_ddl(&ddl_log); } - else if (binlog_query()) - { - abort_result_set(); - DBUG_RETURN(true); - } + /* + If are using statement based replication the table will be deleted here + in case of a crash as we can't use xid to check if the query was logged + (as the query was logged before commit!) + */ + debug_crash_here("ddl_log_create_after_binlog"); + ddl_log_complete(&ddl_log_state_rm); + ddl_log_complete(&ddl_log_state_create); + debug_crash_here("ddl_log_create_log_complete"); /* exit_done must only be set after last potential call to @@ -5393,9 +5174,10 @@ bool select_create::send_eof() */ exit_done= 1; // Avoid double calls + send_ok_packet(); + if (m_plock) { - DBUG_ASSERT(!atomic_replace); MYSQL_LOCK *lock= *m_plock; *m_plock= NULL; m_plock= NULL; @@ -5414,21 +5196,11 @@ bool select_create::send_eof() create_info-> pos_in_locked_tables, table, lock)) - { - send_ok_packet(); DBUG_RETURN(false); // ok - } /* Fail. Continue without locking the table */ - thd->clear_error(); } mysql_unlock_tables(thd, lock); } - else if (atomic_replace && create_info->pos_in_locked_tables && - /* send_eof() is done on success, passing false here */ - create_info->finalize_locked_tables(thd, false)) - DBUG_RETURN(true); - - send_ok_packet(); DBUG_RETURN(false); } @@ -5466,7 +5238,6 @@ void select_create::abort_result_set() thd->variables.option_bits&= ~OPTION_BIN_LOG; select_insert::abort_result_set(); thd->transaction->stmt.modified_non_trans_table= FALSE; - thd->transaction->on= true; thd->variables.option_bits= save_option_bits; /* possible error of writing binary log is ignored deliberately */ @@ -5474,7 +5245,9 @@ void select_create::abort_result_set() if (table) { - bool tmp_table= create_info->tmp_table(); + bool tmp_table= table->s->tmp_table; + bool table_creation_was_logged= (!tmp_table || + table->s->table_creation_was_logged); if (tmp_table) { DBUG_ASSERT(saved_tmp_table_share); @@ -5496,17 +5269,7 @@ void select_create::abort_result_set() m_plock= NULL; } - if (atomic_replace) - { - ulonglong save_options_bits= thd->variables.option_bits; - thd->variables.option_bits|= OPTION_NOT_AUTOCOMMIT; - (void) table->file->ha_external_lock(thd, F_UNLCK); - thd->variables.option_bits= save_options_bits; - (void) thd->drop_temporary_table(table, NULL, true); - } - else - drop_open_table(thd, table, &table_list->db, - &table_list->table_name); + drop_open_table(thd, table, &table_list->db, &table_list->table_name); table=0; // Safety if (thd->log_current_statement()) { @@ -5514,8 +5277,23 @@ void select_create::abort_result_set() { /* Remove logging of drop, create + insert rows */ binlog_reset_cache(thd); + /* Original table was deleted. We have to log it */ + if (table_creation_was_logged) + { + thd->binlog_xid= thd->query_id; + ddl_log_update_xid(&ddl_log_state_create, thd->binlog_xid); + ddl_log_update_xid(&ddl_log_state_rm, thd->binlog_xid); + debug_crash_here("ddl_log_create_before_binlog"); + log_drop_table(thd, &table_list->db, &table_list->table_name, + &create_info->org_storage_engine_name, + create_info->db_type == partition_hton, + &create_info->tabledef_version, + tmp_table); + debug_crash_here("ddl_log_create_after_binlog"); + thd->binlog_xid= 0; + } } - else if (!tmp_table && !atomic_replace) + else if (!tmp_table) { backup_log_info ddl_log; bzero(&ddl_log, sizeof(ddl_log)); @@ -5530,8 +5308,8 @@ void select_create::abort_result_set() } } - create_info->finalize_ddl(thd, !binary_logged); - DBUG_ASSERT(!thd->binlog_xid); + ddl_log_complete(&ddl_log_state_rm); + ddl_log_complete(&ddl_log_state_create); if (create_info->table_was_deleted) { @@ -5539,8 +5317,6 @@ void select_create::abort_result_set() (void) trans_rollback_stmt(thd); thd->locked_tables_list.unlock_locked_table(thd, create_info->mdl_ticket); } - else if (atomic_replace && create_info->pos_in_locked_tables) - /* abort_result_set() is done on error, passing true here */ - (void) create_info->finalize_locked_tables(thd, true); + DBUG_VOID_RETURN; } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 2394207ea2d..69803242fc1 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -7510,11 +7510,9 @@ void THD::reset_for_next_command(bool do_clear_error) DBUG_ENTER("THD::reset_for_next_command"); DBUG_ASSERT(!spcont); /* not for substatements of routines */ DBUG_ASSERT(!in_sub_stmt); - DBUG_ASSERT(transaction->on); - /* Table maps should have been reset after previous statement except in the - case where we have locked ables + case where we have locked tables */ DBUG_ASSERT(binlog_table_maps == 0 || locked_tables_mode == LTM_LOCK_TABLES); diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index de2c2553e0c..7acbd29f204 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -6695,7 +6695,7 @@ static bool write_log_rename_frm(ALTER_PARTITION_PARAM_TYPE *lpt) goto error; log_entry= part_info->list; part_info->main_entry= log_entry; - if (ddl_log_write_execute_entry(log_entry->entry_pos, 0, + if (ddl_log_write_execute_entry(log_entry->entry_pos, &exec_log_entry)) goto error; release_part_info_log_entries(old_first_log_entry); @@ -6750,7 +6750,7 @@ static bool write_log_drop_partition(ALTER_PARTITION_PARAM_TYPE *lpt) goto error; log_entry= part_info->list; part_info->main_entry= log_entry; - if (ddl_log_write_execute_entry(log_entry->entry_pos, 0, + if (ddl_log_write_execute_entry(log_entry->entry_pos, &exec_log_entry)) goto error; release_part_info_log_entries(old_first_log_entry); @@ -6782,7 +6782,7 @@ static bool write_log_convert_partition(ALTER_PARTITION_PARAM_TYPE *lpt) if (write_log_convert_partition(lpt, &next_entry, (const char*)path)) goto error; DBUG_ASSERT(next_entry == part_info->list->entry_pos); - if (ddl_log_write_execute_entry(part_info->list->entry_pos, 0, + if (ddl_log_write_execute_entry(part_info->list->entry_pos, &part_info->execute_entry)) goto error; mysql_mutex_unlock(&LOCK_gdl); @@ -6837,7 +6837,7 @@ static bool write_log_add_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt) goto error; log_entry= part_info->list; - if (ddl_log_write_execute_entry(log_entry->entry_pos, 0, + if (ddl_log_write_execute_entry(log_entry->entry_pos, &part_info->execute_entry)) goto error; mysql_mutex_unlock(&LOCK_gdl); @@ -6904,7 +6904,7 @@ static bool write_log_final_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt) log_entry= part_info->list; part_info->main_entry= log_entry; /* Overwrite the revert execute log entry with this retry execute entry */ - if (ddl_log_write_execute_entry(log_entry->entry_pos, 0, + if (ddl_log_write_execute_entry(log_entry->entry_pos, &exec_log_entry)) goto error; release_part_info_log_entries(old_first_log_entry); @@ -7080,8 +7080,6 @@ static void handle_alter_part_error(ALTER_PARTITION_PARAM_TYPE *lpt, { THD *thd= lpt->thd; partition_info *part_info= lpt->part_info->get_clone(thd); - /* TABLE is going to be released, we should not access old part_info anymore */ - lpt->part_info= part_info; TABLE *table= lpt->table; DBUG_ENTER("handle_alter_part_error"); DBUG_ASSERT(table->needs_reopen()); diff --git a/sql/sql_partition_admin.cc b/sql/sql_partition_admin.cc index e0d40337d93..d290d0f5534 100644 --- a/sql/sql_partition_admin.cc +++ b/sql/sql_partition_admin.cc @@ -383,7 +383,7 @@ static bool exchange_name_with_ddl_log(THD *thd, DBUG_EXECUTE_IF("exchange_partition_fail_2", goto err_no_execute_written;); DBUG_EXECUTE_IF("exchange_partition_abort_2", DBUG_SUICIDE();); - if (unlikely(ddl_log_write_execute_entry(log_entry->entry_pos, 0, + if (unlikely(ddl_log_write_execute_entry(log_entry->entry_pos, &exec_log_entry))) goto err_no_execute_written; /* ddl_log is written and synced */ diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc index c9886232d45..1137e0e1b09 100644 --- a/sql/sql_rename.cc +++ b/sql/sql_rename.cc @@ -200,7 +200,7 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent, else { /* Revert the renames of normal tables with the help of the ddl log */ - error|= ddl_log_revert(thd, &ddl_log_state); + ddl_log_revert(thd, &ddl_log_state); } err: @@ -209,10 +209,10 @@ err: static bool -rename_temporary_table(THD *thd, TABLE_LIST *ren_table, TABLE_LIST *new_table) +do_rename_temporary(THD *thd, TABLE_LIST *ren_table, TABLE_LIST *new_table) { LEX_CSTRING *new_alias; - DBUG_ENTER("rename_temporary_table"); + DBUG_ENTER("do_rename_temporary"); new_alias= (lower_case_table_names == 2) ? &new_table->alias : &new_table->table_name; @@ -229,6 +229,20 @@ rename_temporary_table(THD *thd, TABLE_LIST *ren_table, TABLE_LIST *new_table) /** + Parameters for do_rename +*/ + +struct rename_param +{ + LEX_CSTRING old_alias, new_alias; + LEX_CUSTRING old_version; + handlerton *from_table_hton; +}; + + +/** + check_rename() + Check pre-conditions for rename - From table should exists - To table should not exists. @@ -244,15 +258,15 @@ rename_temporary_table(THD *thd, TABLE_LIST *ren_table, TABLE_LIST *new_table) @retval <0 Can't do rename, but no error */ -int -rename_check_preconditions(THD *thd, rename_param *param, - Table_name *ren_table, - const LEX_CSTRING *new_db, - const LEX_CSTRING *new_table_name, - const LEX_CSTRING *new_table_alias, - bool if_exists) +static int +check_rename(THD *thd, rename_param *param, + TABLE_LIST *ren_table, + const LEX_CSTRING *new_db, + const LEX_CSTRING *new_table_name, + const LEX_CSTRING *new_table_alias, + bool if_exists) { - DBUG_ENTER("rename_check_preconditions"); + DBUG_ENTER("check_rename"); DBUG_PRINT("enter", ("if_exists: %d", (int) if_exists)); @@ -270,8 +284,7 @@ rename_check_preconditions(THD *thd, rename_param *param, if (!ha_table_exists(thd, &ren_table->db, ¶m->old_alias, ¶m->old_version, NULL, - ¶m->from_table_hton, NULL, - (param->rename_flags & FN_FROM_IS_TMP)) || + ¶m->from_table_hton) || !param->from_table_hton) { my_error(ER_NO_SUCH_TABLE, MYF(if_exists ? ME_NOTE : 0), @@ -291,8 +304,7 @@ rename_check_preconditions(THD *thd, rename_param *param, DBUG_RETURN(-1); } - if (ha_table_exists(thd, new_db, ¶m->new_alias, NULL, NULL, NULL, NULL, - (param->rename_flags & FN_TO_IS_TMP))) + if (ha_table_exists(thd, new_db, ¶m->new_alias, NULL, NULL, 0)) { my_error(ER_TABLE_EXISTS_ERROR, MYF(0), param->new_alias.str); DBUG_RETURN(1); // This can't be skipped @@ -305,6 +317,7 @@ rename_check_preconditions(THD *thd, rename_param *param, Rename a single table or a view SYNPOSIS + do_rename() thd Thread handle ren_table A table/view to be renamed new_db The database to which the table to be moved to @@ -316,47 +329,36 @@ rename_check_preconditions(THD *thd, rename_param *param, Rename a single table or a view. In case of failure, all changes will be reverted - Even if mysql_rename_tables() cannot be used with LOCK TABLES, - the table can still be locked if we come here from CREATE ... REPLACE. - - If ddl_log_state is NULL then we will not log the rename to the ddl log. - RETURN false Ok true rename failed */ -bool -rename_table_and_triggers(THD *thd, rename_param *param, - DDL_LOG_STATE *ddl_log_state, - Table_name *ren_table, const LEX_CSTRING *new_db, - bool skip_error, bool *force_if_exists) +static bool +do_rename(THD *thd, rename_param *param, DDL_LOG_STATE *ddl_log_state, + TABLE_LIST *ren_table, const LEX_CSTRING *new_db, + bool skip_error, bool *force_if_exists) { int rc= 1; handlerton *hton; LEX_CSTRING *old_alias, *new_alias; TRIGGER_RENAME_PARAM rename_param; - rename_param.rename_flags= param->rename_flags; - DBUG_ENTER("rename_table_and_triggers"); + DBUG_ENTER("do_rename"); DBUG_PRINT("enter", ("skip_error: %d", (int) skip_error)); old_alias= ¶m->old_alias; new_alias= ¶m->new_alias; hton= param->from_table_hton; + DBUG_ASSERT(!thd->locked_tables_mode); + #ifdef WITH_WSREP if (WSREP(thd) && hton && hton != view_pseudo_hton && !wsrep_should_replicate_ddl(thd, hton)) DBUG_RETURN(1); #endif - if (!(param->rename_flags & FN_FROM_IS_TMP)) - tdc_remove_table(thd, ren_table->db.str, ren_table->table_name.str); - - /* - In case of CREATE..REPLACE the temporary table does not have a - MDL lock - */ + tdc_remove_table(thd, ren_table->db.str, ren_table->table_name.str); if (hton != view_pseudo_hton) { @@ -374,23 +376,19 @@ rename_table_and_triggers(THD *thd, rename_param *param, thd->replication_flags= 0; - if (ddl_log_state && - ddl_log_rename_table(ddl_log_state, hton, - &ren_table->db, old_alias, new_db, new_alias, - DDL_RENAME_PHASE_TABLE, 0)) + if (ddl_log_rename_table(ddl_log_state, hton, + &ren_table->db, old_alias, new_db, new_alias)) DBUG_RETURN(1); debug_crash_here("ddl_log_rename_before_rename_table"); if (!(rc= mysql_rename_table(hton, &ren_table->db, old_alias, - new_db, new_alias, ¶m->old_version, - param->rename_flags))) + new_db, new_alias, ¶m->old_version, 0))) { /* Table rename succeded. It's safe to start recovery at rename trigger phase */ debug_crash_here("ddl_log_rename_before_phase_trigger"); - if (ddl_log_state) - ddl_log_update_phase(ddl_log_state, DDL_RENAME_PHASE_TRIGGER); + ddl_log_update_phase(ddl_log_state, DDL_RENAME_PHASE_TRIGGER); debug_crash_here("ddl_log_rename_before_rename_trigger"); @@ -403,13 +401,10 @@ rename_table_and_triggers(THD *thd, rename_param *param, new_alias))) { debug_crash_here("ddl_log_rename_before_stat_tables"); - if (!(param->rename_flags & FN_IS_TMP)) - { - (void) rename_table_in_stat_tables(thd, &ren_table->db, - &ren_table->table_name, - new_db, new_alias); - debug_crash_here("ddl_log_rename_after_stat_tables"); - } + (void) rename_table_in_stat_tables(thd, &ren_table->db, + &ren_table->table_name, + new_db, new_alias); + debug_crash_here("ddl_log_rename_after_stat_tables"); } else { @@ -424,8 +419,7 @@ rename_table_and_triggers(THD *thd, rename_param *param, &ren_table->db, old_alias, ¶m->old_version, NO_FK_CHECKS); debug_crash_here("ddl_log_rename_after_revert_rename_table"); - if (ddl_log_state) - ddl_log_disable_entry(ddl_log_state); + ddl_log_disable_entry(ddl_log_state); debug_crash_here("ddl_log_rename_after_disable_entry"); } } @@ -446,7 +440,6 @@ rename_table_and_triggers(THD *thd, rename_param *param, DBUG_RETURN(1); } - DBUG_ASSERT(ddl_log_state); ddl_log_rename_view(ddl_log_state, &ren_table->db, &ren_table->table_name, new_db, new_alias); debug_crash_here("ddl_log_rename_before_rename_view"); @@ -523,25 +516,24 @@ rename_tables(THD *thd, TABLE_LIST *table_list, DDL_LOG_STATE *ddl_log_state, pair->from= ren_table; pair->to= new_table; - if (rename_temporary_table(thd, ren_table, new_table)) + if (do_rename_temporary(thd, ren_table, new_table)) goto revert_rename; } else { int error; rename_param param; - error= rename_check_preconditions(thd, ¶m, ren_table, - &new_table->db, &new_table->table_name, - &new_table->alias, - (skip_error || if_exists)); + error= check_rename(thd, ¶m, ren_table, &new_table->db, + &new_table->table_name, + &new_table->alias, (skip_error || if_exists)); if (error < 0) continue; // Ignore rename (if exists) if (error > 0) goto revert_rename; - if (rename_table_and_triggers(thd, ¶m, ddl_log_state, - ren_table, &new_table->db, - skip_error, force_if_exists)) + if (do_rename(thd, ¶m, ddl_log_state, + ren_table, &new_table->db, + skip_error, force_if_exists)) goto revert_rename; } } @@ -551,7 +543,7 @@ revert_rename: /* Revert temporary tables. Normal tables are reverted in the caller */ List_iterator_fast it(tmp_tables); while (TABLE_PAIR *pair= it++) - rename_temporary_table(thd, pair->to, pair->from); + do_rename_temporary(thd, pair->to, pair->from); DBUG_RETURN(1); } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index f1ff1ca2d1d..3c00e4428a8 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -55,7 +55,6 @@ #include "sql_window.h" #include "tztime.h" -#include "debug.h" #include "debug_sync.h" // DEBUG_SYNC #include #include @@ -23006,7 +23005,6 @@ end_send(JOIN *join, JOIN_TAB *join_tab, bool end_of_records) // error < 0 => duplicate row join->duplicate_rows++; } - debug_crash_here("ddl_log_create_after_send_data"); } join->send_records++; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index c77759c3e8b..b47b9f4b89b 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2111,8 +2111,7 @@ int show_create_table_ex(THD *thd, TABLE_LIST *table_list, !create_info_arg->or_replace_slave_generated()) || create_info_arg->table_was_deleted)) packet->append(STRING_WITH_LEN("OR REPLACE ")); - if (share->tmp_table && - !(create_info_arg && create_info_arg->is_atomic_replace())) + if (share->tmp_table) packet->append(STRING_WITH_LEN("TEMPORARY ")); packet->append(STRING_WITH_LEN("TABLE ")); if (create_info_arg && create_info_arg->if_not_exists()) @@ -4818,7 +4817,7 @@ static int fill_schema_table_names(THD *thd, TABLE_LIST *tables, bool is_sequence; if (ha_table_exists(thd, db_name, table_name, NULL, NULL, - &hton, &is_sequence, 0)) + &hton, &is_sequence)) { if (hton == view_pseudo_hton) table->field[3]->store(STRING_WITH_LEN("VIEW"), cs); @@ -5048,7 +5047,7 @@ static int fill_schema_table_from_frm(THD *thd, TABLE *table, init_sql_alloc(key_memory_table_triggers_list, &tbl.mem_root, TABLE_ALLOC_BLOCK_SIZE, 0, MYF(0)); if (!Table_triggers_list::check_n_load(thd, db_name, - table_name, &tbl, true, 0)) + table_name, &tbl, 1)) { table_list.table= &tbl; res= schema_table->process_table(thd, &table_list, table, diff --git a/sql/sql_table.cc b/sql/sql_table.cc index ad58dd620d9..34828d4d8c4 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -870,7 +870,7 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags) if (write_log_replace_frm(lpt, part_info->list->entry_pos, (const char*) bak_path, (const char*) path) || - ddl_log_write_execute_entry(part_info->list->entry_pos, 0, + ddl_log_write_execute_entry(part_info->list->entry_pos, &part_info->execute_entry)) { mysql_mutex_unlock(&LOCK_gdl); @@ -1243,75 +1243,6 @@ static uint32 get_comment(THD *thd, uint32 comment_pos, return 0; } - -static -bool make_tmp_name(THD *thd, const char *prefix, const Table_name *orig, - Table_name *res) -{ - char res_name[NAME_LEN + 1]; - char file_name[NAME_LEN + 1]; - LEX_CSTRING table_name; - /* - Filename trimming should not depend on prefix length with variable PID and - thread ID. This makes tests happier. - */ - constexpr int MIN_PREFIX= 30; - - size_t len= my_snprintf(res_name, sizeof(res_name) - 1, - tmp_file_prefix "-%s-%lx-%llx-", prefix, - current_pid, thd->thread_id); - - const size_t pfx_len= len < MIN_PREFIX ? MIN_PREFIX : len; - uint len2= tablename_to_filename(orig->table_name.str, file_name, - sizeof(res_name) - pfx_len - 1); - - DBUG_ASSERT(len + len2 < sizeof(res_name) - 1); - memcpy(res_name + len, file_name, len2 + 1); - len+= len2; - - table_name.str= strmake_root(thd->mem_root, res_name, len); - if (!table_name.str) - return true; - - table_name.length= len; - res->db= orig->db; - res->table_name= table_name; - res->alias= table_name; - return false; -} - - -/** - Helper for making utility table names for atomic CREATE OR REPLACE. - - Creates two temporary names: "create" (used for new table) - and "backup" (used for saving old table). - - @param create_table[in/out] Original table name, on output holds new name - @param create_table_mode[out] Create flags or-ed with C_ALTER_TABLE -*/ - -bool HA_CREATE_INFO::make_tmp_table_list(THD *thd, TABLE_LIST **create_table, - int *create_table_mode) -{ - TABLE_LIST *new_table; - if (make_tmp_name(thd, "create", *create_table, &tmp_name) || - make_tmp_name(thd, "backup", *create_table, &backup_name) || - !(new_table= (TABLE_LIST *)thd->alloc(sizeof(TABLE_LIST)))) - { - my_error(ER_OUT_OF_RESOURCES, MYF(0)); - return true; - } - (*create_table_mode)|= C_ALTER_TABLE; - DBUG_ASSERT(!(options & HA_CREATE_TMP_ALTER)); - options|= HA_CREATE_TMP_ALTER; - new_table->init_one_table(&tmp_name.db, &tmp_name.table_name, - &tmp_name.alias, (*create_table)->lock_type); - *create_table= new_table; - return false; -} - - /** Execute the drop of a sequence, view or table (normal or temporary). @@ -1564,13 +1495,12 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, DBUG_ASSERT(thd->mdl_context.is_lock_owner(MDL_key::TABLE, db.str, table_name.str, MDL_SHARED)); - /* NOTE: alias holds original table name, table_name holds lowercase name */ alias= (lower_case_table_names == 2) ? table->alias : table_name; /* remove .frm file and engine files */ path_length= build_table_filename(path, sizeof(path) - 1, db.str, alias.str, reg_ext, 0); path_end= path + path_length - reg_ext_length; - } /* if (!drop_temporary) */ + } DEBUG_SYNC(thd, "rm_table_no_locks_before_delete_table"); if (drop_temporary) @@ -1669,7 +1599,7 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, &table_name); else res= ddl_log_drop_table(ddl_log_state, hton, &cpath, &db, - &table_name, 0); + &table_name); if (res) { error= -1; @@ -1746,17 +1676,8 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, int ferror= 0; DBUG_ASSERT(!was_view); - /* - We where not able to drop the table for the engine. We will now try - to drop the table for any engines (to handle the case where we don't have - an .frm file or when the the information in the .frm does not match the - engine type). - We start by discarding the previous drop attempt, as we have tried - this drop already and it failed. - */ - ddl_log_disable_entry(ddl_log_state); if (ddl_log_drop_table(ddl_log_state, 0, &cpath, &db, - &table_name, 0)) + &table_name)) { error= -1; goto err; @@ -1795,24 +1716,17 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, if (!was_view) { - if (likely(!error) || non_existing_table_error(error)) - { - debug_crash_here("ddl_log_drop_before_drop_trigger"); - ddl_log_update_phase(ddl_log_state, DDL_DROP_PHASE_TRIGGER); - debug_crash_here("ddl_log_drop_before_drop_trigger2"); - if (Table_triggers_list::drop_all_triggers(thd, &db, &table_name, 0, - MYF(MY_WME | - MY_IGNORE_ENOENT))) - error= error ? error : -1; - } - else - { - /* NOTE: table may not be dropped due to FK error */ - DBUG_ASSERT(error); - ddl_log_update_phase(ddl_log_state, DDL_DROP_PHASE_END); - } + debug_crash_here("ddl_log_drop_before_drop_trigger"); + ddl_log_update_phase(ddl_log_state, DDL_DROP_PHASE_TRIGGER); + debug_crash_here("ddl_log_drop_before_drop_trigger2"); } + if (likely(!error) || non_existing_table_error(error)) + { + if (Table_triggers_list::drop_all_triggers(thd, &db, &table_name, + MYF(MY_WME | MY_IGNORE_ENOENT))) + error= error ? error : -1; + } debug_crash_here("ddl_log_drop_after_drop_trigger"); report_error: @@ -1879,12 +1793,7 @@ report_error: backup_log_ddl(&ddl_log); } } - /* - Foreign key check may fail and we didn't drop the table. - We are already at DDL_DROP_PHASE_END in this case and we - must not binlog DROP query. - */ - if (!was_view && table_dropped) + if (!was_view) ddl_log_update_phase(ddl_log_state, DDL_DROP_PHASE_BINLOG); if (!dont_log_query && @@ -2833,7 +2742,8 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, List_iterator_fast it(alter_info->create_list); List_iterator it2(alter_info->create_list); uint total_uneven_bit_length= 0; - bool tmp_table= (create_table_mode & C_ALTER_TABLE); + int select_field_count= C_CREATE_SELECT(create_table_mode); + bool tmp_table= create_table_mode == C_ALTER_TABLE; const bool create_simple= thd->lex->create_simple(); bool is_hash_field_needed= false; const Column_derived_attributes dattr(create_info->default_table_charset); @@ -2872,7 +2782,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, DBUG_RETURN(TRUE); } - select_field_pos= alter_info->field_count(); + select_field_pos= alter_info->create_list.elements - select_field_count; null_fields= 0; create_info->varchar= 0; max_key_length= file->max_key_length(); @@ -3047,7 +2957,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, from the select tables. This order may differ on master and slave. We therefore mark it as unsafe. */ - if (alter_info->select_field_count > 0 && auto_increment) + if (select_field_count > 0 && auto_increment) thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_CREATE_SELECT_AUTOINC); /* Create keys */ @@ -3086,18 +2996,6 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, } else fk_key->ref_columns.append(&fk_key->columns); - /* - If this is a self refering table from CREATE ... SELECT, - update the foreign key table name to the used (temporary) table name. - */ - if (create_info->tmp_name.is_set() && - (!fk_key->ref_db.str || - !lex_string_cmp(table_alias_charset, &db, &fk_key->ref_db)) && - !lex_string_cmp(table_alias_charset, &table_name, - &fk_key->ref_table)) - { - fk_key->ref_table= create_info->tmp_name.table_name; - } continue; } (*key_count)++; @@ -4386,209 +4284,12 @@ err: } -/** - Finalize atomic CREATE OR REPLACE. - - Renames old table to backup table (in case it exists), rename tmp table to - new table. These operations are covered with DDL logging in two chains: - - ddl_log_state_create: rolls back the tables to the original state before - the command was started. - - ddl_log_state_rm: keep the new table and drop the backup table. - - finalize_ddl() executes one of the above chains depending on error or success - state. - - @return true in case of error -*/ - -bool HA_CREATE_INFO::finalize_atomic_replace(THD *thd, TABLE_LIST *orig_table) -{ - rename_param param; - bool dummy; - const LEX_CSTRING db= orig_table->db; - const LEX_CSTRING table_name= orig_table->table_name; - LEX_CSTRING cpath; - char path[FN_REFLEN + 1]; - cpath.str= path; - bool locked_tables_decremented= false; - - DBUG_ASSERT(is_atomic_replace()); - - debug_crash_here("ddl_log_create_before_install_new"); - if (old_hton) - { - /* Old table exists, rename it to backup_name */ - ddl_log_link_chains(ddl_log_state_rm, ddl_log_state_create); - - cpath.length= build_table_filename(path, sizeof(path) - 1, - backup_name.db.str, - backup_name.table_name.str, - "", FN_IS_TMP); - - if (ddl_log_drop_table_init(ddl_log_state_rm, &backup_name.db, - &empty_clex_str) || - ddl_log_drop_table(ddl_log_state_rm, old_hton, &cpath, - &backup_name.db, &backup_name.table_name, - DDL_LOG_FLAG_FROM_IS_TMP)) - return true; - - debug_crash_here("ddl_log_create_after_log_drop_backup"); - if (ddl_log_rename_table(ddl_log_state_create, old_hton, - &db, &table_name, - &backup_name.db, &backup_name.table_name, - DDL_RENAME_PHASE_TRIGGER, - DDL_LOG_FLAG_FROM_IS_TMP)) - return true; - - debug_crash_here("ddl_log_create_after_log_rename_backup"); - - if (thd->locked_tables_mode == LTM_LOCK_TABLES || - thd->locked_tables_mode == LTM_PRELOCKED_UNDER_LOCK_TABLES) - { - DBUG_ASSERT(thd->mdl_context.is_lock_owner(MDL_key::TABLE, db.str, - table_name.str, - MDL_EXCLUSIVE)); - /* - HA_EXTRA_PREPARE_FOR_DROP: after CREATE OR REPLACE table - must be not locked, removing it from thd->locked_tables_list. - */ - close_all_tables_for_name(thd, table->s, - HA_EXTRA_PREPARE_FOR_DROP, NULL); - table= NULL; - orig_table->table= NULL; - locked_tables_decremented= true; - } - - param.rename_flags= FN_TO_IS_TMP; - param.from_table_hton= old_hton; - param.old_version= org_tabledef_version; - param.old_alias= lower_case_table_names == 2 ? orig_table->alias : - table_name; - param.new_alias= backup_name.table_name; - if (rename_table_and_triggers(thd, ¶m, NULL, orig_table, - &backup_name.db, false, &dummy)) - { - if (locked_tables_decremented) - thd->locked_tables_list.add_back_last_deleted_lock(pos_in_locked_tables); - return true; - } - debug_crash_here("ddl_log_create_after_save_backup"); - } - - cpath.length= build_table_filename(path, sizeof(path) - 1, db.str, - table_name.str, "", 0); - param.rename_flags= FN_FROM_IS_TMP; - param.from_table_hton= db_type; - param.old_version= tabledef_version; - param.old_alias= tmp_name.table_name; - param.new_alias= table_name; - if (ddl_log_create_table(ddl_log_state_create, param.from_table_hton, - &cpath, &db, &table_name, false) || - rename_table_and_triggers(thd, ¶m, NULL, &tmp_name, &db, false, - &dummy)) - { - if (locked_tables_decremented) - thd->locked_tables_list.add_back_last_deleted_lock(pos_in_locked_tables); - return true; - } - debug_crash_here("ddl_log_create_after_install_new"); - return false; -} - - -/** - Execute ddl_log_state_rm or ddl_log_state_create depending on error or success - state. -*/ - -void HA_CREATE_INFO::finalize_ddl(THD *thd, bool roll_back) -{ - if (roll_back) - { - /* - Statement failed - - Forget drop of backup table - - Rollback create (drop temporary table, rename backup to original) - */ - debug_crash_here("ddl_log_create_fk_fail"); - ddl_log_complete(ddl_log_state_rm); - debug_crash_here("ddl_log_create_fk_fail2"); - (void) ddl_log_revert(thd, ddl_log_state_create); - debug_crash_here("ddl_log_create_fk_fail3"); - } - else - { - /* - Statement succeded - - Forget revert of create table - - Drop backup table - */ - debug_crash_here("ddl_log_create_log_complete"); - ddl_log_complete(ddl_log_state_create); - debug_crash_here("ddl_log_create_log_complete2"); - if (is_atomic_replace()) - (void) ddl_log_revert(thd, ddl_log_state_rm); - else - ddl_log_complete(ddl_log_state_rm); - debug_crash_here("ddl_log_create_log_complete3"); - } -} - - -/** - Finalize operation of LOCK TABLES mode for CREATE TABLE family of commands. - - @param operation_failed Notify if the callee CREATE fails the operation - @return true on error, false on success -*/ -bool HA_CREATE_INFO::finalize_locked_tables(THD *thd, bool operation_failed) -{ - DBUG_ASSERT(pos_in_locked_tables); - DBUG_ASSERT(thd->locked_tables_mode); - DBUG_ASSERT(thd->variables.option_bits & OPTION_TABLE_LOCK); - if (!operation_failed) - { - /* - Add back the deleted table and re-created table as a locked table - This should always work as we have a meta lock on the table. - */ - thd->locked_tables_list.add_back_last_deleted_lock(pos_in_locked_tables); - } - if (thd->locked_tables_list.reopen_tables(thd, false)) - { - thd->locked_tables_list.unlink_all_closed_tables(thd, NULL, 0); - return true; - } - if (is_atomic_replace() || !operation_failed) - { - /* - The lock was made exclusive in create_table_impl(). We have now - to bring it back to it's orginal state. - */ - TABLE *table= pos_in_locked_tables->table; - table->mdl_ticket->downgrade_lock(MDL_SHARED_NO_READ_WRITE); - } - else - { - /* - In failed non-atomic we have nothing to downgrade: - original table was deleted and the lock was already removed. - */ - DBUG_ASSERT(!pos_in_locked_tables->table); - } - - return false; -} - - /** Create a table @param thd Thread object - @param orig_db Database for error messages or atomic replace - @param orig_table_name Table name for error messages or atomic replace + @param orig_db Database for error messages + @param orig_table_name Table name for error messages (it's different from table_name for ALTER TABLE) @param db Database @param table_name Table name @@ -4623,6 +4324,8 @@ bool HA_CREATE_INFO::finalize_locked_tables(THD *thd, bool operation_failed) static int create_table_impl(THD *thd, + DDL_LOG_STATE *ddl_log_state_create, + DDL_LOG_STATE *ddl_log_state_rm, const LEX_CSTRING &orig_db, const LEX_CSTRING &orig_table_name, const LEX_CSTRING &db, const LEX_CSTRING &table_name, @@ -4631,23 +4334,24 @@ int create_table_impl(THD *thd, int create_table_mode, bool *is_trans, KEY **key_info, uint *key_count, LEX_CUSTRING *frm) { - LEX_CSTRING *alias= const_cast(table_case_name(create_info, &table_name)); + LEX_CSTRING *alias; handler *file= 0; int error= 1; - bool frm_only= (create_table_mode & C_ALTER_TABLE_FRM_ONLY); - bool atomic_replace= create_info->is_atomic_replace(); - bool internal_tmp_table= (!atomic_replace && - (create_table_mode & C_ALTER_TABLE)) || - frm_only; - /* Easy check for ddl logging if we are creating a temporary table */ - DDL_LOG_STATE *ddl_log_state_create= - create_info->tmp_table() ? 0 : create_info->ddl_log_state_create; + bool frm_only= create_table_mode == C_ALTER_TABLE_FRM_ONLY; + bool internal_tmp_table= create_table_mode == C_ALTER_TABLE || frm_only; DBUG_ENTER("create_table_impl"); DBUG_PRINT("enter", ("db: '%s' table: '%s' tmp: %d path: %s", db.str, table_name.str, internal_tmp_table, path.str)); DBUG_ASSERT(create_info->default_table_charset); + /* Easy check for ddl logging if we are creating a temporary table */ + if (create_info->tmp_table()) + { + ddl_log_state_create= 0; + ddl_log_state_rm= 0; + } + if (fix_constraints_names(thd, &alter_info->check_constraint_list, create_info)) DBUG_RETURN(1); @@ -4676,6 +4380,8 @@ int create_table_impl(THD *thd, goto err; } + alias= const_cast(table_case_name(create_info, &table_name)); + /* Check if table exists */ if (create_info->tmp_table()) { @@ -4729,16 +4435,11 @@ int create_table_impl(THD *thd, goto err; } - handlerton *db_type= NULL; - LEX_CSTRING partition_engine_name= {NULL, 0}; - + handlerton *db_type; if (!internal_tmp_table && - ha_table_exists(thd, &orig_db, &orig_table_name, - &create_info->org_tabledef_version, - &partition_engine_name, &db_type, NULL, 0)) + ha_table_exists(thd, &db, &table_name, + &create_info->org_tabledef_version, NULL, &db_type)) { - create_info->old_hton= db_type; - if (ha_check_if_updates_are_ignored(thd, db_type, "CREATE")) { /* Don't create table. CREATE will still be logged in binary log */ @@ -4748,115 +4449,44 @@ int create_table_impl(THD *thd, if (options.or_replace()) { - (void) delete_statistics_for_table(thd, &orig_db, &orig_table_name); + (void) delete_statistics_for_table(thd, &db, &table_name); TABLE_LIST table_list; - TABLE *table= create_info->table; - table_list.init_one_table(&orig_db, &orig_table_name, 0, TL_READ); - table_list.table= table; + table_list.init_one_table(&db, &table_name, 0, TL_WRITE_ALLOW_WRITE); + table_list.table= create_info->table; if (check_if_log_table(&table_list, TRUE, "CREATE OR REPLACE")) goto err; + + /* + Rollback the empty transaction started in mysql_create_table() + call to open_and_lock_tables() when we are using LOCK TABLES. + */ + (void) trans_rollback_stmt(thd); + /* Remove normal table without logging. Keep tables locked */ + if (mysql_rm_table_no_locks(thd, &table_list, &thd->db, + ddl_log_state_rm, + 0, 0, 0, 0, 1, 1)) + goto err; + debug_crash_here("ddl_log_create_after_drop"); + + /* + We have to log this query, even if it failed later to ensure the + drop is done. + */ + thd->variables.option_bits|= OPTION_BINLOG_THIS; + create_info->table_was_deleted= 1; lex_string_set(&create_info->org_storage_engine_name, - ha_resolve_storage_engine_name(db_type)); - - if (db_type == view_pseudo_hton) - atomic_replace= false; - - if (atomic_replace) - { - /* NOTE: here FK referencing is checked */ - if (!(thd->variables.option_bits & OPTION_NO_FOREIGN_KEY_CHECKS)) - { - Open_table_context ot_ctx(thd, MYSQL_OPEN_REOPEN); - if (!create_info->table) - { - if (open_table(thd, &table_list, &ot_ctx)) - goto err; - table= table_list.table; - } - FOREIGN_KEY_INFO *fk; - bool res= table->referenced_by_foreign_table(thd, &fk); - if (!create_info->table) - { - (void) close_thread_table(thd, &thd->open_tables); - table= NULL; - } - if (res) - { - if (fk) - my_error(ER_ROW_IS_REFERENCED_2, MYF(0), fk->foreign_table->str); - goto err; - } - } - - if (thd->locked_tables_mode == LTM_LOCK_TABLES || - thd->locked_tables_mode == LTM_PRELOCKED_UNDER_LOCK_TABLES) - { - if (wait_while_table_is_used(thd, table, HA_EXTRA_NOT_USED)) - goto err; - } - else - { - DBUG_ASSERT(thd->mdl_context.is_lock_owner(MDL_key::TABLE, - orig_db.str, - orig_table_name.str, - MDL_EXCLUSIVE)); - } - - /* - Prepare DROP entry for backup log. It will be logged before logging - the CREATE entry when the command succeeds. - */ - backup_log_info *drop_entry= &create_info->drop_entry; - drop_entry->query= { C_STRING_WITH_LEN("DROP") }; - if ((drop_entry->org_partitioned= (partition_engine_name.str != 0))) - drop_entry->org_storage_engine_name= partition_engine_name; - else - lex_string_set(&drop_entry->org_storage_engine_name, - ha_resolve_storage_engine_name(db_type)); - drop_entry->org_database= orig_db; - drop_entry->org_table= orig_table_name; - drop_entry->org_table_id= create_info->org_tabledef_version; - - DBUG_EXECUTE_IF("send_kill_after_delete", thd->set_killed(KILL_QUERY);); - } - else - { - /* - Rollback the empty transaction started in mysql_create_table() - call to open_and_lock_tables() when we are using LOCK TABLES. - */ - (void) trans_rollback_stmt(thd); - - /* Remove normal table without logging. Keep tables locked */ - if (mysql_rm_table_no_locks(thd, &table_list, &thd->db, - create_info->ddl_log_state_rm, - 0, 0, 0, 0, 1, 1)) - goto err; - - /* Locked table was closed */ - create_info->table= table_list.table; - - debug_crash_here("ddl_log_create_after_drop"); - - /* - We have to log this query, even if it failed later to ensure the - drop is done. - */ - thd->variables.option_bits|= OPTION_BINLOG_THIS; - create_info->table_was_deleted= 1; - - DBUG_EXECUTE_IF("send_kill_after_delete", thd->set_killed(KILL_QUERY);); - - /* - Restart statement transactions for the case of CREATE ... SELECT. - */ - if (thd->lex->first_select_lex()->item_list.elements && - restart_trans_for_tables(thd, thd->lex->query_tables)) - goto err; - } + ha_resolve_storage_engine_name(db_type)); + DBUG_EXECUTE_IF("send_kill_after_delete", + thd->set_killed(KILL_QUERY);); + /* + Restart statement transactions for the case of CREATE ... SELECT. + */ + if (thd->lex->first_select_lex()->item_list.elements && + restart_trans_for_tables(thd, thd->lex->query_tables)) + goto err; } else if (options.if_not_exists()) { @@ -4875,19 +4505,18 @@ int create_table_impl(THD *thd, } else { - DBUG_ASSERT(!atomic_replace); - my_error(ER_TABLE_EXISTS_ERROR, MYF(0), orig_table_name.str); + my_error(ER_TABLE_EXISTS_ERROR, MYF(0), table_name.str); goto err; } - } /* ha_table_exists() */ - } /* else (!create_info->tmp_table()) */ + } + } THD_STAGE_INFO(thd, stage_creating_table); if (check_engine(thd, orig_db.str, orig_table_name.str, create_info)) goto err; - if (create_table_mode & C_ASSISTED_DISCOVERY) + if (create_table_mode == C_ASSISTED_DISCOVERY) { /* check that it's used correctly */ DBUG_ASSERT(alter_info->create_list.elements == 0); @@ -4973,8 +4602,8 @@ int create_table_impl(THD *thd, if (!frm_only) { debug_crash_here("ddl_log_create_before_create_table"); - if (ha_create_table(thd, path.str, orig_db.str, orig_table_name.str, - create_info, frm, 0)) + if (ha_create_table(thd, path.str, db.str, table_name.str, create_info, + frm, 0)) { file->ha_create_partitioning_metadata(path.str, NULL, CHF_DELETE_FLAG); deletefrm(path.str); @@ -5030,40 +4659,21 @@ warn: Simple wrapper around create_table_impl() to be used in various version of CREATE TABLE statement. - @param thd Thread object - @param orig_db Database for error messages or atomic replace - @param orig_table_name Table name for error messages or atomic replace - (it's different from table_name for ALTER TABLE) - @param db Database - @param table_name Table name - @param create_info Create information (like MAX_ROWS) - @param alter_info Description of fields and keys for new table - @param[out] is_trans Identifies the type of engine where the table - was created: either trans or non-trans. - @param create_table_mode C_ORDINARY_CREATE, C_ALTER_TABLE, - C_ASSISTED_DISCOVERY or C_ALTER_TABLE_FRM_ONLY. - or any positive number (for C_CREATE_SELECT). - If set to C_ALTER_TABLE_FRM_ONY then no frm or - table is created, only the frm image in memory. - @param[out] frm The frm image. - @result 1 unspecifed error 2 error; Don't log create statement 0 ok -1 Table was used with IF NOT EXISTS and table existed (warning, not error) - - TODO: orig_db, orig_table_name, db, table_name should be moved to create_info */ -int mysql_create_table_no_lock(THD *thd, const LEX_CSTRING *orig_db, - const LEX_CSTRING *orig_table_name, +int mysql_create_table_no_lock(THD *thd, + DDL_LOG_STATE *ddl_log_state_create, + DDL_LOG_STATE *ddl_log_state_rm, const LEX_CSTRING *db, const LEX_CSTRING *table_name, Table_specification_st *create_info, Alter_info *alter_info, bool *is_trans, - int create_table_mode, TABLE_LIST *table_list, - LEX_CUSTRING *frm) + int create_table_mode, TABLE_LIST *table_list) { KEY *not_used_1; uint not_used_2; @@ -5071,14 +4681,7 @@ int mysql_create_table_no_lock(THD *thd, const LEX_CSTRING *orig_db, uint path_length; char path[FN_REFLEN + 1]; LEX_CSTRING cpath; - LEX_CUSTRING frm_local; - - if (!frm) - { - /* Used in atomic replace */ - frm_local= {0, 0}; - frm= &frm_local; - } + LEX_CUSTRING frm= {0,0}; DBUG_ASSERT(create_info->default_table_charset); @@ -5087,9 +4690,9 @@ int mysql_create_table_no_lock(THD *thd, const LEX_CSTRING *orig_db, else { const LEX_CSTRING *alias= table_case_name(create_info, table_name); - uint flags= (create_info->options & HA_CREATE_TMP_ALTER) ? FN_IS_TMP : 0; path_length= build_table_filename(path, sizeof(path) - 1, db->str, - alias->str, "", flags); + alias->str, + "", 0); // Check if we hit FN_REFLEN bytes along with file extension. if (path_length+reg_ext_length > FN_REFLEN) { @@ -5100,12 +4703,12 @@ int mysql_create_table_no_lock(THD *thd, const LEX_CSTRING *orig_db, } lex_string_set3(&cpath, path, path_length); - res= create_table_impl(thd, *orig_db, *orig_table_name, *db, *table_name, - cpath, *create_info, create_info, alter_info, - create_table_mode, is_trans, ¬_used_1, ¬_used_2, - frm); - if (frm == &frm_local) - my_free(const_cast(frm_local.str)); + res= create_table_impl(thd, ddl_log_state_create, ddl_log_state_rm, + *db, *table_name, *db, *table_name, cpath, + *create_info, create_info, + alter_info, create_table_mode, + is_trans, ¬_used_1, ¬_used_2, &frm); + my_free(const_cast(frm.str)); if (!res && create_info->sequence) { @@ -5120,7 +4723,8 @@ int mysql_create_table_no_lock(THD *thd, const LEX_CSTRING *orig_db, DBUG_ASSERT(thd->is_error()); /* Drop the table as it wasn't completely done */ if (!mysql_rm_table_no_locks(thd, table_list, &thd->db, - NULL, 1, + (DDL_LOG_STATE*) 0, + 1, create_info->tmp_table(), false, true /* Sequence*/, true /* Don't log_query */, @@ -5161,9 +4765,7 @@ bool mysql_create_table(THD *thd, TABLE_LIST *create_table, int create_table_mode; uint save_thd_create_info_options; bool is_trans= FALSE; - int result; - TABLE_LIST *orig_table= create_table; - const bool atomic_replace= create_info->is_atomic_replace(); + bool result; DBUG_ENTER("mysql_create_table"); DBUG_ASSERT(create_info->default_table_charset); @@ -5172,8 +4774,6 @@ bool mysql_create_table(THD *thd, TABLE_LIST *create_table, bzero(&ddl_log_state_create, sizeof(ddl_log_state_create)); bzero(&ddl_log_state_rm, sizeof(ddl_log_state_rm)); - create_info->ddl_log_state_create= &ddl_log_state_create; - create_info->ddl_log_state_rm= &ddl_log_state_rm; /* Copy temporarily the statement flags to thd for lock_table_names() */ save_thd_create_info_options= thd->lex->create_info.options; @@ -5202,7 +4802,6 @@ bool mysql_create_table(THD *thd, TABLE_LIST *create_table, if ((create_info->table= create_table->table)) { pos_in_locked_tables= create_info->table->pos_in_locked_tables; - create_info->pos_in_locked_tables= pos_in_locked_tables; mdl_ticket= create_table->table->mdl_ticket; } @@ -5220,33 +4819,42 @@ bool mysql_create_table(THD *thd, TABLE_LIST *create_table, /* We can abort create table for any table type */ thd->abort_on_warning= thd->is_strict_mode(); - if (atomic_replace && - create_info->make_tmp_table_list(thd, &create_table, &create_table_mode)) + if (mysql_create_table_no_lock(thd, &ddl_log_state_create, &ddl_log_state_rm, + &create_table->db, &create_table->table_name, + create_info, alter_info, &is_trans, + create_table_mode, create_table) > 0) { result= 1; goto err; } - if (mysql_create_table_no_lock(thd, - &orig_table->db, - &orig_table->table_name, - &create_table->db, - &create_table->table_name, create_info, - alter_info, - &is_trans, create_table_mode, - create_table) > 0) + /* + Check if we are doing CREATE OR REPLACE TABLE under LOCK TABLES + on a non temporary table + */ + if (thd->locked_tables_mode && pos_in_locked_tables && + create_info->or_replace()) { - result= 1; - goto err; + DBUG_ASSERT(thd->variables.option_bits & OPTION_TABLE_LOCK); + /* + Add back the deleted table and re-created table as a locked table + This should always work as we have a meta lock on the table. + */ + thd->locked_tables_list.add_back_last_deleted_lock(pos_in_locked_tables); + if (thd->locked_tables_list.reopen_tables(thd, false)) + { + thd->locked_tables_list.unlink_all_closed_tables(thd, NULL, 0); + result= 1; + goto err; + } + else + { + TABLE *table= pos_in_locked_tables->table; + table->mdl_ticket->downgrade_lock(MDL_SHARED_NO_READ_WRITE); + } } err: - if (atomic_replace) - { - create_table= orig_table; - create_info->table= orig_table->table; - } - thd->abort_on_warning= 0; /* In RBR or readonly server we don't need to log CREATE TEMPORARY TABLE */ @@ -5259,8 +4867,6 @@ err: if (create_info->tmp_table()) thd->transaction->stmt.mark_created_temp_table(); - else if (!result && atomic_replace) - result= create_info->finalize_atomic_replace(thd, orig_table); /* Write log if no error or if we already deleted a table */ if (!result || thd->log_current_statement()) @@ -5281,16 +4887,12 @@ err: we should log a delete of it. If create_info->table was not set, it's a normal table and table_creation_was_logged will be set when the share is created. - - NOTE: this is only needed for non-atomic CREATE OR REPLACE and - CREATE TEMPORARY TABLE. */ - DBUG_ASSERT(!atomic_replace); create_info->table->s->table_creation_was_logged= 1; } thd->binlog_xid= thd->query_id; ddl_log_update_xid(&ddl_log_state_create, thd->binlog_xid); - if (ddl_log_state_rm.is_active() && !atomic_replace) + if (ddl_log_state_rm.is_active()) ddl_log_update_xid(&ddl_log_state_rm, thd->binlog_xid); debug_crash_here("ddl_log_create_before_binlog"); if (unlikely(write_bin_log(thd, result ? FALSE : TRUE, thd->query(), @@ -5309,25 +4911,11 @@ err: ddl_log.org_database= create_table->db; ddl_log.org_table= create_table->table_name; ddl_log.org_table_id= create_info->tabledef_version; - if (create_info->drop_entry.query.length) - { - DBUG_ASSERT(atomic_replace); - backup_log_ddl(&create_info->drop_entry); - } backup_log_ddl(&ddl_log); } } - - create_info->finalize_ddl(thd, result); - - /* - Check if we are doing CREATE OR REPLACE TABLE under LOCK TABLES - on a non temporary table - */ - if (thd->locked_tables_mode && pos_in_locked_tables && - create_info->or_replace()) - result|= (int) create_info->finalize_locked_tables(thd, result); - + ddl_log_complete(&ddl_log_state_rm); + ddl_log_complete(&ddl_log_state_create); DBUG_RETURN(result); } @@ -5635,15 +5223,10 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, bool src_table_exists= FALSE; uint not_used; int create_res; - TABLE_LIST *orig_table= table; - const bool atomic_replace= create_info->is_atomic_replace(); - int create_table_mode= C_ORDINARY_CREATE; DBUG_ENTER("mysql_create_like_table"); bzero(&ddl_log_state_create, sizeof(ddl_log_state_create)); bzero(&ddl_log_state_rm, sizeof(ddl_log_state_rm)); - local_create_info.ddl_log_state_create= &ddl_log_state_create; - local_create_info.ddl_log_state_rm= &ddl_log_state_rm; #ifdef WITH_WSREP if (WSREP(thd) && !thd->wsrep_applier && @@ -5752,22 +5335,14 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, /* The following is needed only in case of lock tables */ if ((local_create_info.table= thd->lex->query_tables->table)) - { - pos_in_locked_tables= local_create_info.table->pos_in_locked_tables; - local_create_info.pos_in_locked_tables= pos_in_locked_tables; - } - - if (atomic_replace && - local_create_info.make_tmp_table_list(thd, &table, &create_table_mode)) - goto err; + pos_in_locked_tables= local_create_info.table->pos_in_locked_tables; res= ((create_res= mysql_create_table_no_lock(thd, - &orig_table->db, - &orig_table->table_name, + &ddl_log_state_create, &ddl_log_state_rm, &table->db, &table->table_name, &local_create_info, &local_alter_info, - &is_trans, create_table_mode, + &is_trans, C_ORDINARY_CREATE, table)) > 0); /* Remember to log if we deleted something */ do_logging= thd->log_current_statement(); @@ -5775,18 +5350,46 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, goto err; /* - Ensure that we have an exclusive lock on target table if we are creating - non-temporary table. We don't have or need the lock if the create failed - because of existing table when using "if exists". + Check if we are doing CREATE OR REPLACE TABLE under LOCK TABLES + on a non temporary table */ - DBUG_ASSERT((thd->locked_tables_mode && pos_in_locked_tables && - create_info->or_replace()) || atomic_replace || - (create_info->tmp_table()) || create_res < 0 || - thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, - table->table_name.str, - MDL_EXCLUSIVE) || - (thd->locked_tables_mode && pos_in_locked_tables && - create_info->if_not_exists())); + if (thd->locked_tables_mode && pos_in_locked_tables && + create_info->or_replace()) + { + /* + Add back the deleted table and re-created table as a locked table + This should always work as we have a meta lock on the table. + */ + thd->locked_tables_list.add_back_last_deleted_lock(pos_in_locked_tables); + if (thd->locked_tables_list.reopen_tables(thd, false)) + { + thd->locked_tables_list.unlink_all_closed_tables(thd, NULL, 0); + res= 1; // We got an error + } + else + { + /* + Get pointer to the newly opened table. We need this to ensure we + don't reopen the table when doing statment logging below. + */ + table->table= pos_in_locked_tables->table; + table->table->mdl_ticket->downgrade_lock(MDL_SHARED_NO_READ_WRITE); + } + } + else + { + /* + Ensure that we have an exclusive lock on target table if we are creating + non-temporary table. We don't have or need the lock if the create failed + because of existing table when using "if exists". + */ + DBUG_ASSERT((create_info->tmp_table()) || create_res < 0 || + thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, + table->table_name.str, + MDL_EXCLUSIVE) || + (thd->locked_tables_mode && pos_in_locked_tables && + create_info->if_not_exists())); + } DEBUG_SYNC(thd, "create_table_like_before_binlog"); @@ -5811,20 +5414,10 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, if (thd->is_current_stmt_binlog_format_row() || force_generated_create) { /* - The logging for CREATE .. LIKE is a bit different from normal - create as we want in statement-based logging use the original statement. - - Generated statement means the CREATE TABLE statement without LIKE. Same - thing we do with CREATE .. SELECT in row based logging. It is needed to - get replication working if the original table didn't exists. - - However as an engine can change a table definition, it is probly better to - use CREATE TABLE instead of LIKE to ensure the table definition will be - same on both side. (This is just a guess). - - Since temporary tables are not replicated under row-based replication, - CREATE TABLE .. LIKE needs special treatment. We have some cases to - consider, according to the following decision table: + Since temporary tables are not replicated under row-based + replication, CREATE TABLE ... LIKE ... needs special + treatement. We have some cases to consider, according to the + following decision table: ==== ========= ========= ============================== Case Target Source Write to binary log @@ -5848,7 +5441,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, query.length(0); // Have to zero it since constructor doesn't Open_table_context ot_ctx(thd, MYSQL_OPEN_REOPEN | MYSQL_OPEN_IGNORE_KILLED); - bool opened_new_table= FALSE; // Whether newly created table is open. + bool new_table= FALSE; // Whether newly created table is open. if (create_res != 0) { @@ -5867,22 +5460,6 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, save_open_strategy= table->open_strategy; table->open_strategy= TABLE_LIST::OPEN_NORMAL; - if (atomic_replace) - { - /* - NOTE: We acquire explicit lock for temporary table just to make - close_thread_table() happy. We open it like a normal table - because it's too complex to open it like tmp_table here. - */ - table->mdl_request.duration= MDL_EXPLICIT; - if (thd->mdl_context.acquire_lock(&table->mdl_request, - thd->variables.lock_wait_timeout)) - { - res= 1; - goto err; - } - } - /* In order for show_create_table() to work we need to open destination table if it is not already open (i.e. if it @@ -5899,7 +5476,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, res= 1; goto err; } - opened_new_table= TRUE; + new_table= TRUE; } /* We have to re-test if the table was a view as the view may not @@ -5922,52 +5499,26 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, */ create_info->used_fields|= HA_CREATE_USED_ENGINE; - const LEX_CSTRING *const db= - table->schema_table ? &INFORMATION_SCHEMA_NAME : &orig_table->db; - const char *force_db= NULL; - if (!thd->db.str || cmp(db, &thd->db)) - force_db= db->str; - int result __attribute__((unused))= - show_create_table_ex(thd, table, - force_db, orig_table->table_name.str, - &query, create_info, WITH_DB_NAME); + show_create_table(thd, table, &query, create_info, WITH_DB_NAME); DBUG_ASSERT(result == 0); // show_create_table() always return 0 do_logging= FALSE; - - thd->binlog_xid= thd->query_id; - ddl_log_update_xid(&ddl_log_state_create, thd->binlog_xid); - if (ddl_log_state_rm.is_active() && !atomic_replace) - ddl_log_update_xid(&ddl_log_state_rm, thd->binlog_xid); - debug_crash_here("ddl_log_create_before_binlog"); - if (write_bin_log(thd, TRUE, query.ptr(), query.length())) { res= 1; - thd->binlog_xid= 0; goto err; } - debug_crash_here("ddl_log_create_after_binlog"); - thd->binlog_xid= 0; - - if (opened_new_table) + if (new_table) { DBUG_ASSERT(thd->open_tables == table->table); /* When opening the table, we ignored the locked tables (MYSQL_OPEN_GET_NEW_TABLE). Now we can close the table without risking to close some locked table. - - For atomic_replace we must remove TABLE and TABLE_SHARE - from cache since they are the objects for temporary table. */ - if (atomic_replace) - table->table->s->tdc->flushed= true; close_thread_table(thd, &thd->open_tables); - if (atomic_replace) - thd->mdl_context.release_lock(table->mdl_request.ticket); } } } @@ -5991,11 +5542,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, /* Remember that tmp table creation was logged so that we know if we should log a delete of it. - - NOTE: this is only needed for non-atomic CREATE OR REPLACE and - CREATE TEMPORARY TABLE. */ - DBUG_ASSERT(!atomic_replace); local_create_info.table->s->table_creation_was_logged= 1; } } @@ -6003,26 +5550,13 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, } err: - if (atomic_replace) - { - table= orig_table; - local_create_info.table= orig_table->table; - - if (!res) - { - res= local_create_info.finalize_atomic_replace(thd, orig_table); - if (res) - do_logging= false; - } - } - if (do_logging) { thd->binlog_xid= thd->query_id; ddl_log_update_xid(&ddl_log_state_create, thd->binlog_xid); - if (ddl_log_state_rm.is_active() && !atomic_replace) + if (ddl_log_state_rm.is_active()) ddl_log_update_xid(&ddl_log_state_rm, thd->binlog_xid); - debug_crash_here("ddl_log_create_before_binlog"); + debug_crash_here("ddl_log_create_before_binlog"); if (res && create_info->table_was_deleted) { /* @@ -6030,7 +5564,6 @@ err: We have to log it. */ DBUG_ASSERT(ddl_log_state_rm.is_active()); - DBUG_ASSERT(!atomic_replace); log_drop_table(thd, &table->db, &table->table_name, &create_info->org_storage_engine_name, create_info->db_type == partition_hton, @@ -6056,24 +5589,11 @@ err: ddl_log.org_database= table->db; ddl_log.org_table= table->table_name; ddl_log.org_table_id= local_create_info.tabledef_version; - if (local_create_info.drop_entry.query.length) - { - DBUG_ASSERT(atomic_replace); - backup_log_ddl(&local_create_info.drop_entry); - } backup_log_ddl(&ddl_log); } - local_create_info.finalize_ddl(thd, res); - - /* - Check if we are doing CREATE OR REPLACE TABLE under LOCK TABLES - on a non temporary table - */ - if (thd->locked_tables_mode && pos_in_locked_tables && - create_info->or_replace()) - res|= (int) local_create_info.finalize_locked_tables(thd, res); - + ddl_log_complete(&ddl_log_state_rm); + ddl_log_complete(&ddl_log_state_create); DBUG_RETURN(res != 0); } @@ -9981,8 +9501,7 @@ simple_rename_or_index_change(THD *thd, TABLE_LIST *table_list, (void) ddl_log_rename_table(&ddl_log_state, old_db_type, &alter_ctx->db, &alter_ctx->table_name, - &alter_ctx->new_db, &alter_ctx->new_alias, - DDL_RENAME_PHASE_TABLE, 0); + &alter_ctx->new_db, &alter_ctx->new_alias); if (mysql_rename_table(old_db_type, &alter_ctx->db, &alter_ctx->table_name, &alter_ctx->new_db, &alter_ctx->new_alias, &table_version, 0)) @@ -10614,8 +10133,7 @@ bool mysql_alter_table(THD *thd, const LEX_CSTRING *new_db, on the name, now we can safely try to find out for sure. */ if (!(alter_info->partition_flags & ALTER_PARTITION_CONVERT_IN) && - ha_table_exists(thd, &alter_ctx.new_db, &alter_ctx.new_name, - NULL, NULL, NULL, NULL, 0)) + ha_table_exists(thd, &alter_ctx.new_db, &alter_ctx.new_name)) { /* Table will be closed in do_command() */ my_error(ER_TABLE_EXISTS_ERROR, MYF(0), alter_ctx.new_alias.str); @@ -11081,7 +10599,8 @@ do_continue:; Partitioning: part_info is passed via thd->work_part_info */ - error= create_table_impl(thd, alter_ctx.db, alter_ctx.table_name, + error= create_table_impl(thd, (DDL_LOG_STATE*) 0, (DDL_LOG_STATE*) 0, + alter_ctx.db, alter_ctx.table_name, alter_ctx.new_db, alter_ctx.tmp_name, alter_ctx.get_tmp_cstring_path(), thd->lex->create_info, create_info, alter_info, diff --git a/sql/sql_table.h b/sql/sql_table.h index 2cead6fa683..c9e4d969482 100644 --- a/sql/sql_table.h +++ b/sql/sql_table.h @@ -27,10 +27,8 @@ class Alter_info; class Alter_table_ctx; -struct Atomic_info; class Column_definition; class Create_field; -struct Table_name; struct TABLE_LIST; class THD; struct TABLE; @@ -96,15 +94,50 @@ uint build_tmptable_filename(THD* thd, char *buff, size_t bufflen); bool add_keyword_to_query(THD *thd, String *result, const LEX_CSTRING *keyword, const LEX_CSTRING *add); +/* + mysql_create_table_no_lock can be called in one of the following + mutually exclusive situations: + + - Just a normal ordinary CREATE TABLE statement that explicitly + defines the table structure. + + - CREATE TABLE ... SELECT. It is special, because only in this case, + the list of fields is allowed to have duplicates, as long as one of the + duplicates comes from the select list, and the other doesn't. For + example in + + CREATE TABLE t1 (a int(5) NOT NUL) SELECT b+10 as a FROM t2; + + the list in alter_info->create_list will have two fields `a`. + + - ALTER TABLE, that creates a temporary table #sql-xxx, which will be later + renamed to replace the original table. + + - ALTER TABLE as above, but which only modifies the frm file, it only + creates an frm file for the #sql-xxx, the table in the engine is not + created. + + - Assisted discovery, CREATE TABLE statement without the table structure. + + These situations are distinguished by the following "create table mode" + values, where a CREATE ... SELECT is denoted by any non-negative number + (which should be the number of fields in the SELECT ... part), and other + cases use constants as defined below. +*/ +#define C_CREATE_SELECT(X) ((X) > 0 ? (X) : 0) +#define C_ORDINARY_CREATE 0 +#define C_ALTER_TABLE -1 +#define C_ALTER_TABLE_FRM_ONLY -2 +#define C_ASSISTED_DISCOVERY -3 + int mysql_create_table_no_lock(THD *thd, - const LEX_CSTRING *orig_db, - const LEX_CSTRING *orig_table_name, + DDL_LOG_STATE *ddl_log_state, + DDL_LOG_STATE *ddl_log_state_rm, const LEX_CSTRING *db, const LEX_CSTRING *table_name, Table_specification_st *create_info, Alter_info *alter_info, bool *is_trans, - int create_table_mode, TABLE_LIST *table, - LEX_CUSTRING *frm= NULL); + int create_table_mode, TABLE_LIST *table); handler *mysql_create_frm_image(THD *thd, const LEX_CSTRING &db, @@ -138,31 +171,6 @@ bool mysql_compare_tables(TABLE *table, HA_CREATE_INFO *create_info, bool *metadata_equal); bool mysql_recreate_table(THD *thd, TABLE_LIST *table_list, bool table_copy); -/** - Parameters for rename_table_and_triggers() -*/ -struct rename_param -{ - LEX_CSTRING old_alias, new_alias; - LEX_CUSTRING old_version; - handlerton *from_table_hton; - int rename_flags; /* FN_FROM_IS_TMP, FN_TO_IS_TMP, etc */ - rename_param() : - from_table_hton(NULL), - rename_flags(0) {} -}; -bool -rename_table_and_triggers(THD *thd, rename_param *param, - DDL_LOG_STATE *ddl_log_state, - Table_name *ren_table, const LEX_CSTRING *new_db, - bool skip_error, bool *force_if_exists); -int -rename_check_preconditions(THD *thd, rename_param *param, - Table_name *ren_table, - const LEX_CSTRING *new_db, - const LEX_CSTRING *new_table_name, - const LEX_CSTRING *new_table_alias, - bool if_exists); bool mysql_rename_table(handlerton *base, const LEX_CSTRING *old_db, const LEX_CSTRING *old_name, const LEX_CSTRING *new_db, const LEX_CSTRING *new_name, LEX_CUSTRING *id, diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index 81dcda8b39f..067b921eaf3 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -1200,11 +1200,9 @@ bool Trigger::add_to_file_list(void* param_arg) */ static bool rm_trigger_file(char *path, const LEX_CSTRING *db, - const LEX_CSTRING *table_name, uint flags, - myf MyFlags) + const LEX_CSTRING *table_name, myf MyFlags) { - build_table_filename(path, FN_REFLEN - 1, db->str, table_name->str, TRG_EXT, - flags); + build_table_filename(path, FN_REFLEN-1, db->str, table_name->str, TRG_EXT, 0); return mysql_file_delete(key_file_trg, path, MyFlags); } @@ -1246,8 +1244,7 @@ bool rm_trigname_file(char *path, const LEX_CSTRING *db, */ bool Table_triggers_list::save_trigger_file(THD *thd, const LEX_CSTRING *db, - const LEX_CSTRING *table_name, - uint flags) + const LEX_CSTRING *table_name) { char file_buff[FN_REFLEN]; LEX_CSTRING file; @@ -1257,7 +1254,7 @@ bool Table_triggers_list::save_trigger_file(THD *thd, const LEX_CSTRING *db, DBUG_RETURN(true); file.length= build_table_filename(file_buff, FN_REFLEN - 1, db->str, table_name->str, - TRG_EXT, flags); + TRG_EXT, 0); file.str= file_buff; DBUG_RETURN(sql_create_definition_file(NULL, &file, &triggers_file_type, (uchar*) this, @@ -1367,12 +1364,12 @@ bool Table_triggers_list::drop_trigger(THD *thd, TABLE_LIST *tables, drop or create ddl_log recovery will ensure that all related trigger files are deleted or the original ones are restored. */ - if (rm_trigger_file(path, &tables->db, &tables->table_name, 0, MYF(MY_WME))) + if (rm_trigger_file(path, &tables->db, &tables->table_name, MYF(MY_WME))) goto err; } else { - if (save_trigger_file(thd, &tables->db, &tables->table_name, 0)) + if (save_trigger_file(thd, &tables->db, &tables->table_name)) goto err; } @@ -1531,8 +1528,7 @@ bool Table_triggers_list::prepare_record_accessors(TABLE *table) bool Table_triggers_list::check_n_load(THD *thd, const LEX_CSTRING *db, const LEX_CSTRING *table_name, TABLE *table, - bool names_only, - uint flags) + bool names_only) { char path_buff[FN_REFLEN]; LEX_CSTRING path; @@ -1541,7 +1537,7 @@ bool Table_triggers_list::check_n_load(THD *thd, const LEX_CSTRING *db, DBUG_ENTER("Table_triggers_list::check_n_load"); path.length= build_table_filename(path_buff, FN_REFLEN - 1, - db->str, table_name->str, TRG_EXT, flags); + db->str, table_name->str, TRG_EXT, 0); path.str= path_buff; // QQ: should we analyze errno somehow ? @@ -2038,7 +2034,7 @@ bool add_table_for_trigger(THD *thd, bool Table_triggers_list::drop_all_triggers(THD *thd, const LEX_CSTRING *db, const LEX_CSTRING *name, - uint flags, myf MyFlags) + myf MyFlags) { TABLE table; char path[FN_REFLEN]; @@ -2049,11 +2045,11 @@ bool Table_triggers_list::drop_all_triggers(THD *thd, const LEX_CSTRING *db, init_sql_alloc(key_memory_Table_trigger_dispatcher, &table.mem_root, 8192, 0, MYF(MY_WME)); - if (Table_triggers_list::check_n_load(thd, db, name, &table, true, flags)) + if (Table_triggers_list::check_n_load(thd, db, name, &table, 1)) { result= 1; /* We couldn't parse trigger file, best to just remove it */ - rm_trigger_file(path, db, name, flags, MyFlags); + rm_trigger_file(path, db, name, MyFlags); goto end; } if (table.triggers) @@ -2087,7 +2083,7 @@ bool Table_triggers_list::drop_all_triggers(THD *thd, const LEX_CSTRING *db, } } } - if (rm_trigger_file(path, db, name, flags, MyFlags)) + if (rm_trigger_file(path, db, name, MyFlags)) result= 1; delete table.triggers; } @@ -2129,8 +2125,7 @@ change_table_name_in_triggers(THD *thd, const LEX_CSTRING *old_db_name, const LEX_CSTRING *new_db_name, const LEX_CSTRING *old_table_name, - const LEX_CSTRING *new_table_name, - uint flags) + const LEX_CSTRING *new_table_name) { struct change_table_name_param param; sql_mode_t save_sql_mode= thd->variables.sql_mode; @@ -2146,15 +2141,13 @@ change_table_name_in_triggers(THD *thd, if (unlikely(thd->is_fatal_error)) return TRUE; /* OOM */ - if (save_trigger_file(thd, new_db_name, new_table_name, - (flags & FN_TO_IS_TMP))) + if (save_trigger_file(thd, new_db_name, new_table_name)) return TRUE; - if (rm_trigger_file(path_buff, old_db_name, old_table_name, - (flags & FN_FROM_IS_TMP), MYF(MY_WME))) + if (rm_trigger_file(path_buff, old_db_name, old_table_name, MYF(MY_WME))) { (void) rm_trigger_file(path_buff, new_db_name, new_table_name, - (flags & FN_TO_IS_TMP), MYF(MY_WME)); + MYF(MY_WME)); return TRUE; } return FALSE; @@ -2304,8 +2297,7 @@ Table_triggers_list::prepare_for_rename(THD *thd, my_strcasecmp(table_alias_charset, old_alias->str, new_table->str)); - if (Table_triggers_list::check_n_load(thd, db, old_table, table, TRUE, - param->rename_flags)) + if (Table_triggers_list::check_n_load(thd, db, old_table, table, TRUE)) { result= 1; goto end; @@ -2392,17 +2384,15 @@ bool Table_triggers_list::change_table_name(THD *thd, This method interfaces the mysql server code protected by an exclusive metadata lock. */ - DBUG_ASSERT((param->rename_flags & FN_FROM_IS_TMP) || - thd->mdl_context.is_lock_owner(MDL_key::TABLE, db->str, + DBUG_ASSERT(thd->mdl_context.is_lock_owner(MDL_key::TABLE, db->str, old_table->str, MDL_EXCLUSIVE)); if (table->triggers) { - if (unlikely(table->triggers-> - change_table_name_in_triggers(thd, db, new_db, old_alias, - new_table, - param->rename_flags))) + if (unlikely(table->triggers->change_table_name_in_triggers(thd, db, new_db, + old_alias, + new_table))) { result= 1; goto end; @@ -2420,9 +2410,9 @@ bool Table_triggers_list::change_table_name(THD *thd, (void) table->triggers->change_table_name_in_trignames( upgrading50to51 ? new_db : NULL, db, old_alias, err_trigger); - (void) table->triggers-> - change_table_name_in_triggers(thd, db, new_db, new_table, old_alias, - (param->rename_flags ^ FN_IS_TMP)); + (void) table->triggers->change_table_name_in_triggers( + thd, db, new_db, + new_table, old_alias); result= 1; goto end; } diff --git a/sql/sql_trigger.h b/sql/sql_trigger.h index d1aaa970289..774dca7cba1 100644 --- a/sql/sql_trigger.h +++ b/sql/sql_trigger.h @@ -3,7 +3,7 @@ /* Copyright (c) 2004, 2011, Oracle and/or its affiliates. - Copyright (c) 2017, 2022, MariaDB Corporation. + Copyright (c) 2017, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -89,12 +89,10 @@ public: TABLE table; bool upgrading50to51; bool got_error; - int rename_flags; TRIGGER_RENAME_PARAM() { upgrading50to51= got_error= 0; - rename_flags= 0; table.reset(); } ~TRIGGER_RENAME_PARAM() @@ -257,14 +255,12 @@ public: bool old_row_is_record1); void empty_lists(); bool create_lists_needed_for_files(MEM_ROOT *root); - bool save_trigger_file(THD *thd, const LEX_CSTRING *db, - const LEX_CSTRING *table_name, uint flags); + bool save_trigger_file(THD *thd, const LEX_CSTRING *db, const LEX_CSTRING *table_name); static bool check_n_load(THD *thd, const LEX_CSTRING *db, const LEX_CSTRING *table_name, - TABLE *table, bool names_only, uint flags); + TABLE *table, bool names_only); static bool drop_all_triggers(THD *thd, const LEX_CSTRING *db, - const LEX_CSTRING *table_name, uint flags, - myf MyFlags); + const LEX_CSTRING *table_name, myf MyFlags); static bool prepare_for_rename(THD *thd, TRIGGER_RENAME_PARAM *param, const LEX_CSTRING *db, const LEX_CSTRING *old_alias, @@ -337,8 +333,7 @@ private: const LEX_CSTRING *old_db_name, const LEX_CSTRING *new_db_name, const LEX_CSTRING *old_table_name, - const LEX_CSTRING *new_table_name, - uint flags); + const LEX_CSTRING *new_table_name); bool check_for_broken_triggers() { diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc index 283714bdd1b..a0ef89ff0f5 100644 --- a/sql/sql_truncate.cc +++ b/sql/sql_truncate.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2010, 2015, Oracle and/or its affiliates. - Copyright (c) 2012, 2022, MariaDB + Copyright (c) 2012, 2018, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -116,18 +116,18 @@ static const char *fk_info_str(THD *thd, FOREIGN_KEY_INFO *fk_info) error was emitted. */ -bool -TABLE::referenced_by_foreign_table(THD *thd, FOREIGN_KEY_INFO **fk_info) const +static bool +fk_truncate_illegal_if_parent(THD *thd, TABLE *table) { + FOREIGN_KEY_INFO *fk_info; List fk_list; List_iterator_fast it; - *fk_info= NULL; /* Bail out early if the table is not referenced by a foreign key. In this case, the table could only be, if at all, a child table. */ - if (! file->referenced_by_foreign_key()) + if (! table->file->referenced_by_foreign_key()) return FALSE; /* @@ -136,7 +136,7 @@ TABLE::referenced_by_foreign_table(THD *thd, FOREIGN_KEY_INFO **fk_info) const of foreign keys referencing this table in order to check the name of the child (dependent) tables. */ - file->get_parent_foreign_key_list(thd, &fk_list); + table->file->get_parent_foreign_key_list(thd, &fk_list); /* Out of memory when building list. */ if (unlikely(thd->is_error())) @@ -145,22 +145,25 @@ TABLE::referenced_by_foreign_table(THD *thd, FOREIGN_KEY_INFO **fk_info) const it.init(fk_list); /* Loop over the set of foreign keys for which this table is a parent. */ - while ((*fk_info= it++)) + while ((fk_info= it++)) { - if (lex_string_cmp(system_charset_info, (*fk_info)->referenced_db, - &s->db) || - lex_string_cmp(system_charset_info, (*fk_info)->referenced_table, - &s->table_name) || - lex_string_cmp(system_charset_info, (*fk_info)->foreign_db, - &s->db) || - lex_string_cmp(system_charset_info, (*fk_info)->foreign_table, - &s->table_name)) + if (lex_string_cmp(system_charset_info, fk_info->referenced_db, + &table->s->db) || + lex_string_cmp(system_charset_info, fk_info->referenced_table, + &table->s->table_name) || + lex_string_cmp(system_charset_info, fk_info->foreign_db, + &table->s->db) || + lex_string_cmp(system_charset_info, fk_info->foreign_table, + &table->s->table_name)) break; } /* Table is parent in a non-self-referencing foreign key. */ - if (*fk_info) - return TRUE; /* tested by main.trigger-trans */ + if (fk_info) + { + my_error(ER_TRUNCATE_ILLEGAL_FK, MYF(0), fk_info_str(thd, fk_info)); + return TRUE; + } return FALSE; } @@ -190,7 +193,6 @@ Sql_cmd_truncate_table::handler_truncate(THD *thd, TABLE_LIST *table_ref, int error= 0; uint flags= 0; TABLE *table; - FOREIGN_KEY_INFO *fk_info; DBUG_ENTER("Sql_cmd_truncate_table::handler_truncate"); /* @@ -231,13 +233,8 @@ Sql_cmd_truncate_table::handler_truncate(THD *thd, TABLE_LIST *table_ref, /* Whether to truncate regardless of foreign keys. */ if (! (thd->variables.option_bits & OPTION_NO_FOREIGN_KEY_CHECKS)) - if (table_ref->table->referenced_by_foreign_table(thd, &fk_info)) - { - /* Table is parent in a non-self-referencing foreign key. */ - if (fk_info) - my_error(ER_TRUNCATE_ILLEGAL_FK, MYF(0), fk_info_str(thd, fk_info)); + if (fk_truncate_illegal_if_parent(thd, table_ref->table)) DBUG_RETURN(TRUNCATE_FAILED_SKIP_BINLOG); - } table= table_ref->table; diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 2334cd747e6..689f01c26d8 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1101,8 +1101,7 @@ loop_out: fn_format(path_buff, file.str, dir.str, "", MY_UNPACK_FILENAME); path.length= strlen(path_buff); - if (ha_table_exists(thd, &view->db, &view->table_name, - NULL, NULL, NULL, NULL, 0)) + if (ha_table_exists(thd, &view->db, &view->table_name)) { old_view_exists= 1; if (lex->create_info.if_not_exists()) diff --git a/sql/structs.h b/sql/structs.h index 1c3873196da..b36f8e6a1a0 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -2,7 +2,7 @@ #define STRUCTS_INCLUDED /* Copyright (c) 2000, 2010, Oracle and/or its affiliates. - Copyright (c) 2009, 2022, MariaDB Corporation. + Copyright (c) 2009, 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1016,14 +1016,4 @@ public: }; -struct Table_name -{ - LEX_CSTRING db; - LEX_CSTRING table_name; - LEX_CSTRING alias; - bool is_set() const - { - return table_name.str; - } -}; #endif /* STRUCTS_INCLUDED */ diff --git a/sql/table.cc b/sql/table.cc index cf1c6e6b3b6..d5f5d617e94 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -3723,13 +3723,6 @@ bool TABLE::vcol_fix_expr(THD *thd) return false; } - if (!thd->Item_change_list::is_empty()) - { - DBUG_ASSERT(!saved_change_list); - saved_change_list= new Item_change_list; - thd->move_elements_to(saved_change_list); - } - Vcol_expr_context expr_ctx(thd, this); if (expr_ctx.init()) return true; @@ -3750,12 +3743,7 @@ error: bool TABLE::vcol_cleanup_expr(THD *thd) { if (vcol_refix_list.is_empty()) - { - DBUG_ASSERT(!saved_change_list); return false; - } - - thd->rollback_item_tree_changes(); List_iterator it(vcol_refix_list); bool result= false; @@ -3763,15 +3751,6 @@ bool TABLE::vcol_cleanup_expr(THD *thd) while (Virtual_column_info *vcol= it++) result|= vcol->cleanup_session_expr(); - if (saved_change_list) - { - DBUG_ASSERT(!vcol_refix_list.is_empty()); - DBUG_ASSERT(!saved_change_list->is_empty()); - saved_change_list->move_elements_to(thd); - delete saved_change_list; - saved_change_list= NULL; - } - DBUG_ASSERT(!result || thd->get_stmt_da()->is_error()); return result; } diff --git a/sql/table.h b/sql/table.h index 482503828b1..3aabee9a087 100644 --- a/sql/table.h +++ b/sql/table.h @@ -35,7 +35,6 @@ #include "sql_i_s.h" #include "sql_type.h" /* vers_kind_t */ #include "privilege.h" /* privilege_t */ -#include "structs.h" /* Buffer for unix timestamp in microseconds: @@ -54,7 +53,6 @@ class Item; /* Needed by ORDER */ typedef Item (*Item_ptr); -class Item_change_list; class Item_subselect; class Item_field; class GRANT_TABLE; @@ -93,7 +91,6 @@ typedef ulonglong nested_join_map; #define tmp_file_prefix "#sql" /**< Prefix for tmp tables */ #define tmp_file_prefix_length 4 -#define backup_file_prefix tmp_file_prefix "-backup-" #define TMP_TABLE_KEY_EXTRA 8 /** @@ -354,7 +351,6 @@ typedef struct st_grant_info enum tmp_table_type { - TMP_TABLE_ATOMIC_REPLACE= -1, NO_TMP_TABLE= 0, NON_TRANSACTIONAL_TMP_TABLE, TRANSACTIONAL_TMP_TABLE, INTERNAL_TMP_TABLE, SYSTEM_TMP_TABLE }; @@ -724,13 +720,12 @@ public: void abort_stats_load() { stats_state.abort_load(); } }; - /** This structure is shared between different table objects. There is one instance of table share per one table in the database. */ -struct TABLE_SHARE: public Table_name +struct TABLE_SHARE { TABLE_SHARE() {} /* Remove gcc warning */ @@ -780,6 +775,8 @@ struct TABLE_SHARE: public Table_name To ensure this one can use set_table_cache() methods. */ LEX_CSTRING table_cache_key; + LEX_CSTRING db; /* Pointer to db */ + LEX_CSTRING table_name; /* Table name (for open) */ LEX_CSTRING path; /* Path to .frm file (from datadir) */ LEX_CSTRING normalized_path; /* unpack_filename(path) */ LEX_CSTRING connect_string; @@ -1527,7 +1524,6 @@ public: bool get_fields_in_item_tree; /* Signal to fix_field */ List vcol_refix_list; private: - Item_change_list *saved_change_list; bool m_needs_reopen; bool created; /* For tmp tables. TRUE <=> tmp table was actually created.*/ public: @@ -1846,7 +1842,6 @@ public: /* Used in DELETE, DUP REPLACE and insert history row */ void vers_update_end(); void find_constraint_correlated_indexes(); - bool referenced_by_foreign_table(THD *thd, FOREIGN_KEY_INFO **fk_info) const; /** Number of additional fields used in versioned tables */ #define VERSIONING_FIELDS 2 @@ -2212,8 +2207,7 @@ struct TABLE_CHAIN void set_end_pos(TABLE_LIST **pos) { end_pos= pos; } }; - -struct TABLE_LIST: public Table_name +struct TABLE_LIST { TABLE_LIST() {} /* Remove gcc warning */ @@ -2300,7 +2294,10 @@ struct TABLE_LIST: public Table_name TABLE_LIST *next_local; /* link in a global list of all queries tables */ TABLE_LIST *next_global, **prev_global; + LEX_CSTRING db; + LEX_CSTRING table_name; LEX_CSTRING schema_table_name; + LEX_CSTRING alias; const char *option; /* Used by cache index */ Item *on_expr; /* Used with outer join */ Name_resolution_context *on_context; /* For ON expressions */ diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index d5f43dabec0..d0194ed49a2 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -341,7 +341,6 @@ SET(INNOBASE_SOURCES include/srv0start.h include/srw_lock.h include/sux_lock.h - include/sql_funcs.h include/trx0i_s.h include/trx0purge.h include/trx0rec.h diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index 5fe03354fb3..7110fe70182 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -1650,9 +1650,7 @@ dict_table_rename_in_cache( table->name.m_name); dict_mem_foreign_table_name_lookup_set(foreign, FALSE); } - - const bool tmp_id = (strchr(foreign->id, '\xFF') != NULL); - if (!tmp_id && strchr(foreign->id, '/')) { + if (strchr(foreign->id, '/')) { /* This is a >= 4.0.18 format id */ ulint db_len; @@ -1796,16 +1794,10 @@ dict_table_rename_in_cache( } table->foreign_set.erase(it); + fk_set.insert(foreign); - if (!tmp_id) { - fk_set.insert(foreign); - - if (foreign->referenced_table) { - foreign->referenced_table - ->referenced_set.insert(foreign); - } - } else { - dict_foreign_free(foreign); + if (foreign->referenced_table) { + foreign->referenced_table->referenced_set.insert(foreign); } } @@ -3305,18 +3297,66 @@ foreign constraint parser to get the referenced table. heap memory passed in */ char* dict_get_referenced_table( - LEX_CSTRING database_name, /*!< in: table db name */ - LEX_CSTRING table_name, /*!< in: table name */ - dict_table_t** table, /*!< out: table object or NULL */ - mem_heap_t* heap) /*!< in/out: heap memory */ + const char* name, /*!< in: foreign key table name */ + const char* database_name, /*!< in: table db name */ + ulint database_name_len, /*!< in: db name length */ + const char* table_name, /*!< in: table name */ + ulint table_name_len, /*!< in: table name length */ + dict_table_t** table, /*!< out: table object or NULL */ + mem_heap_t* heap, /*!< in/out: heap memory */ + CHARSET_INFO* from_cs) /*!< in: table name charset */ { + char* ref; + char db_name[MAX_DATABASE_NAME_LEN]; + char tbl_name[MAX_TABLE_NAME_LEN]; + CHARSET_INFO* to_cs = &my_charset_filename; + uint errors; + ut_ad(database_name || name); + ut_ad(table_name); + + if (!strncmp(table_name, srv_mysql50_table_name_prefix, + sizeof(srv_mysql50_table_name_prefix) - 1)) { + /* This is a pre-5.1 table name + containing chars other than [A-Za-z0-9]. + Discard the prefix and use raw UTF-8 encoding. */ + table_name += sizeof(srv_mysql50_table_name_prefix) - 1; + table_name_len -= sizeof(srv_mysql50_table_name_prefix) - 1; + + to_cs = system_charset_info; + } + + table_name_len = strconvert(from_cs, table_name, table_name_len, to_cs, + tbl_name, MAX_TABLE_NAME_LEN, &errors); + table_name = tbl_name; + + if (database_name) { + to_cs = &my_charset_filename; + if (!strncmp(database_name, srv_mysql50_table_name_prefix, + sizeof(srv_mysql50_table_name_prefix) - 1)) { + database_name + += sizeof(srv_mysql50_table_name_prefix) - 1; + database_name_len + -= sizeof(srv_mysql50_table_name_prefix) - 1; + to_cs = system_charset_info; + } + + database_name_len = strconvert( + from_cs, database_name, database_name_len, to_cs, + db_name, MAX_DATABASE_NAME_LEN, &errors); + database_name = db_name; + } else { + /* Use the database name of the foreign key table */ + + database_name = name; + database_name_len = dict_get_db_name_len(name); + } + /* Copy database_name, '/', table_name, '\0' */ - const size_t len = database_name.length + table_name.length + 1; - char* ref = static_cast(mem_heap_alloc(heap, len + 1)); - memcpy(ref, database_name.str, database_name.length); - ref[database_name.length] = '/'; - memcpy(ref + database_name.length + 1, table_name.str, - table_name.length + 1); + const size_t len = database_name_len + table_name_len + 1; + ref = static_cast(mem_heap_alloc(heap, len + 1)); + memcpy(ref, database_name, database_name_len); + ref[database_name_len] = '/'; + memcpy(ref + database_name_len + 1, table_name, table_name_len + 1); /* Values; 0 = Store and compare as given; case sensitive 1 = Store and compare in lower; case insensitive @@ -3324,10 +3364,10 @@ dict_get_referenced_table( if (lower_case_table_names == 2) { innobase_casedn_str(ref); *table = dict_sys.load_table({ref, len}); - memcpy(ref, database_name.str, database_name.length); - ref[database_name.length] = '/'; - memcpy(ref + database_name.length + 1, - table_name.str, table_name.length + 1); + memcpy(ref, database_name, database_name_len); + ref[database_name_len] = '/'; + memcpy(ref + database_name_len + 1, table_name, table_name_len + 1); + } else { #ifndef _WIN32 if (lower_case_table_names == 1) { diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc index c0ab4bbc521..0e937ebe63b 100644 --- a/storage/innobase/dict/dict0load.cc +++ b/storage/innobase/dict/dict0load.cc @@ -3143,8 +3143,8 @@ loop: rec, DICT_FLD__SYS_FOREIGN_FOR_NAME__ID, &len); /* Copy the string because the page may be modified or evicted - after mtr.commit() below (-2 is for \xFF\xFF in tmp constraints). */ - char fk_id[MAX_TABLE_NAME_LEN + NAME_LEN - 2]; + after mtr.commit() below. */ + char fk_id[MAX_TABLE_NAME_LEN + NAME_LEN]; err = DB_SUCCESS; if (UNIV_LIKELY(len < sizeof fk_id)) { memcpy(fk_id, field, len); diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc index 4ffc393575a..89670e0432c 100644 --- a/storage/innobase/fts/fts0fts.cc +++ b/storage/innobase/fts/fts0fts.cc @@ -1359,7 +1359,7 @@ static dberr_t fts_drop_table(trx_t *trx, const char *table_name, bool rename) char *tmp= dict_mem_create_temporary_tablename(heap, table->name.m_name, table->id); dberr_t err= row_rename_table_for_mysql(table->name.m_name, tmp, trx, - RENAME_IGNORE_FK); + false); mem_heap_free(heap); if (err != DB_SUCCESS) { @@ -1410,7 +1410,7 @@ fts_rename_one_aux_table( fts_table_new_name[table_new_name_len] = 0; return row_rename_table_for_mysql( - fts_table_old_name, fts_table_new_name, trx, RENAME_IGNORE_FK); + fts_table_old_name, fts_table_new_name, trx, false); } /****************************************************************//** diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index e01e16cda4b..d91a2436ca6 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -5237,7 +5237,7 @@ normalize_table_name_c_low( db_ptr = ptr + 1; norm_len = db_len + name_len + sizeof "/"; - ut_a(norm_len < FN_REFLEN); + ut_a(norm_len < FN_REFLEN - 1); memcpy(norm_name, db_ptr, db_len); @@ -12189,8 +12189,6 @@ create_table_info_t::create_foreign_keys() const char* ref_column_names[MAX_COLS_PER_FK]; char create_name[MAX_DATABASE_NAME_LEN + 1 + MAX_TABLE_NAME_LEN + 1]; - char db_name[MAX_DATABASE_NAME_LEN + 1]; - char t_name[MAX_TABLE_NAME_LEN + 1]; dict_index_t* index = NULL; fkerr_t index_error = FK_SUCCESS; dict_index_t* err_index = NULL; @@ -12198,50 +12196,18 @@ create_table_info_t::create_foreign_keys() const bool tmp_table = m_flags2 & DICT_TF2_TEMPORARY; const CHARSET_INFO* cs = thd_charset(m_thd); const char* operation = "Create "; - const char* basename; + const char* name = m_table_name; enum_sql_command sqlcom = enum_sql_command(thd_sql_command(m_thd)); - LEX_CSTRING name= {m_table_name, strlen(m_table_name)}; if (sqlcom == SQLCOM_ALTER_TABLE) { - dict_table_t* alter_table; - mem_heap_t* heap = mem_heap_create(10000); - DBUG_ASSERT(!m_create_info->is_atomic_replace()); - LEX_CSTRING table_name = m_form->s->table_name; - CHARSET_INFO* to_cs = &my_charset_filename; - - if (!strncmp(table_name.str, srv_mysql50_table_name_prefix, - sizeof srv_mysql50_table_name_prefix - 1)) { - table_name.str - += sizeof srv_mysql50_table_name_prefix - 1; - table_name.length - -= sizeof srv_mysql50_table_name_prefix - 1; - to_cs = system_charset_info; - } - - uint errors; - LEX_CSTRING t; - t.str = t_name; - t.length = strconvert(cs, LEX_STRING_WITH_LEN(table_name), - to_cs, t_name, MAX_TABLE_NAME_LEN, - &errors); - LEX_CSTRING d = m_form->s->db; - - if (!strncmp(d.str, srv_mysql50_table_name_prefix, - sizeof srv_mysql50_table_name_prefix - 1)) { - d.str += sizeof srv_mysql50_table_name_prefix - 1; - d.length -= sizeof srv_mysql50_table_name_prefix - 1; - to_cs = system_charset_info; - } else { - to_cs = &my_charset_filename; - } - - d.length = strconvert(cs, LEX_STRING_WITH_LEN(d), to_cs, - db_name, MAX_DATABASE_NAME_LEN, - &errors); - d.str = db_name; - - char* n = dict_get_referenced_table(d, t, &alter_table, heap); + dict_table_t* table_to_alter; + mem_heap_t* heap = mem_heap_create(10000); + ulint highest_id_so_far; + char* n = dict_get_referenced_table( + name, LEX_STRING_WITH_LEN(m_form->s->db), + LEX_STRING_WITH_LEN(m_form->s->table_name), + &table_to_alter, heap, cs); /* Starting from 4.0.18 and 4.1.2, we generate foreign key id's in the format databasename/tablename_ibfk_[number], where @@ -12251,33 +12217,38 @@ create_table_info_t::create_foreign_keys() /* If we are altering a temporary table, the table name after ALTER TABLE does not correspond to the internal table name, and - alter_table=nullptr. But, we do not support FOREIGN KEY - constraints for temporary tables. */ + table_to_alter is NULL. TODO: should we fix this somehow? */ - if (alter_table) { - n = alter_table->name.m_name; - number = 1 + dict_table_get_highest_foreign_id( - alter_table); + if (table_to_alter) { + n = table_to_alter->name.m_name; + highest_id_so_far = dict_table_get_highest_foreign_id( + table_to_alter); + } else { + highest_id_so_far = 0; } - *innobase_convert_name(create_name, sizeof create_name, - n, strlen(n), m_thd) = '\0'; + char* bufend = innobase_convert_name( + create_name, sizeof create_name, n, strlen(n), m_thd); + create_name[bufend - create_name] = '\0'; + number = highest_id_so_far + 1; mem_heap_free(heap); operation = "Alter "; - } else if (strstr(m_table_name, "#P#") - || strstr(m_table_name, "#p#")) { + } else if (strstr(name, "#P#") || strstr(name, "#p#")) { /* Partitioned table */ create_name[0] = '\0'; } else { - *innobase_convert_name(create_name, sizeof create_name, - LEX_STRING_WITH_LEN(name), m_thd)= '\0'; + char* bufend = innobase_convert_name(create_name, + sizeof create_name, + name, + strlen(name), m_thd); + create_name[bufend - create_name] = '\0'; } Alter_info* alter_info = m_create_info->alter_info; ut_ad(alter_info); List_iterator_fast key_it(alter_info->key_list); - dict_table_t* table = dict_sys.find_table({name.str, name.length}); + dict_table_t* table = dict_sys.find_table({name,strlen(name)}); if (!table) { ib_foreign_warn(m_trx, DB_CANNOT_ADD_CONSTRAINT, create_name, "%s table %s foreign key constraint" @@ -12287,8 +12258,6 @@ create_table_info_t::create_foreign_keys() return (DB_CANNOT_ADD_CONSTRAINT); } - basename = table->name.basename(); - while (Key* key = key_it++) { if (key->type != Key::FOREIGN_KEY) continue; @@ -12326,27 +12295,27 @@ create_table_info_t::create_foreign_keys() col->field_name.length); success = find_col(table, column_names + i); if (!success) { + key_text k(fk); ib_foreign_warn( m_trx, DB_CANNOT_ADD_CONSTRAINT, create_name, "%s table %s foreign key %s constraint" " failed. Column %s was not found.", - operation, create_name, - key_text(fk).str(), + operation, create_name, k.str(), column_names[i]); dict_foreign_free(foreign); return (DB_CANNOT_ADD_CONSTRAINT); } ++i; if (i >= MAX_COLS_PER_FK) { + key_text k(fk); ib_foreign_warn( m_trx, DB_CANNOT_ADD_CONSTRAINT, create_name, "%s table %s foreign key %s constraint" " failed. Too many columns: %u (%u " "allowed).", - operation, create_name, - key_text(fk).str(), i, + operation, create_name, k.str(), i, MAX_COLS_PER_FK); dict_foreign_free(foreign); return (DB_CANNOT_ADD_CONSTRAINT); @@ -12358,9 +12327,9 @@ create_table_info_t::create_foreign_keys() &index_error, &err_col, &err_index); if (!index) { + key_text k(fk); foreign_push_index_error(m_trx, operation, create_name, - key_text(fk).str(), - column_names, + k.str(), column_names, index_error, err_col, err_index, table); dict_foreign_free(foreign); @@ -12369,7 +12338,6 @@ create_table_info_t::create_foreign_keys() if (fk->constraint_name.str) { ulint db_len; - const bool tmp= m_create_info->is_atomic_replace(); /* Catenate 'databasename/' to the constraint name specified by the user: we conceive the constraint as @@ -12379,17 +12347,13 @@ create_table_info_t::create_foreign_keys() db_len = dict_get_db_name_len(table->name.m_name); foreign->id = static_cast(mem_heap_alloc( - foreign->heap, (tmp ? 3 : 2) - + db_len + fk->constraint_name.length)); + foreign->heap, + db_len + fk->constraint_name.length + 2)); - char *pos = foreign->id; - memcpy(pos, table->name.m_name, db_len); - pos += db_len; - *(pos++) = '/'; - if (tmp) { - *(pos++) = '\xFF'; - } - strcpy(pos, fk->constraint_name.str); + memcpy(foreign->id, table->name.m_name, db_len); + foreign->id[db_len] = '/'; + strcpy(foreign->id + db_len + 1, + fk->constraint_name.str); } if (foreign->id == NULL) { @@ -12431,79 +12395,32 @@ create_table_info_t::create_foreign_keys() memcpy(foreign->foreign_col_names, column_names, i * sizeof(void*)); - LEX_CSTRING table_name = fk->ref_table; - CHARSET_INFO* to_cs = &my_charset_filename; - uint errors; - LEX_CSTRING t = table_name; - LEX_CSTRING d = fk->ref_db; - - if (!d.str) { - d.str = table->name.m_name; - d.length = size_t(basename - table->name.m_name - 1); - } - - if (m_create_info->is_atomic_replace() - && basename == &table->name.m_name[d.length + 1] - && !memcmp(d.str, table->name.m_name, d.length) - && !strcmp(basename, table_name.str)) { - /* Do not convert names when encountering - self-referential constraints during - CREATE OR REPLACE TABLE. */ - goto name_converted; - } - - if (!strncmp(table_name.str, srv_mysql50_table_name_prefix, - sizeof srv_mysql50_table_name_prefix - 1)) { - table_name.str - += sizeof srv_mysql50_table_name_prefix - 1; - table_name.length - -= sizeof srv_mysql50_table_name_prefix - 1; - to_cs = system_charset_info; - } - - t.str = t_name; - t.length = strconvert(cs, LEX_STRING_WITH_LEN(table_name), - to_cs, t_name, - MAX_TABLE_NAME_LEN, &errors); - - if (!strncmp(d.str, srv_mysql50_table_name_prefix, - sizeof srv_mysql50_table_name_prefix - 1)) { - d.str += sizeof srv_mysql50_table_name_prefix - 1; - d.length -= sizeof srv_mysql50_table_name_prefix - 1; - to_cs = system_charset_info; - } else if (d.str == table->name.m_name) { - goto name_converted; - } else { - to_cs = &my_charset_filename; - } - - if (d.str != table->name.m_name) { - d.length = strconvert(cs, LEX_STRING_WITH_LEN(d), - to_cs, db_name, - MAX_DATABASE_NAME_LEN, - &errors); - d.str = db_name; - } -name_converted: foreign->referenced_table_name = dict_get_referenced_table( - d, t, &foreign->referenced_table, foreign->heap); + name, LEX_STRING_WITH_LEN(fk->ref_db), + LEX_STRING_WITH_LEN(fk->ref_table), + &foreign->referenced_table, foreign->heap, cs); + + if (!foreign->referenced_table_name) { + return (DB_OUT_OF_MEMORY); + } if (!foreign->referenced_table && m_trx->check_foreigns) { char buf[MAX_TABLE_NAME_LEN + 1] = ""; + char* bufend; - *innobase_convert_name( + bufend = innobase_convert_name( buf, MAX_TABLE_NAME_LEN, foreign->referenced_table_name, - strlen(foreign->referenced_table_name), m_thd) - = '\0'; + strlen(foreign->referenced_table_name), m_thd); + buf[bufend - buf] = '\0'; + key_text k(fk); ib_foreign_warn(m_trx, DB_CANNOT_ADD_CONSTRAINT, create_name, "%s table %s with foreign key %s " "constraint failed. Referenced table " "%s not found in the data dictionary.", - operation, create_name, - key_text(fk).str(), buf); - return DB_CANNOT_ADD_CONSTRAINT; + operation, create_name, k.str(), buf); + return (DB_CANNOT_ADD_CONSTRAINT); } /* Don't allow foreign keys on partitioned tables yet. */ @@ -12526,6 +12443,7 @@ name_converted: success = find_col(foreign->referenced_table, ref_column_names + j); if (!success) { + key_text k(fk); ib_foreign_warn( m_trx, DB_CANNOT_ADD_CONSTRAINT, @@ -12534,9 +12452,9 @@ name_converted: "constraint failed. " "Column %s was not found.", operation, create_name, - key_text(fk).str(), - ref_column_names[j]); - return DB_CANNOT_ADD_CONSTRAINT; + k.str(), ref_column_names[j]); + + return (DB_CANNOT_ADD_CONSTRAINT); } } ++j; @@ -12556,15 +12474,16 @@ name_converted: &err_index); if (!index) { + key_text k(fk); foreign_push_index_error( - m_trx, operation, create_name, - key_text(fk).str(), + m_trx, operation, create_name, k.str(), column_names, index_error, err_col, err_index, foreign->referenced_table); - return DB_CANNOT_ADD_CONSTRAINT; + + return (DB_CANNOT_ADD_CONSTRAINT); } } else { - ut_a(!m_trx->check_foreigns); + ut_a(m_trx->check_foreigns == FALSE); index = NULL; } @@ -12601,6 +12520,7 @@ name_converted: NULL if the column is not allowed to be NULL! */ + key_text k(fk); ib_foreign_warn( m_trx, DB_CANNOT_ADD_CONSTRAINT, @@ -12611,9 +12531,9 @@ name_converted: "but column '%s' is defined as " "NOT NULL.", operation, create_name, - key_text(fk).str(), col_name); + k.str(), col_name); - return DB_CANNOT_ADD_CONSTRAINT; + return (DB_CANNOT_ADD_CONSTRAINT); } } } @@ -13755,10 +13675,10 @@ err_exit: @param[in,out] trx InnoDB data dictionary transaction @param[in] from old table name @param[in] to new table name -@param[in] fk how to handle FOREIGN KEY +@param[in] use_fk whether to enforce FOREIGN KEY @return DB_SUCCESS or error code */ static dberr_t innobase_rename_table(trx_t *trx, const char *from, - const char *to, rename_fk fk) + const char *to, bool use_fk) { dberr_t error; char norm_to[FN_REFLEN]; @@ -13776,7 +13696,7 @@ static dberr_t innobase_rename_table(trx_t *trx, const char *from, ut_ad(trx->will_lock); - error = row_rename_table_for_mysql(norm_from, norm_to, trx, fk); + error = row_rename_table_for_mysql(norm_from, norm_to, trx, use_fk); if (error != DB_SUCCESS) { if (error == DB_TABLE_NOT_FOUND @@ -13801,8 +13721,7 @@ static dberr_t innobase_rename_table(trx_t *trx, const char *from, #endif /* _WIN32 */ trx_start_if_not_started(trx, true); error = row_rename_table_for_mysql( - par_case_name, norm_to, trx, - RENAME_IGNORE_FK); + par_case_name, norm_to, trx, false); } } @@ -13983,7 +13902,7 @@ int ha_innobase::truncate() if (error == DB_SUCCESS) { error = innobase_rename_table(trx, ib_table->name.m_name, - temp_name, RENAME_REBUILD); + temp_name, false); if (error == DB_SUCCESS) { error = trx->drop_table(*ib_table); @@ -14176,11 +14095,7 @@ ha_innobase::rename_table( row_mysql_lock_data_dictionary(trx); if (error == DB_SUCCESS) { - error = innobase_rename_table(trx, from, to, - thd_sql_command(thd) - == SQLCOM_ALTER_TABLE - ? RENAME_ALTER_COPY - : RENAME_FK); + error = innobase_rename_table(trx, from, to, true); } DEBUG_SYNC(thd, "after_innobase_rename_table"); @@ -16159,7 +16074,6 @@ ha_innobase::external_lock( /* MySQL is releasing a table lock */ - ut_ad(trx->n_mysql_tables_in_use); trx->n_mysql_tables_in_use--; m_mysql_has_locked = false; diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 7cbdf862eb9..0b933265fcf 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -30,7 +30,6 @@ Smart ALTER TABLE #include #include #include -#include /* Include necessary InnoDB headers */ #include "btr0sea.h" @@ -3191,8 +3190,6 @@ innobase_get_foreign_key_info( ulint num_fk = 0; Alter_info* alter_info = ha_alter_info->alter_info; const CHARSET_INFO* cs = thd_charset(trx->mysql_thd); - char db_name[MAX_DATABASE_NAME_LEN + 1]; - char t_name[MAX_TABLE_NAME_LEN + 1]; DBUG_ENTER("innobase_get_foreign_key_info"); @@ -3257,51 +3254,14 @@ innobase_get_foreign_key_info( add_fk[num_fk] = dict_mem_foreign_create(); - LEX_CSTRING table_name = fk_key->ref_table; - CHARSET_INFO* to_cs = &my_charset_filename; - - if (!strncmp(table_name.str, srv_mysql50_table_name_prefix, - sizeof srv_mysql50_table_name_prefix - 1)) { - table_name.str - += sizeof srv_mysql50_table_name_prefix - 1; - table_name.length - -= sizeof srv_mysql50_table_name_prefix - 1; - to_cs = system_charset_info; - } - - uint errors; - LEX_CSTRING t; - t.str = t_name; - t.length = strconvert(cs, LEX_STRING_WITH_LEN(table_name), - to_cs, t_name, MAX_TABLE_NAME_LEN, - &errors); - LEX_CSTRING d = fk_key->ref_db; - if (!d.str) { - d.str = table->name.m_name; - d.length = table->name.dblen(); - } - - if (!strncmp(d.str, srv_mysql50_table_name_prefix, - sizeof srv_mysql50_table_name_prefix - 1)) { - d.str += sizeof srv_mysql50_table_name_prefix - 1; - d.length -= sizeof srv_mysql50_table_name_prefix - 1; - to_cs = system_charset_info; - } else if (d.str == table->name.m_name) { - goto name_converted; - } else { - to_cs = &my_charset_filename; - } - - d.length = strconvert(cs, LEX_STRING_WITH_LEN(d), to_cs, - db_name, MAX_DATABASE_NAME_LEN, - &errors); - d.str = db_name; - -name_converted: dict_sys.lock(SRW_LOCK_CALL); referenced_table_name = dict_get_referenced_table( - d, t, &referenced_table, add_fk[num_fk]->heap); + table->name.m_name, + LEX_STRING_WITH_LEN(fk_key->ref_db), + LEX_STRING_WITH_LEN(fk_key->ref_table), + &referenced_table, + add_fk[num_fk]->heap, cs); /* Test the case when referenced_table failed to open, if trx->check_foreigns is not set, we should @@ -10212,12 +10172,10 @@ commit_try_rebuild( char* old_name= mem_heap_strdup(ctx->heap, user_table->name.m_name); dberr_t error = row_rename_table_for_mysql(user_table->name.m_name, - ctx->tmp_name, trx, - RENAME_REBUILD); + ctx->tmp_name, trx, false); if (error == DB_SUCCESS) { error = row_rename_table_for_mysql( - rebuilt_table->name.m_name, old_name, trx, - RENAME_REBUILD); + rebuilt_table->name.m_name, old_name, trx, false); if (error == DB_SUCCESS) { /* The statistics for the surviving indexes will be re-inserted in alter_stats_rebuild(). */ diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index fef0e4f9857..d867d2f297a 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -61,11 +61,15 @@ foreign constraint parser to get the referenced table. heap memory passed in */ char* dict_get_referenced_table( - LEX_CSTRING database_name, /*!< in: table db name */ - LEX_CSTRING table_name, /*!< in: table name */ +/*======================*/ + const char* name, /*!< in: foreign key table name */ + const char* database_name, /*!< in: table db name */ + ulint database_name_len,/*!< in: db name length */ + const char* table_name, /*!< in: table name */ + ulint table_name_len, /*!< in: table name length */ dict_table_t** table, /*!< out: table object or NULL */ - mem_heap_t* heap) /*!< in/out: heap memory */ - MY_ATTRIBUTE((nonnull)); + mem_heap_t* heap, /*!< in: heap memory */ + CHARSET_INFO* from_cs); /*!< in: table name charset */ /*********************************************************************//** Frees a foreign key struct. */ void diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h index 232ba9293d7..3c624621b1d 100644 --- a/storage/innobase/include/row0mysql.h +++ b/storage/innobase/include/row0mysql.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2000, 2017, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2022, MariaDB Corporation. +Copyright (c) 2017, 2021, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -369,17 +369,6 @@ row_import_tablespace_for_mysql( row_prebuilt_t* prebuilt) /*!< in: prebuilt struct in MySQL */ MY_ATTRIBUTE((nonnull, warn_unused_result)); -enum rename_fk { - /** ignore FOREIGN KEY constraints */ - RENAME_IGNORE_FK= 0, - /** parse and enforce FOREIGN KEY constaints */ - RENAME_FK, - /** Rename a table as part of a native table-rebuilding DDL operation */ - RENAME_REBUILD, - /** Rename as part of ALTER TABLE...ALGORITHM=COPY */ - RENAME_ALTER_COPY -}; - /*********************************************************************//** Renames a table for MySQL. @return error code or DB_SUCCESS */ @@ -389,7 +378,7 @@ row_rename_table_for_mysql( const char* old_name, /*!< in: old table name */ const char* new_name, /*!< in: new table name */ trx_t* trx, /*!< in/out: transaction */ - rename_fk fk) /*!< in: how to handle + bool use_fk) /*!< in: whether to parse and enforce FOREIGN KEY constraints */ MY_ATTRIBUTE((nonnull, warn_unused_result)); diff --git a/storage/innobase/include/sql_funcs.h b/storage/innobase/include/sql_funcs.h deleted file mode 100644 index 1506a2a5a48..00000000000 --- a/storage/innobase/include/sql_funcs.h +++ /dev/null @@ -1,111 +0,0 @@ -/***************************************************************************** - -Copyright (c) 2022, MariaDB Corporation. - -This program is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free Software -Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along with -this program; if not, write to the Free Software Foundation, Inc., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA - -*****************************************************************************/ - -/** - @file include/sql_funcs.h - - SQL procedures for InnoDB system tables operation -*/ - -/** - Rename foreign keys for rename table - - @see row_rename_table_for_mysql() -*/ -constexpr const char *rename_constraint_ids= -R"===(PROCEDURE RENAME_CONSTRAINT_IDS () IS - gen_constr_prefix CHAR; - new_db_name CHAR; - foreign_id CHAR; - foreign_id2 CHAR; - constr_name CHAR; - new_foreign_id CHAR; - old_db_name_len INT; - new_db_name_len INT; - id_len INT; - offset INT; - offset2 INT; - constr_name_len INT; - found INT; - BEGIN - found := 1; - old_db_name_len := INSTR(:old_table_name, '/') - 1; - new_db_name_len := INSTR(:new_table_name, '/') - 1; - new_db_name := SUBSTR(:new_table_name, 0, - new_db_name_len); - gen_constr_prefix := CONCAT(:old_table_name_utf8, - '_ibfk_'); - WHILE found = 1 LOOP - SELECT ID INTO foreign_id - FROM SYS_FOREIGN - WHERE FOR_NAME = :old_table_name - AND TO_BINARY(FOR_NAME) - = TO_BINARY(:old_table_name) - LOCK IN SHARE MODE; - IF (SQL % NOTFOUND) THEN - found := 0; - ELSE - UPDATE SYS_FOREIGN - SET FOR_NAME = :new_table_name - WHERE ID = foreign_id; - id_len := LENGTH(foreign_id); - foreign_id2 := foreign_id; - offset := INSTR(foreign_id, ')===" "\xFF" R"===('); - IF (SUBSTR(foreign_id, offset, 1) = ')===" "\xFF" R"===(') THEN - offset2 := offset + 1; - ELSE - offset2 := offset; - END IF; - IF (:old_is_tmp > 0 AND offset > 0) THEN - foreign_id := CONCAT(SUBSTR(foreign_id2, 0, offset - 1), - SUBSTR(foreign_id2, offset2, id_len - offset2)); - id_len := id_len - 1; - END IF; - IF (INSTR(foreign_id, '/') > 0) THEN - IF (INSTR(foreign_id, - gen_constr_prefix) > 0) - THEN - offset := INSTR(foreign_id, '_ibfk_') - 1; - new_foreign_id := - CONCAT(:new_table_utf8, - SUBSTR(foreign_id, offset, id_len - offset)); - ELSE - constr_name_len := id_len - old_db_name_len; - constr_name := SUBSTR(foreign_id, old_db_name_len, - constr_name_len); - IF (:new_is_tmp > 0) THEN - new_foreign_id := CONCAT(new_db_name, ')===" "/\xFF\xFF" R"===(', - SUBSTR(constr_name, 1, constr_name_len - 1)); - ELSE - new_foreign_id := CONCAT(new_db_name, constr_name); - END IF; - END IF; - UPDATE SYS_FOREIGN - SET ID = new_foreign_id - WHERE ID = foreign_id2; - UPDATE SYS_FOREIGN_COLS - SET ID = new_foreign_id - WHERE ID = foreign_id2; - END IF; - END IF; - END LOOP; - UPDATE SYS_FOREIGN SET REF_NAME = :new_table_name - WHERE REF_NAME = :old_table_name - AND TO_BINARY(REF_NAME) - = TO_BINARY(:old_table_name); -END;)==="; diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index d7f87d66139..a8619e788af 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -67,8 +67,6 @@ Created 9/17/2000 Heikki Tuuri #include -#include "sql_funcs.h" - /*******************************************************************//** Delays an INSERT, DELETE or UPDATE operation if the purge is lagging. */ static @@ -2546,7 +2544,7 @@ row_rename_table_for_mysql( const char* old_name, /*!< in: old table name */ const char* new_name, /*!< in: new table name */ trx_t* trx, /*!< in/out: transaction */ - rename_fk fk) /*!< in: how to handle + bool use_fk) /*!< in: whether to parse and enforce FOREIGN KEY constraints */ { dict_table_t* table = NULL; @@ -2631,9 +2629,9 @@ row_rename_table_for_mysql( goto funct_exit; - } else if (fk == RENAME_ALTER_COPY && !old_is_tmp && new_is_tmp) { - /* Non-native ALTER TABLE is renaming the - original table to a temporary name. We want to preserve + } else if (use_fk && !old_is_tmp && new_is_tmp) { + /* MySQL is doing an ALTER TABLE command and it renames the + original table to a temporary table name. We want to preserve the original foreign key constraint definitions despite the name change. An exception is those constraints for which the ALTER TABLE contained DROP FOREIGN KEY .*/ @@ -2677,7 +2675,7 @@ row_rename_table_for_mysql( goto rollback_and_exit; } - if (fk == RENAME_IGNORE_FK || fk == RENAME_FK || !new_is_tmp) { + if (!new_is_tmp) { /* Rename all constraints. */ char new_table_name[MAX_TABLE_NAME_LEN + 1]; char old_table_utf8[MAX_TABLE_NAME_LEN + 1]; @@ -2721,16 +2719,73 @@ row_rename_table_for_mysql( } pars_info_add_str_literal(info, "new_table_utf8", new_table_name); - /* Old foreign ID for temporary constraint was written like this: - db_name/\xFFconstraint_name */ - pars_info_add_int4_literal(info, "old_is_tmp", - (fk == RENAME_FK) && old_is_tmp); - /* New foreign ID for temporary constraint is written like this: - db_name/\xFF\xFFconstraint_name */ - pars_info_add_int4_literal(info, "new_is_tmp", - (fk == RENAME_FK) && new_is_tmp); - err = que_eval_sql(info, rename_constraint_ids, trx); + err = que_eval_sql( + info, + "PROCEDURE RENAME_CONSTRAINT_IDS () IS\n" + "gen_constr_prefix CHAR;\n" + "new_db_name CHAR;\n" + "foreign_id CHAR;\n" + "new_foreign_id CHAR;\n" + "old_db_name_len INT;\n" + "old_t_name_len INT;\n" + "new_db_name_len INT;\n" + "id_len INT;\n" + "offset INT;\n" + "found INT;\n" + "BEGIN\n" + "found := 1;\n" + "old_db_name_len := INSTR(:old_table_name, '/')-1;\n" + "new_db_name_len := INSTR(:new_table_name, '/')-1;\n" + "new_db_name := SUBSTR(:new_table_name, 0,\n" + " new_db_name_len);\n" + "old_t_name_len := LENGTH(:old_table_name);\n" + "gen_constr_prefix := CONCAT(:old_table_name_utf8,\n" + " '_ibfk_');\n" + "WHILE found = 1 LOOP\n" + " SELECT ID INTO foreign_id\n" + " FROM SYS_FOREIGN\n" + " WHERE FOR_NAME = :old_table_name\n" + " AND TO_BINARY(FOR_NAME)\n" + " = TO_BINARY(:old_table_name)\n" + " LOCK IN SHARE MODE;\n" + " IF (SQL % NOTFOUND) THEN\n" + " found := 0;\n" + " ELSE\n" + " UPDATE SYS_FOREIGN\n" + " SET FOR_NAME = :new_table_name\n" + " WHERE ID = foreign_id;\n" + " id_len := LENGTH(foreign_id);\n" + " IF (INSTR(foreign_id, '/') > 0) THEN\n" + " IF (INSTR(foreign_id,\n" + " gen_constr_prefix) > 0)\n" + " THEN\n" + " offset := INSTR(foreign_id, '_ibfk_') - 1;\n" + " new_foreign_id :=\n" + " CONCAT(:new_table_utf8,\n" + " SUBSTR(foreign_id, offset,\n" + " id_len - offset));\n" + " ELSE\n" + " new_foreign_id :=\n" + " CONCAT(new_db_name,\n" + " SUBSTR(foreign_id,\n" + " old_db_name_len,\n" + " id_len - old_db_name_len));\n" + " END IF;\n" + " UPDATE SYS_FOREIGN\n" + " SET ID = new_foreign_id\n" + " WHERE ID = foreign_id;\n" + " UPDATE SYS_FOREIGN_COLS\n" + " SET ID = new_foreign_id\n" + " WHERE ID = foreign_id;\n" + " END IF;\n" + " END IF;\n" + "END LOOP;\n" + "UPDATE SYS_FOREIGN SET REF_NAME = :new_table_name\n" + "WHERE REF_NAME = :old_table_name\n" + " AND TO_BINARY(REF_NAME)\n" + " = TO_BINARY(:old_table_name);\n" + "END;\n", trx); } else if (n_constraints_to_drop > 0) { /* Drop some constraints of tmp tables. */ @@ -2794,7 +2849,7 @@ row_rename_table_for_mysql( err = dict_load_foreigns( new_name, nullptr, trx->id, !old_is_tmp || trx->check_foreigns, - fk == RENAME_FK || fk == RENAME_ALTER_COPY + use_fk ? DICT_ERR_IGNORE_NONE : DICT_ERR_IGNORE_FK_NOKEY, fk_tables); diff --git a/storage/maria/ha_s3.cc b/storage/maria/ha_s3.cc index f432c158204..c00f42d74c1 100644 --- a/storage/maria/ha_s3.cc +++ b/storage/maria/ha_s3.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2019, 2022, MariaDB Corporation. +/* Copyright (C) 2019, 2021 MariaDB Corporation Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1031,8 +1031,7 @@ static int ha_s3_init(void *p) s3_hton->show_status= 0; s3_hton->prepare_for_backup= 0; s3_hton->end_backup= 0; - s3_hton->flags= HTON_EXPENSIVE_RENAME | - ((s3_slave_ignore_updates ? HTON_IGNORE_UPDATES : 0) | + s3_hton->flags= ((s3_slave_ignore_updates ? HTON_IGNORE_UPDATES : 0) | (s3_replicate_alter_as_create_select ? HTON_TABLE_MAY_NOT_EXIST_ON_SLAVE : 0)); /* Copy global arguments to s3_access_key and s3_secret_key */ diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c index 3e305c282e9..f470d3691c1 100644 --- a/storage/maria/ma_check.c +++ b/storage/maria/ma_check.c @@ -2881,7 +2881,7 @@ int maria_repair(HA_CHECK *param, register MARIA_HA *info, if (param->testflag & T_SAFE_REPAIR) { - /* Don't repair if we lost more than one row */ + /* Don't repair if we loosed more than one row */ if (sort_info.new_info->s->state.state.records+1 < start_records) { share->state.state.records= start_records;