← Back to team overview

maria-developers team mailing list archive

bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (monty:2711)

 

#At lp:maria based on revid:monty@xxxxxxxxxxxx-20090605204623-ptvh44epiw0pyoj6

 2711 Michael Widenius	2009-06-07
      Added tests to cover more server code
      Author: Stewart Smith
      modified:
        mysql-test/r/alter_table.result
        mysql-test/r/limit.result
        mysql-test/t/alter_table.test
        mysql-test/t/limit.test

per-file messages:
  mysql-test/r/alter_table.result
    Testing of ALTER TABLE .. DROP DEFAULT
  mysql-test/r/limit.result
    Testing of LIMIT ... OFFSET
  mysql-test/t/alter_table.test
    Testing of ALTER TABLE .. DROP DEFAULT
  mysql-test/t/limit.test
    Testing of LIMIT ... OFFSET
=== modified file 'mysql-test/r/alter_table.result'
--- a/mysql-test/r/alter_table.result	2009-02-19 09:01:25 +0000
+++ b/mysql-test/r/alter_table.result	2009-06-07 10:05:19 +0000
@@ -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

=== modified file 'mysql-test/r/limit.result'
--- a/mysql-test/r/limit.result	2008-10-15 21:34:51 +0000
+++ b/mysql-test/r/limit.result	2009-06-07 10:05:19 +0000
@@ -113,4 +113,36 @@ ERROR HY000: Incorrect arguments to EXEC
 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

=== modified file 'mysql-test/t/alter_table.test'
--- a/mysql-test/t/alter_table.test	2009-02-19 09:01:25 +0000
+++ b/mysql-test/t/alter_table.test	2009-06-07 10:05:19 +0000
@@ -1000,4 +1000,22 @@ ALTER TABLE t1 MODIFY b ENUM('a', 'z', '
 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

=== modified file 'mysql-test/t/limit.test'
--- a/mysql-test/t/limit.test	2008-10-16 01:50:56 +0000
+++ b/mysql-test/t/limit.test	2009-06-07 10:05:19 +0000
@@ -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