summaryrefslogtreecommitdiff
path: root/mysql-test/t/alter_table.test
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2007-05-23 13:46:10 +0400
committerunknown <evgen@moonbone.local>2007-05-23 13:46:10 +0400
commit18580a32009e6146389ca2dc93a7c8e58349d491 (patch)
tree1b70bd1e5505075b711cb82eaf168252153c30ea /mysql-test/t/alter_table.test
parentacd939c3d27907e5c00dd2bde81a2c4a364cea8b (diff)
parentf7f593ae7dde682e449fe81d946a83f74f0deb6a (diff)
downloadmariadb-git-18580a32009e6146389ca2dc93a7c8e58349d491.tar.gz
Merge moonbone.local:/mnt/gentoo64/work/bk-trees/mysql-5.0-opt
into moonbone.local:/mnt/gentoo64/work/test-5.1-opt-mysql mysql-test/r/func_gconcat.result: Auto merged mysql-test/t/func_gconcat.test: Auto merged sql/item_sum.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_select.cc: Auto merged sql/table.h: Auto merged mysql-test/r/alter_table.result: Manual merge mysql-test/t/alter_table.test: Manual merge sql/sql_table.cc: Manual merge
Diffstat (limited to 'mysql-test/t/alter_table.test')
-rw-r--r--mysql-test/t/alter_table.test24
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 965528642bf..70fd1dfa898 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -631,6 +631,30 @@ insert into t1 values (null);
select * from t1;
drop table t1;
+
+#
+# Bug#27507: Wrong DATETIME value was allowed by ALTER TABLE in the
+# NO_ZERO_DATE mode.
+#
+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');
+--error 1292
+alter table t1 add column f3 datetime not null;
+--error 1292
+alter table t1 add column f3 date not null;
+--error 1292
+alter table t1 add column f4 datetime not null default '2002-02-02',
+ add column f41 date not null;
+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;
+drop table t1;
+set sql_mode= @orig_sql_mode;
+
+#
# Some additional tests for new, faster alter table. Note that most of the
# whole alter table code is being tested all around the test suite already.
#