diff options
author | Sergei Golubchik <sergii@pisem.net> | 2010-11-25 18:17:28 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2010-11-25 18:17:28 +0100 |
commit | 65ca700def99289cc31a7040537f5aa6e12bf485 (patch) | |
tree | 97b3a07299b626c519da0e80c122b5b79b933914 /mysql-test/t/alter_table.test | |
parent | 2ab57de38d13d927ddff2d51aed4af34e13998f5 (diff) | |
parent | 6e5bcca7935d3c62f84bb640e5357664a210ee12 (diff) | |
download | mariadb-git-65ca700def99289cc31a7040537f5aa6e12bf485.tar.gz |
merge.
checkpoint.
does not compile.
Diffstat (limited to 'mysql-test/t/alter_table.test')
-rw-r--r-- | mysql-test/t/alter_table.test | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 5b5fdf50c16..c60ca592580 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -121,11 +121,15 @@ alter table t1 disable keys; show keys from t1; #let $1=10000; let $1=10; +--disable_query_log +begin; while ($1) { eval insert into t1 values($1,RAND()*1000,RAND()*1000,RAND()); dec $1; } +commit; +--enable_query_log alter table t1 enable keys; show keys from t1; drop table t1; @@ -144,11 +148,15 @@ drop table t1; create table t1 (a int, b int); let $1=100; +--disable_query_log +begin; while ($1) { eval insert into t1 values(1,$1), (2,$1), (3, $1); dec $1; } +commit; +--enable_query_log alter table t1 add unique (a,b), add key (b); show keys from t1; analyze table t1; @@ -159,7 +167,7 @@ drop table t1; # Test of ALTER TABLE DELAYED # -CREATE TABLE t1 (i int(10), index(i) ); +CREATE TABLE t1 (i int(10), index(i) ) ENGINE=MyISAM; ALTER TABLE t1 DISABLE KEYS; INSERT DELAYED INTO t1 VALUES(1),(2),(3); ALTER TABLE t1 ENABLE KEYS; @@ -966,12 +974,14 @@ DROP TABLE t1; create table t1(f1 int not null, f2 int not null, key (f1), key (f2)); let $count= 50; --disable_query_log +begin; while ($count) { EVAL insert into t1 values (1,1),(1,1),(1,1),(1,1),(1,1); EVAL insert into t1 values (2,2),(2,2),(2,2),(2,2),(2,2); dec $count ; } +commit; --enable_query_log select index_length into @unpaked_keys_size from @@ -1000,6 +1010,23 @@ ALTER TABLE t1 MODIFY b ENUM('a', 'z', 'b', 'c') NOT NULL; SELECT * FROM t1; DROP TABLE t1; +# +# Test for ALTER column DROP DEFAULT +# + +SET @save_sql_mode=@@sql_mode; +SET sql_mode=strict_all_tables; + +CREATE TABLE t1 (a int NOT NULL default 42); +INSERT INTO t1 values (); +SELECT * FROM t1; +ALTER TABLE t1 ALTER COLUMN a DROP DEFAULT; +--error 1364 +INSERT INTO t1 values (); +INSERT INTO t1 (a) VALUES (11); +SELECT * FROM t1 ORDER BY a; +DROP TABLE t1; +SET @@sql_mode=@save_sql_mode; --echo # --echo # Bug#45567: Fast ALTER TABLE broken for enum and set --echo # |