From e06cb31719ce31fb1cd7944d1de86d4de9e3eca6 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 9 Apr 2013 15:57:09 +0200 Subject: CREATE TABLE and frm-less discovering engines. Now CREATE TABLE does not write the frm file on disk, if the engine can discover it --- mysql-test/suite/archive/archive.result | 28 ++++++++++++++++++++++++++++ mysql-test/suite/archive/archive.test | 17 ++++++++++++++++- mysql-test/suite/archive/discover.result | 5 +++++ mysql-test/suite/archive/discover.test | 2 ++ 4 files changed, 51 insertions(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/suite/archive/archive.result b/mysql-test/suite/archive/archive.result index 9208b987df0..23636021d2a 100644 --- a/mysql-test/suite/archive/archive.result +++ b/mysql-test/suite/archive/archive.result @@ -12816,7 +12816,35 @@ DROP TABLE t1; create table t1 (a int, b char(50)) engine=archive; select * from t1; a b +flush tables; +select * from t1; +a b 1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa show warnings; Level Code Message drop table t1; +create temporary table t1 (a int) engine=archive; +insert t1 values (1),(2),(3); +select * from t1; +a +1 +2 +3 +show create table t1; +Table Create Table +t1 CREATE TEMPORARY TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 +alter table t1 add column b varchar(10); +select * from t1; +a b +1 NULL +2 NULL +3 NULL +show create table t1; +Table Create Table +t1 CREATE TEMPORARY TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` varchar(10) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 +drop table t1; diff --git a/mysql-test/suite/archive/archive.test b/mysql-test/suite/archive/archive.test index 01873de1e93..2acf8b9e6b5 100644 --- a/mysql-test/suite/archive/archive.test +++ b/mysql-test/suite/archive/archive.test @@ -1734,9 +1734,24 @@ DROP TABLE t1; --echo # BUG#917689 Using wrong archive table causes crash --echo # create table t1 (a int, b char(50)) engine=archive; +select * from t1; # open the table to create the frm +flush tables; # and close the table again --remove_file $MYSQLD_DATADIR/test/t1.ARZ copy_file std_data/t917689.ARZ $MYSQLD_DATADIR/test/t1.ARZ; -# --error 1194 +#--error ER_CRASHED_ON_USAGE select * from t1; show warnings; drop table t1; + +# +# temporary archive +# +create temporary table t1 (a int) engine=archive; +insert t1 values (1),(2),(3); +select * from t1; +show create table t1; +alter table t1 add column b varchar(10); +select * from t1; +show create table t1; +drop table t1; + diff --git a/mysql-test/suite/archive/discover.result b/mysql-test/suite/archive/discover.result index db8c3259f46..dc6d124d345 100644 --- a/mysql-test/suite/archive/discover.result +++ b/mysql-test/suite/archive/discover.result @@ -21,6 +21,8 @@ a # show tables # create table t2 (a int) engine=archive; +select * from t2; +a flush tables; show tables; Tables_in_test @@ -107,4 +109,7 @@ drop table t1; # archive_discover # create table `a/../`(a int) engine=archive; +select * from `a/../`; +a +flush tables; drop table `a/../`; diff --git a/mysql-test/suite/archive/discover.test b/mysql-test/suite/archive/discover.test index 6c1f563dfa8..8175511929f 100644 --- a/mysql-test/suite/archive/discover.test +++ b/mysql-test/suite/archive/discover.test @@ -18,6 +18,7 @@ select * from t1; --echo # show tables --echo # create table t2 (a int) engine=archive; +select * from t2; remove_file $mysqld_datadir/test/t1.frm; flush tables; show tables; @@ -84,6 +85,7 @@ drop table t1; --echo # archive_discover --echo # create table `a/../`(a int) engine=archive; +select * from `a/../`; flush tables; remove_file $mysqld_datadir/test/a@002f@002e@002e@002f.frm; drop table `a/../`; -- cgit v1.2.1