diff options
author | igor@olga.mysql.com <> | 2007-06-03 22:52:02 -0700 |
---|---|---|
committer | igor@olga.mysql.com <> | 2007-06-03 22:52:02 -0700 |
commit | ca49b83d5a3cd1bd0e214f5f3c92772e3849c265 (patch) | |
tree | 9bfac4f842371d84eebd379e361ab3df1e3bf0f0 /mysql-test/r/alter_table.result | |
parent | 6044940b258a964e19264e466fd4fd044dc495d3 (diff) | |
parent | b642eb121f7ca52706191d827595a9ed2538b3be (diff) | |
download | mariadb-git-ca49b83d5a3cd1bd0e214f5f3c92772e3849c265.tar.gz |
Merge olga.mysql.com:/home/igor/mysql-5.1
into olga.mysql.com:/home/igor/mysql-5.1-opt-merge
Diffstat (limited to 'mysql-test/r/alter_table.result')
-rw-r--r-- | mysql-test/r/alter_table.result | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 63dc13a4b6d..a9c01f308f7 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -846,6 +846,25 @@ id 50 51 drop table t1; +set @orig_sql_mode = @@sql_mode; +set sql_mode="no_zero_date"; +create table t1(f1 int); +alter table t1 add column f2 datetime not null, add column f21 date not null; +insert into t1 values(1,'2000-01-01','2000-01-01'); +alter table t1 add column f3 datetime not null; +ERROR 22007: Incorrect datetime value: '0000-00-00 00:00:00' for column 'f3' at row 1 +alter table t1 add column f3 date not null; +ERROR 22007: Incorrect date value: '0000-00-00' for column 'f3' at row 1 +alter table t1 add column f4 datetime not null default '2002-02-02', +add column f41 date not null; +ERROR 22007: Incorrect date value: '0000-00-00' for column 'f41' at row 1 +alter table t1 add column f4 datetime not null default '2002-02-02', +add column f41 date not null default '2002-02-02'; +select * from t1; +f1 f2 f21 f4 f41 +1 2000-01-01 00:00:00 2000-01-01 2002-02-02 00:00:00 2002-02-02 +drop table t1; +set sql_mode= @orig_sql_mode; create table t1 (v varchar(32)); insert into t1 values ('def'),('abc'),('hij'),('3r4f'); select * from t1; @@ -1137,3 +1156,17 @@ Field Type Null Key Default Extra unsigned_int_field bigint(20) unsigned NO MUL char_field char(10) YES NULL DROP TABLE t2; +CREATE TABLE t1 (f1 INT, f2 INT, f3 INT); +INSERT INTO t1 VALUES (1, 2, NULL); +SELECT * FROM t1; +f1 f2 f3 +1 2 NULL +ALTER TABLE t1 MODIFY COLUMN f3 INT AFTER f1; +SELECT * FROM t1; +f1 f3 f2 +1 NULL 2 +ALTER TABLE t1 MODIFY COLUMN f3 INT AFTER f2; +SELECT * FROM t1; +f1 f2 f3 +1 2 NULL +DROP TABLE t1; |