summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/strict.result20
-rw-r--r--mysql-test/t/strict.test14
2 files changed, 34 insertions, 0 deletions
diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result
index a742770ae9b..ce3cf8bb204 100644
--- a/mysql-test/r/strict.result
+++ b/mysql-test/r/strict.result
@@ -1259,6 +1259,26 @@ d
2000-10-01
drop table t1;
set @@sql_mode='traditional';
+create table t1(a int, b timestamp);
+alter table t1 add primary key(a);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL default '0',
+ `b` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1(a int, b timestamp default 20050102030405);
+alter table t1 add primary key(a);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL default '0',
+ `b` timestamp NOT NULL default '2005-01-02 03:04:05',
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
create table t1(a bit(2));
insert into t1 values(b'101');
ERROR 22001: Data too long for column 'a' at row 1
diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test
index 9e8d92533d9..ca57ca646f2 100644
--- a/mysql-test/t/strict.test
+++ b/mysql-test/t/strict.test
@@ -1120,6 +1120,20 @@ select * from t1;
drop table t1;
#
+# Bug #11964: alter table with timestamp field
+#
+
+set @@sql_mode='traditional';
+create table t1(a int, b timestamp);
+alter table t1 add primary key(a);
+show create table t1;
+drop table t1;
+create table t1(a int, b timestamp default 20050102030405);
+alter table t1 add primary key(a);
+show create table t1;
+drop table t1;
+
+#
# BIT fields
#