MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Alexander Nozdrin Date:February 6 2008 11:55am
Subject:bk commit into 5.1 tree (anozdrin:1.2520) BUG#21380
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of anozdrin.  When anozdrin does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-02-06 14:55:19+03:00, anozdrin@quad. +2 -0
  Add a test case for Bug#21380: DEFAULT definition not always
  transfered by CREATE TABLE/SELECT to the new table.

  mysql-test/r/create.result@stripped, 2008-02-06 14:55:18+03:00, anozdrin@quad. +46 -0
    Update result file.

  mysql-test/t/create.test@stripped, 2008-02-06 14:55:18+03:00, anozdrin@quad. +44 -0
    Add a test case for Bug#21380: DEFAULT definition not always
    transfered by CREATE TABLE/SELECT to the new table.

diff -Nrup a/mysql-test/r/create.result b/mysql-test/r/create.result
--- a/mysql-test/r/create.result	2007-12-13 14:49:51 +03:00
+++ b/mysql-test/r/create.result	2008-02-06 14:55:18 +03:00
@@ -1743,4 +1743,50 @@ t1	CREATE TABLE `t1` (
   `MAXLEN` bigint(3) NOT NULL DEFAULT '0'
 ) ENGINE=MEMORY DEFAULT CHARSET=utf8
 drop table t1;
+
+# --
+# -- Bug#21380: DEFAULT definition not always transfered by CREATE
+# -- TABLE/SELECT to the new table.
+# --
+
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+
+CREATE TABLE t1(
+c1 INT DEFAULT 12 COMMENT 'column1',
+c2 INT NULL COMMENT 'column2',
+c3 INT NOT NULL COMMENT 'column3',
+c4 VARCHAR(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
+c5 VARCHAR(255) COLLATE utf8_unicode_ci NULL DEFAULT 'b',
+c6 VARCHAR(255))
+COLLATE ucs2_unicode_ci;
+
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `c1` int(11) DEFAULT '12' COMMENT 'column1',
+  `c2` int(11) DEFAULT NULL COMMENT 'column2',
+  `c3` int(11) NOT NULL COMMENT 'column3',
+  `c4` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
+  `c5` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'b',
+  `c6` varchar(255) COLLATE ucs2_unicode_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=ucs2 COLLATE=ucs2_unicode_ci
+
+CREATE TABLE t2 AS SELECT * FROM t1;
+
+SHOW CREATE TABLE t2;
+Table	Create Table
+t2	CREATE TABLE `t2` (
+  `c1` int(11) DEFAULT '12' COMMENT 'column1',
+  `c2` int(11) DEFAULT NULL COMMENT 'column2',
+  `c3` int(11) NOT NULL COMMENT 'column3',
+  `c4` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
+  `c5` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'b',
+  `c6` varchar(255) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+DROP TABLE t2;
+
+# -- End of test case for Bug#21380.
+
 End of 5.1 tests
diff -Nrup a/mysql-test/t/create.test b/mysql-test/t/create.test
--- a/mysql-test/t/create.test	2007-12-13 14:49:52 +03:00
+++ b/mysql-test/t/create.test	2008-02-06 14:55:18 +03:00
@@ -1341,4 +1341,48 @@ create table t1 like information_schema.
 show create table t1;
 drop table t1;
 
+--echo
+--echo # --
+--echo # -- Bug#21380: DEFAULT definition not always transfered by CREATE
+--echo # -- TABLE/SELECT to the new table.
+--echo # --
+--echo
+
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+--enable_warnings
+
+--echo
+
+CREATE TABLE t1(
+  c1 INT DEFAULT 12 COMMENT 'column1',
+  c2 INT NULL COMMENT 'column2',
+  c3 INT NOT NULL COMMENT 'column3',
+  c4 VARCHAR(255) CHARACTER SET utf8 NOT NULL DEFAULT 'a',
+  c5 VARCHAR(255) COLLATE utf8_unicode_ci NULL DEFAULT 'b',
+  c6 VARCHAR(255))
+  COLLATE ucs2_unicode_ci;
+
+--echo
+
+SHOW CREATE TABLE t1;
+
+--echo
+
+CREATE TABLE t2 AS SELECT * FROM t1;
+
+--echo
+
+SHOW CREATE TABLE t2;
+
+--echo
+
+DROP TABLE t2;
+
+--echo
+--echo # -- End of test case for Bug#21380.
+--echo
+
 --echo End of 5.1 tests
Thread
bk commit into 5.1 tree (anozdrin:1.2520) BUG#21380Alexander Nozdrin6 Feb