From bff79492c5f6c9669b9dc9bf2cf0483b3b001da7 Mon Sep 17 00:00:00 2001 From: Monty Date: Mon, 30 Dec 2019 13:34:28 +0200 Subject: Added IF EXISTS to RENAME TABLE and ALTER TABLE --- mysql-test/main/alter_table.result | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'mysql-test/main/alter_table.result') diff --git a/mysql-test/main/alter_table.result b/mysql-test/main/alter_table.result index c2c5813a100..36fb35f05b4 100644 --- a/mysql-test/main/alter_table.result +++ b/mysql-test/main/alter_table.result @@ -3244,3 +3244,22 @@ drop table t1; # # End of 10.5 tests # +# +# ALTER TABLE IF EXISTS +# +create table t1 (a int); +alter table if exists t1 add column b int; +alter table if exists t2 add column c int; +Warnings: +Error 1146 Table 'test.t2' doesn't exist +alter table if exists t9 rename t1; +Warnings: +Error 1146 Table 'test.t9' doesn't exist +alter table if exists t1 rename t2; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t2; -- cgit v1.2.1