diff options
author | Monty <monty@mariadb.org> | 2015-08-18 00:42:08 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2015-08-18 11:18:57 +0300 |
commit | 6b20342651bb5207b6c125d2d11b664a1bebcc41 (patch) | |
tree | 2f2e6ca60f3e45239224909eed19b907614f5054 /mysql-test/r/cast.result | |
parent | 92fd65832727162a003647b4c48344dc9567ce84 (diff) | |
download | mariadb-git-6b20342651bb5207b6c125d2d11b664a1bebcc41.tar.gz |
Ensure that fields declared with NOT NULL doesn't have DEFAULT values if not specified and if not timestamp or auto_increment
In original code, sometimes one got an automatic DEFAULT value in some cases, in other cases not.
For example:
create table t1 (a int primary key) - No default
create table t2 (a int, primary key(a)) - DEFAULT 0
create table t1 SELECT .... - Default for all fields, even if they where defined as NOT NULL
ALTER TABLE ... MODIFY could sometimes add an unexpected DEFAULT value.
The patch is quite big because we had some many test cases that used
CREATE ... SELECT or CREATE ... (...PRIMARY KEY(xxx)) which doesn't have an automatic DEFAULT anymore.
Other things:
- Removed warnings from InnoDB when waiting from semaphore (got this when testing things with --big)
Diffstat (limited to 'mysql-test/r/cast.result')
-rw-r--r-- | mysql-test/r/cast.result | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index 7d89a476e21..5ea8f2b6d8c 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -404,7 +404,7 @@ create table t1 select cast(_koi8r'ΤΕΣΤ' as char character set cp1251) as t; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `t` varchar(4) CHARACTER SET cp1251 NOT NULL DEFAULT '' + `t` varchar(4) CHARACTER SET cp1251 NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select @@ -438,11 +438,11 @@ ab a ab a 6100 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` varbinary(2) NOT NULL DEFAULT '', - `c2` varbinary(2) NOT NULL DEFAULT '', - `c3` varbinary(2) NOT NULL DEFAULT '', - `c4` varbinary(2) NOT NULL DEFAULT '', - `c5` varbinary(2) NOT NULL DEFAULT '' + `c1` varbinary(2) NOT NULL, + `c2` varbinary(2) NOT NULL, + `c3` varbinary(2) NOT NULL, + `c4` varbinary(2) NOT NULL, + `c5` varbinary(2) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select @@ -471,11 +471,11 @@ c1 c2 c3 c4 c5 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '', - `c2` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '', - `c3` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '', - `c4` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '', - `c5` varchar(2) CHARACTER SET utf8 NOT NULL DEFAULT '' + `c1` varchar(2) CHARACTER SET utf8 NOT NULL, + `c2` varchar(2) CHARACTER SET utf8 NOT NULL, + `c3` varchar(2) CHARACTER SET utf8 NOT NULL, + `c4` varchar(2) CHARACTER SET utf8 NOT NULL, + `c5` varchar(2) CHARACTER SET utf8 NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a binary(4), b char(4) character set koi8r); @@ -582,12 +582,12 @@ create table t1 select cast(1 as unsigned), cast(1 as signed), cast(1 as double show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `cast(1 as unsigned)` int(1) unsigned NOT NULL DEFAULT '0', - `cast(1 as signed)` int(1) NOT NULL DEFAULT '0', + `cast(1 as unsigned)` int(1) unsigned NOT NULL, + `cast(1 as signed)` int(1) NOT NULL, `cast(1 as double(5,2))` double(5,2) DEFAULT NULL, - `cast(1 as decimal(5,3))` decimal(5,3) NOT NULL DEFAULT '0.000', - `cast("A" as binary)` varbinary(1) NOT NULL DEFAULT '', - `cast("A" as char(100))` varbinary(100) NOT NULL DEFAULT '', + `cast(1 as decimal(5,3))` decimal(5,3) NOT NULL, + `cast("A" as binary)` varbinary(1) NOT NULL, + `cast("A" as char(100))` varbinary(100) NOT NULL, `cast("2001-1-1" as DATE)` date DEFAULT NULL, `cast("2001-1-1" as DATETIME)` datetime DEFAULT NULL, `cast("1:2:3" as TIME)` time DEFAULT NULL @@ -751,8 +751,8 @@ Warning 1292 Truncated incorrect INTEGER value: '9999999999999999999999999999999 SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `CONCAT(CAST(REPEAT('9', 1000) AS SIGNED))` varchar(21) NOT NULL DEFAULT '', - `CONCAT(CAST(REPEAT('9', 1000) AS UNSIGNED))` varchar(21) NOT NULL DEFAULT '' + `CONCAT(CAST(REPEAT('9', 1000) AS SIGNED))` varchar(21) NOT NULL, + `CONCAT(CAST(REPEAT('9', 1000) AS UNSIGNED))` varchar(21) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; # End of test for Bug#13581962, Bug#14096619 |