diff options
author | unknown <jimw@mysql.com> | 2005-04-05 20:55:06 -0700 |
---|---|---|
committer | unknown <jimw@mysql.com> | 2005-04-05 20:55:06 -0700 |
commit | 566460ac64e03b2d5f44961e352965ca24bdb911 (patch) | |
tree | b8285491e42dccf4487710f0b23b4056dbe867b9 | |
parent | 5cdec5d6ba0c3fac2fe312da3e98c9506091a0a7 (diff) | |
download | mariadb-git-566460ac64e03b2d5f44961e352965ca24bdb911.tar.gz |
Update tests after merge of bug fix.
mysql-test/r/null.result:
Update results
mysql-test/r/show_check.result:
Update results
mysql-test/r/strict.result:
Update results
mysql-test/t/null.test:
Fix default for smallint column.
mysql-test/t/show_check.test:
Fix default for bool column.
-rw-r--r-- | mysql-test/r/null.result | 2 | ||||
-rw-r--r-- | mysql-test/r/show_check.result | 16 | ||||
-rw-r--r-- | mysql-test/r/strict.result | 82 | ||||
-rw-r--r-- | mysql-test/t/null.test | 2 | ||||
-rw-r--r-- | mysql-test/t/show_check.test | 2 |
5 files changed, 52 insertions, 52 deletions
diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result index 806e2b6f254..c2b925072dd 100644 --- a/mysql-test/r/null.result +++ b/mysql-test/r/null.result @@ -88,7 +88,7 @@ b ifnull(t2.b,"this is null") NULL this is null NULL this is null drop table t1; -CREATE TABLE t1 (a varchar(16) NOT NULL default '', b smallint(6) NOT NULL default '', c datetime NOT NULL default '0000-00-00 00:00:00', d smallint(6) NOT NULL default 0); +CREATE TABLE t1 (a varchar(16) NOT NULL default '', b smallint(6) NOT NULL default 0, c datetime NOT NULL default '0000-00-00 00:00:00', d smallint(6) NOT NULL default 0); INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55"; Warnings: Warning 1265 Data truncated for column 'd' at row 1 diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 7c34481b519..add4e91c725 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -195,7 +195,7 @@ h float(3,2) NULL YES NULL select,insert,update,references i float(3,0) NULL YES NULL select,insert,update,references drop table t1; create table t1 ( -type_bool bool not null, +type_bool bool not null default 0, type_tiny tinyint not null auto_increment primary key, type_short smallint(3), type_mediumint mediumint, @@ -206,9 +206,9 @@ empty_char char(0), type_char char(2), type_varchar varchar(10), type_timestamp timestamp not null, -type_date date not null, -type_time time not null, -type_datetime datetime not null, +type_date date not null default '0000-00-00', +type_time time not null default '00:00:00', +type_datetime datetime not null default '0000-00-00 00:00:00', type_year year, type_enum enum ('red', 'green', 'blue'), type_set enum ('red', 'green', 'blue'), @@ -221,7 +221,7 @@ index(type_short) show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `type_bool` tinyint(1) NOT NULL, + `type_bool` tinyint(1) NOT NULL default '0', `type_tiny` tinyint(4) NOT NULL auto_increment, `type_short` smallint(3) default NULL, `type_mediumint` mediumint(9) default NULL, @@ -232,9 +232,9 @@ t1 CREATE TABLE `t1` ( `type_char` char(2) default NULL, `type_varchar` varchar(10) default NULL, `type_timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - `type_date` date NOT NULL, - `type_time` time NOT NULL, - `type_datetime` datetime NOT NULL, + `type_date` date NOT NULL default '0000-00-00', + `type_time` time NOT NULL default '00:00:00', + `type_datetime` datetime NOT NULL default '0000-00-00 00:00:00', `type_year` year(4) default NULL, `type_enum` enum('red','green','blue') default NULL, `type_set` enum('red','green','blue') default NULL, diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index 5e1768a207e..7d1b6b67fd2 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -1042,47 +1042,6 @@ col1 col2 3 99 DROP TABLE t1; -SET @@sql_mode = 'traditional'; -CREATE TABLE t1 (i int not null); -INSERT INTO t1 VALUES (); -ERROR HY000: Field 'i' doesn't have a default value -INSERT INTO t1 VALUES (DEFAULT); -ERROR HY000: Field 'i' doesn't have a default value -INSERT INTO t1 VALUES (DEFAULT(i)); -ERROR HY000: Field 'i' doesn't have a default value -ALTER TABLE t1 ADD j int; -INSERT INTO t1 SET j = 1; -ERROR HY000: Field 'i' doesn't have a default value -INSERT INTO t1 SET j = 1, i = DEFAULT; -ERROR HY000: Field 'i' doesn't have a default value -INSERT INTO t1 SET j = 1, i = DEFAULT(i); -ERROR HY000: Field 'i' doesn't have a default value -INSERT INTO t1 VALUES (DEFAULT,1); -ERROR HY000: Field 'i' doesn't have a default value -DROP TABLE t1; -SET @@sql_mode = ''; -CREATE TABLE t1 (i int not null); -INSERT INTO t1 VALUES (); -Warnings: -Warning 1364 Field 'i' doesn't have a default value -INSERT INTO t1 VALUES (DEFAULT); -Warnings: -Warning 1364 Field 'i' doesn't have a default value -INSERT INTO t1 VALUES (DEFAULT(i)); -ERROR HY000: Field 'i' doesn't have a default value -ALTER TABLE t1 ADD j int; -INSERT INTO t1 SET j = 1; -Warnings: -Warning 1364 Field 'i' doesn't have a default value -INSERT INTO t1 SET j = 1, i = DEFAULT; -Warnings: -Warning 1364 Field 'i' doesn't have a default value -INSERT INTO t1 SET j = 1, i = DEFAULT(i); -ERROR HY000: Field 'i' doesn't have a default value -INSERT INTO t1 VALUES (DEFAULT,1); -Warnings: -Warning 1364 Field 'i' doesn't have a default value -DROP TABLE t1; set sql_mode='traditional'; create table t1 (charcol char(255), varcharcol varchar(255), binarycol binary(255), varbinarycol varbinary(255), tinytextcol tinytext, @@ -1232,3 +1191,44 @@ col1 drop procedure t1; drop table t1; set sql_mode=@org_mode; +SET @@sql_mode = 'traditional'; +CREATE TABLE t1 (i int not null); +INSERT INTO t1 VALUES (); +ERROR HY000: Field 'i' doesn't have a default value +INSERT INTO t1 VALUES (DEFAULT); +ERROR HY000: Field 'i' doesn't have a default value +INSERT INTO t1 VALUES (DEFAULT(i)); +ERROR HY000: Field 'i' doesn't have a default value +ALTER TABLE t1 ADD j int; +INSERT INTO t1 SET j = 1; +ERROR HY000: Field 'i' doesn't have a default value +INSERT INTO t1 SET j = 1, i = DEFAULT; +ERROR HY000: Field 'i' doesn't have a default value +INSERT INTO t1 SET j = 1, i = DEFAULT(i); +ERROR HY000: Field 'i' doesn't have a default value +INSERT INTO t1 VALUES (DEFAULT,1); +ERROR HY000: Field 'i' doesn't have a default value +DROP TABLE t1; +SET @@sql_mode = ''; +CREATE TABLE t1 (i int not null); +INSERT INTO t1 VALUES (); +Warnings: +Warning 1364 Field 'i' doesn't have a default value +INSERT INTO t1 VALUES (DEFAULT); +Warnings: +Warning 1364 Field 'i' doesn't have a default value +INSERT INTO t1 VALUES (DEFAULT(i)); +ERROR HY000: Field 'i' doesn't have a default value +ALTER TABLE t1 ADD j int; +INSERT INTO t1 SET j = 1; +Warnings: +Warning 1364 Field 'i' doesn't have a default value +INSERT INTO t1 SET j = 1, i = DEFAULT; +Warnings: +Warning 1364 Field 'i' doesn't have a default value +INSERT INTO t1 SET j = 1, i = DEFAULT(i); +ERROR HY000: Field 'i' doesn't have a default value +INSERT INTO t1 VALUES (DEFAULT,1); +Warnings: +Warning 1364 Field 'i' doesn't have a default value +DROP TABLE t1; diff --git a/mysql-test/t/null.test b/mysql-test/t/null.test index 934b165f604..4cd20979319 100644 --- a/mysql-test/t/null.test +++ b/mysql-test/t/null.test @@ -59,7 +59,7 @@ drop table t1; # # Test inserting and updating with NULL # -CREATE TABLE t1 (a varchar(16) NOT NULL default '', b smallint(6) NOT NULL default '', c datetime NOT NULL default '0000-00-00 00:00:00', d smallint(6) NOT NULL default 0); +CREATE TABLE t1 (a varchar(16) NOT NULL default '', b smallint(6) NOT NULL default 0, c datetime NOT NULL default '0000-00-00 00:00:00', d smallint(6) NOT NULL default 0); INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55"; UPDATE t1 SET d=1/NULL; UPDATE t1 SET d=NULL; diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index 0004591288f..558adab5313 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -106,7 +106,7 @@ drop table t1; # Do a create table that tries to cover all types and options # create table t1 ( -type_bool bool not null default false, +type_bool bool not null default 0, type_tiny tinyint not null auto_increment primary key, type_short smallint(3), type_mediumint mediumint, |