List:Commits« Previous MessageNext Message »
From:Jon Olav Hauglid Date:May 19 2009 12:53pm
Subject:bzr commit into mysql-6.0 branch (jon.hauglid:2779)
View as plain text  
#At file:///export/home/z/mysql-6.0-runtime-mytest/ based on revid:alik@stripped

 2779 Jon Olav Hauglid	2009-05-19
      Two test cases added. One for ALTER column DROP DEFAULT and one 
      for LIMIT X OFFSET Y.

    modified:
      mysql-test/r/parser.result
      mysql-test/t/parser.test
=== modified file 'mysql-test/r/parser.result'
--- a/mysql-test/r/parser.result	2009-05-11 17:58:07 +0000
+++ b/mysql-test/r/parser.result	2009-05-19 12:52:58 +0000
@@ -663,3 +663,54 @@ drop tablespace ndb_ts1 engine=myisam;
 ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
 drop tablespace ndb_ts1;
 ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+DROP TABLE IF EXISTS 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;
+DROP TABLE IF EXISTS t1;
+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;

=== modified file 'mysql-test/t/parser.test'
--- a/mysql-test/t/parser.test	2009-05-11 17:58:07 +0000
+++ b/mysql-test/t/parser.test	2009-05-19 12:52:58 +0000
@@ -811,3 +811,42 @@ drop logfile group ndb_lg1;
 drop tablespace ndb_ts1 engine=myisam;
 -- error ER_ILLEGAL_HA_CREATE_OPTION
 drop tablespace ndb_ts1;
+
+#
+# Test for ALTER column DROP DEFAULT
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+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 ER_NO_DEFAULT_FOR_FIELD
+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;
+
+#
+# Test for LIMIT X OFFSET Y
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+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;


Attachment: [text/bzr-bundle] bzr/jon.hauglid@sun.com-20090519125258-g0rgl2z4ckbtj98d.bundle
Thread
bzr commit into mysql-6.0 branch (jon.hauglid:2779) Jon Olav Hauglid19 May
  • Re: bzr commit into mysql-6.0 branch (jon.hauglid:2779)Konstantin Osipov20 May