diff options
-rw-r--r-- | mysql-test/r/alter_table.result | 17 | ||||
-rw-r--r-- | mysql-test/r/limit.result | 32 | ||||
-rw-r--r-- | mysql-test/t/alter_table.test | 18 | ||||
-rw-r--r-- | mysql-test/t/limit.test | 12 |
4 files changed, 79 insertions, 0 deletions
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 2a784d984ed..18c137614fc 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -1268,4 +1268,21 @@ a b 4 b 5 a DROP TABLE t1; +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; +a +42 +ALTER TABLE t1 ALTER COLUMN a DROP DEFAULT; +INSERT INTO t1 values (); +ERROR HY000: Field 'a' doesn't have a default value +INSERT INTO t1 (a) VALUES (11); +SELECT * FROM t1 ORDER BY a; +a +11 +42 +DROP TABLE t1; +SET @@sql_mode=@save_sql_mode; End of 5.1 tests diff --git a/mysql-test/r/limit.result b/mysql-test/r/limit.result index caed588acdb..176a93c7a46 100644 --- a/mysql-test/r/limit.result +++ b/mysql-test/r/limit.result @@ -113,4 +113,36 @@ ERROR HY000: Incorrect arguments to EXECUTE End of 5.0 tests select 1 as a limit 4294967296,10; a +CREATE TABLE t1 (a int PRIMARY KEY auto_increment); +INSERT INTO t1 VALUES (),(),(),(),(),(),(),(),(),(); +INSERT INTO t1 VALUES (),(),(),(),(),(),(),(),(),(); +SELECT a FROM t1 ORDER BY a LIMIT 10 OFFSET 1; +a +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +SELECT a FROM t1 ORDER BY a LIMIT 10 OFFSET 10; +a +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +SELECT a FROM t1 ORDER BY a LIMIT 2 OFFSET 14; +a +15 +16 +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 2498d566f66..5233d64f44a 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -1000,4 +1000,22 @@ 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 End of 5.1 tests diff --git a/mysql-test/t/limit.test b/mysql-test/t/limit.test index 5847b90367a..4dbe13096d4 100644 --- a/mysql-test/t/limit.test +++ b/mysql-test/t/limit.test @@ -102,4 +102,16 @@ execute s using @a, @a; select 1 as a limit 4294967296,10; +# +# Test for LIMIT X OFFSET Y +# + +CREATE TABLE t1 (a int PRIMARY KEY auto_increment); +INSERT INTO t1 VALUES (),(),(),(),(),(),(),(),(),(); +INSERT INTO t1 VALUES (),(),(),(),(),(),(),(),(),(); +SELECT a FROM t1 ORDER BY a LIMIT 10 OFFSET 1; +SELECT a FROM t1 ORDER BY a LIMIT 10 OFFSET 10; +SELECT a FROM t1 ORDER BY a LIMIT 2 OFFSET 14; +DROP TABLE t1; + --echo End of 5.1 tests |