diff options
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/mysql-test-run.sh | 6 | ||||
-rw-r--r-- | mysql-test/r/alter_table.result | 5 | ||||
-rw-r--r-- | mysql-test/r/check.result | 2 | ||||
-rw-r--r-- | mysql-test/r/create.result | 4 | ||||
-rw-r--r-- | mysql-test/r/variables.result | 4 | ||||
-rw-r--r-- | mysql-test/t/alter_table.test | 11 | ||||
-rw-r--r-- | mysql-test/t/check.test | 18 | ||||
-rw-r--r-- | mysql-test/t/create.test | 12 | ||||
-rw-r--r-- | mysql-test/t/variables.test | 4 |
9 files changed, 63 insertions, 3 deletions
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index dd9fa8514ee..4d410dace50 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -155,6 +155,10 @@ while test $# -gt 0; do EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" SLEEP_TIME=`$ECHO "$1" | $SED -e "s;--sleep=;;"` ;; + --mysqld=*) + TMP=`$ECHO "$1" | $SED -e "s;--mysqld-=;"` + EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $TMP" + ;; --gcov ) if [ x$BINARY_DIST = x1 ] ; then $ECHO "Cannot do coverage test without the source - please use source dist" @@ -170,6 +174,7 @@ while test $# -gt 0; do $ECHO "Note: you will get more meaningful output on a source distribution compiled with debugging option when running tests with --gdb option" fi DO_GDB=1 + USE_RUNNING_SERVER="" ;; --client-gdb ) if [ x$BINARY_DIST = x1 ] ; then @@ -182,6 +187,7 @@ while test $# -gt 0; do $ECHO "Note: you will get more meaningful output on a source distribution compiled with debugging option when running tests with --ddd option" fi DO_DDD=1 + USE_RUNNING_SERVER="" ;; --skip-*) EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT $1" diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 4f12f71c7ce..dbdbb7f57a9 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -27,3 +27,8 @@ n 12 Table Op Msg_type Msg_text test.t1 optimize status OK +i +1 +2 +3 +4 diff --git a/mysql-test/r/check.result b/mysql-test/r/check.result new file mode 100644 index 00000000000..694d7429a14 --- /dev/null +++ b/mysql-test/r/check.result @@ -0,0 +1,2 @@ +Table Op Msg_type Msg_text +test.t1 check status OK diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index f32c9b0bc80..7940d51868a 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -8,3 +8,7 @@ b 1 10000000001 a$1 $b c$ 1 2 3 +table type possible_keys key key_len ref rows Extra +t2 ref B B 21 const 1 where used +a B +3 world diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index ee04e437bb7..f852378e6a1 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -1,7 +1,7 @@ @test @`select` @TEST @not_used 1 2 3 NULL @test_int @test_double @test_string @test_string2 @select -10 0.00 abcdeghi abcdefghij NULL +10 1e-10 abcdeghi abcdefghij NULL @test_int @test_double @test_string @test_string2 hello hello hello hello @test_int @test_double @test_string @test_string2 @@ -10,3 +10,5 @@ hellohello hellohello hellohello hellohello NULL NULL NULL NULL @t1:=(@t2:=1)+@t3:=4 @t1 @t2 @t3 5 5 1 4 +@t5 +1.23456 diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 25cd0de6325..a47d206932c 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -71,7 +71,6 @@ ALTER TABLE t1 ADD Column new_col int not null; UNLOCK TABLES; OPTIMIZE TABLE t1; DROP TABLE t1; -drop table if exists t1; # # ALTER TABLE ... ENABLE/DISABLE KEYS @@ -91,3 +90,13 @@ while ($1) } alter table t1 enable keys; drop table t1; + +# +# Drop and add an auto_increment column +# + +create table t1 (i int unsigned not null auto_increment primary key); +insert into t1 values (null),(null),(null),(null); +alter table t1 drop i,add i int unsigned not null auto_increment, drop primary key, add primary key (i); +select * from t1; +drop table t1; diff --git a/mysql-test/t/check.test b/mysql-test/t/check.test new file mode 100644 index 00000000000..e65a61d86da --- /dev/null +++ b/mysql-test/t/check.test @@ -0,0 +1,18 @@ +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); +connection con1; +drop table if exists t1; +#add a lot of keys to slow down check +create table t1(n int not null, key(n), key(n), key(n), key(n)); +let $1=10000; +while ($1) +{ + eval insert into t1 values ($1); + dec $1; +} +send check table t1 type=extended; +connection con2; +insert into t1 values (200000); +connection con1; +reap; + diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index a5224cd0318..d45d013c9fb 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -2,6 +2,7 @@ # Check some special create statements. # +drop table if exists t1,t2; create table t1 (b char(0)); insert into t1 values (""),(null); select * from t1; @@ -57,3 +58,14 @@ select a$1, $b, c$ from test_$1.$test1; create table test_$1.test2$ (a int); drop table test_$1.test2$; drop database test_$1; + +# +# Test of CREATE ... SELECT with indexes +# + +create table t1 (a int auto_increment not null primary key, B CHAR(20)); +insert into t1 (b) values ("hello"),("my"),("world"); +create table t2 (key (b)) select * from t1; +explain select * from t2 where b="world"; +select * from t2 where b="world"; +drop table t1,t2; diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 1067559b759..d5ff64d199b 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -1,7 +1,7 @@ # # test variables # -set @`test`=1,@TEST=3,@select=2; +set @`test`=1,@TEST=3,@select=2,@t5=1.23456; select @test,@`select`,@TEST,@not_used; set @test_int=10,@test_double=1e-10,@test_string="abcdeghi",@test_string2="abcdefghij",@select=NULL; select @test_int,@test_double,@test_string,@test_string2,@select; @@ -12,3 +12,5 @@ select @test_int,@test_double,@test_string,@test_string2; set @test_int=null,@test_double=null,@test_string=null,@test_string2=null; select @test_int,@test_double,@test_string,@test_string2; select @t1:=(@t2:=1)+@t3:=4,@t1,@t2,@t3; +select @t5; + |