Commit 2f398fc3 authored by jimw@mysql.com's avatar jimw@mysql.com

Update tests after merge of bug fix.

parent b95cb4e6
...@@ -88,7 +88,7 @@ b ifnull(t2.b,"this is null") ...@@ -88,7 +88,7 @@ b ifnull(t2.b,"this is null")
NULL this is null NULL this is null
NULL this is null NULL this is null
drop table t1; 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"; INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55";
Warnings: Warnings:
Warning 1265 Data truncated for column 'd' at row 1 Warning 1265 Data truncated for column 'd' at row 1
......
...@@ -195,7 +195,7 @@ h float(3,2) NULL YES NULL select,insert,update,references ...@@ -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 i float(3,0) NULL YES NULL select,insert,update,references
drop table t1; drop table t1;
create 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_tiny tinyint not null auto_increment primary key,
type_short smallint(3), type_short smallint(3),
type_mediumint mediumint, type_mediumint mediumint,
...@@ -206,9 +206,9 @@ empty_char char(0), ...@@ -206,9 +206,9 @@ empty_char char(0),
type_char char(2), type_char char(2),
type_varchar varchar(10), type_varchar varchar(10),
type_timestamp timestamp not null, type_timestamp timestamp not null,
type_date date not null, type_date date not null default '0000-00-00',
type_time time not null, type_time time not null default '00:00:00',
type_datetime datetime not null, type_datetime datetime not null default '0000-00-00 00:00:00',
type_year year, type_year year,
type_enum enum ('red', 'green', 'blue'), type_enum enum ('red', 'green', 'blue'),
type_set enum ('red', 'green', 'blue'), type_set enum ('red', 'green', 'blue'),
...@@ -221,7 +221,7 @@ index(type_short) ...@@ -221,7 +221,7 @@ index(type_short)
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( 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_tiny` tinyint(4) NOT NULL auto_increment,
`type_short` smallint(3) default NULL, `type_short` smallint(3) default NULL,
`type_mediumint` mediumint(9) default NULL, `type_mediumint` mediumint(9) default NULL,
...@@ -232,9 +232,9 @@ t1 CREATE TABLE `t1` ( ...@@ -232,9 +232,9 @@ t1 CREATE TABLE `t1` (
`type_char` char(2) default NULL, `type_char` char(2) default NULL,
`type_varchar` varchar(10) default NULL, `type_varchar` varchar(10) default NULL,
`type_timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, `type_timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`type_date` date NOT NULL, `type_date` date NOT NULL default '0000-00-00',
`type_time` time NOT NULL, `type_time` time NOT NULL default '00:00:00',
`type_datetime` datetime NOT NULL, `type_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
`type_year` year(4) default NULL, `type_year` year(4) default NULL,
`type_enum` enum('red','green','blue') default NULL, `type_enum` enum('red','green','blue') default NULL,
`type_set` enum('red','green','blue') default NULL, `type_set` enum('red','green','blue') default NULL,
......
...@@ -1042,47 +1042,6 @@ col1 col2 ...@@ -1042,47 +1042,6 @@ col1 col2
3 3
99 99
DROP TABLE t1; 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'; set sql_mode='traditional';
create table t1 (charcol char(255), varcharcol varchar(255), create table t1 (charcol char(255), varcharcol varchar(255),
binarycol binary(255), varbinarycol varbinary(255), tinytextcol tinytext, binarycol binary(255), varbinarycol varbinary(255), tinytextcol tinytext,
...@@ -1232,3 +1191,44 @@ col1 ...@@ -1232,3 +1191,44 @@ col1
drop procedure t1; drop procedure t1;
drop table t1; drop table t1;
set sql_mode=@org_mode; 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;
...@@ -59,7 +59,7 @@ drop table t1; ...@@ -59,7 +59,7 @@ drop table t1;
# #
# Test inserting and updating with NULL # 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"; INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55";
UPDATE t1 SET d=1/NULL; UPDATE t1 SET d=1/NULL;
UPDATE t1 SET d=NULL; UPDATE t1 SET d=NULL;
......
...@@ -106,7 +106,7 @@ drop table t1; ...@@ -106,7 +106,7 @@ drop table t1;
# Do a create table that tries to cover all types and options # Do a create table that tries to cover all types and options
# #
create table t1 ( 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_tiny tinyint not null auto_increment primary key,
type_short smallint(3), type_short smallint(3),
type_mediumint mediumint, type_mediumint mediumint,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment