summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/type_blob.result30
-rw-r--r--mysql-test/r/type_timestamp.result31
-rw-r--r--mysql-test/t/type_blob.test38
-rw-r--r--mysql-test/t/type_timestamp.test36
4 files changed, 66 insertions, 69 deletions
diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result
index 1daeb4e9f20..0ead1c30200 100644
--- a/mysql-test/r/type_blob.result
+++ b/mysql-test/r/type_blob.result
@@ -248,36 +248,6 @@ job^M
1 1 test job 1 0000-00-00 00:00:00 1999-02-25 22:43:32 0 High admin 0 tomato test^M
job^M
1 1
-stamp
-19990402000000
-stamp
-19990402000000
-date_format(a,"%Y %y") year(a) year(now())
-2000 00 2000 2000
-ix
-19991101000000
-19990102030405
-19990630232922
-19990601000000
-19990930232922
-19990531232922
-19990501000000
-19991101000000
-19990501000000
-date date_time time_stamp
-1998-12-31 1998-12-31 23:59:59 19981231235959
-1999-01-01 1999-01-01 00:00:00 19990101000000
-1999-09-09 1999-09-09 23:59:59 19990909235959
-2000-01-01 2000-01-01 00:00:00 20000101000000
-2000-02-28 2000-02-28 00:00:00 20000228000000
-2000-02-29 2000-02-29 00:00:00 20000229000000
-2000-03-01 2000-03-01 00:00:00 20000301000000
-2000-12-31 2000-12-31 23:59:59 20001231235959
-2001-01-01 2001-01-01 00:00:00 20010101000000
-2004-12-31 2004-12-31 23:59:59 20041231235959
-2005-01-01 2005-01-01 00:00:00 20050101000000
-2030-01-01 2030-01-01 00:00:00 20300101000000
-2050-01-01 2050-01-01 00:00:00 20131126000036
a reverse(a)
empty ytpme
diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result
index 8dcf99ebcd1..8996ca59f7f 100644
--- a/mysql-test/r/type_timestamp.result
+++ b/mysql-test/r/type_timestamp.result
@@ -1,2 +1,31 @@
t
-19700101022034
+19700101032034
+stamp
+19990402000000
+stamp
+19990402000000
+date_format(a,"%Y %y") year(a) year(now())
+1970 70 1970 1970
+ix
+19991101000000
+19990102030405
+19990630232922
+19990601000000
+19990930232922
+19990531232922
+19990501000000
+19991101000000
+19990501000000
+date date_time time_stamp
+1998-12-31 1998-12-31 23:59:59 19981231235959
+1999-01-01 1999-01-01 00:00:00 19990101000000
+1999-09-09 1999-09-09 23:59:59 19990909235959
+2000-01-01 2000-01-01 00:00:00 20000101000000
+2000-02-28 2000-02-28 00:00:00 20000228000000
+2000-02-29 2000-02-29 00:00:00 20000229000000
+2000-03-01 2000-03-01 00:00:00 20000301000000
+2000-12-31 2000-12-31 23:59:59 20001231235959
+2001-01-01 2001-01-01 00:00:00 20010101000000
+2004-12-31 2004-12-31 23:59:59 20041231235959
+2005-01-01 2005-01-01 00:00:00 20050101000000
+2030-01-01 2030-01-01 00:00:00 20300101000000
diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test
index ab73828c49a..a975b3e8c95 100644
--- a/mysql-test/t/type_blob.test
+++ b/mysql-test/t/type_blob.test
@@ -208,44 +208,6 @@ select replace(t3._field_140, "\r","^M"),t3_id,min(t3._field_131), min(t3._field
drop table t1,t2,t3,t4,t5,t6,t7;
#
-# Test of timestamp and blobs
-#
-
-CREATE TABLE t1 (value TEXT NOT NULL, id VARCHAR(32) NOT NULL, stamp timestamp, PRIMARY KEY (id));
-INSERT INTO t1 VALUES ("my value", "myKey","1999-04-02 00:00:00");
-SELECT stamp FROM t1 WHERE id="myKey";
-UPDATE t1 SET value="my value" WHERE id="myKey";
-SELECT stamp FROM t1 WHERE id="myKey";
-drop table t1;
-
-create table t1 (a timestamp);
-insert into t1 values (now());
-select date_format(a,"%Y %y"),year(a),year(now()) from t1;
-drop table t1;
-
-create table t1 (ix timestamp);
-insert into t1 values (19991101000000),(19990102030405),(19990630232922),(19990601000000),(19990930232922),(19990531232922),(19990501000000),(19991101000000),(19990501000000);
-select * from t1;
-drop table t1;
-
-CREATE TABLE t1 (date date, date_time datetime, time_stamp timestamp);
-INSERT INTO t1 VALUES ("1998-12-31","1998-12-31 23:59:59",19981231235959);
-INSERT INTO t1 VALUES ("1999-01-01","1999-01-01 00:00:00",19990101000000);
-INSERT INTO t1 VALUES ("1999-09-09","1999-09-09 23:59:59",19990909235959);
-INSERT INTO t1 VALUES ("2000-01-01","2000-01-01 00:00:00",20000101000000);
-INSERT INTO t1 VALUES ("2000-02-28","2000-02-28 00:00:00",20000228000000);
-INSERT INTO t1 VALUES ("2000-02-29","2000-02-29 00:00:00",20000229000000);
-INSERT INTO t1 VALUES ("2000-03-01","2000-03-01 00:00:00",20000301000000);
-INSERT INTO t1 VALUES ("2000-12-31","2000-12-31 23:59:59",20001231235959);
-INSERT INTO t1 VALUES ("2001-01-01","2001-01-01 00:00:00",20010101000000);
-INSERT INTO t1 VALUES ("2004-12-31","2004-12-31 23:59:59",20041231235959);
-INSERT INTO t1 VALUES ("2005-01-01","2005-01-01 00:00:00",20050101000000);
-INSERT INTO t1 VALUES ("2030-01-01","2030-01-01 00:00:00",20300101000000);
-INSERT INTO t1 VALUES ("2050-01-01","2050-01-01 00:00:00",20500101000000);
-SELECT * FROM t1;
-drop table t1;
-
-#
# Test of reverse with empty blob
#
diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test
index 92ce87068da..a6169c03d3d 100644
--- a/mysql-test/t/type_timestamp.test
+++ b/mysql-test/t/type_timestamp.test
@@ -7,3 +7,39 @@ SET TIMESTAMP=1234;
insert into t1 values(NULL);
select * from t1;
drop table t1;
+
+
+CREATE TABLE t1 (value TEXT NOT NULL, id VARCHAR(32) NOT NULL, stamp timestamp, PRIMARY KEY (id));
+INSERT INTO t1 VALUES ("my value", "myKey","1999-04-02 00:00:00");
+SELECT stamp FROM t1 WHERE id="myKey";
+UPDATE t1 SET value="my value" WHERE id="myKey";
+SELECT stamp FROM t1 WHERE id="myKey";
+drop table t1;
+
+create table t1 (a timestamp);
+insert into t1 values (now());
+select date_format(a,"%Y %y"),year(a),year(now()) from t1;
+drop table t1;
+
+create table t1 (ix timestamp);
+insert into t1 values (19991101000000),(19990102030405),(19990630232922),(19990601000000),(19990930232922),(19990531232922),(19990501000000),(19991101000000),(19990501000000);
+select * from t1;
+drop table t1;
+
+CREATE TABLE t1 (date date, date_time datetime, time_stamp timestamp);
+INSERT INTO t1 VALUES ("1998-12-31","1998-12-31 23:59:59",19981231235959);
+INSERT INTO t1 VALUES ("1999-01-01","1999-01-01 00:00:00",19990101000000);
+INSERT INTO t1 VALUES ("1999-09-09","1999-09-09 23:59:59",19990909235959);
+INSERT INTO t1 VALUES ("2000-01-01","2000-01-01 00:00:00",20000101000000);
+INSERT INTO t1 VALUES ("2000-02-28","2000-02-28 00:00:00",20000228000000);
+INSERT INTO t1 VALUES ("2000-02-29","2000-02-29 00:00:00",20000229000000);
+INSERT INTO t1 VALUES ("2000-03-01","2000-03-01 00:00:00",20000301000000);
+INSERT INTO t1 VALUES ("2000-12-31","2000-12-31 23:59:59",20001231235959);
+INSERT INTO t1 VALUES ("2001-01-01","2001-01-01 00:00:00",20010101000000);
+INSERT INTO t1 VALUES ("2004-12-31","2004-12-31 23:59:59",20041231235959);
+INSERT INTO t1 VALUES ("2005-01-01","2005-01-01 00:00:00",20050101000000);
+INSERT INTO t1 VALUES ("2030-01-01","2030-01-01 00:00:00",20300101000000);
+# The following will get you an different answer on 64 bit machines
+#INSERT INTO t1 VALUES ("2050-01-01","2050-01-01 00:00:00",20500101000000);
+SELECT * FROM t1;
+drop table t1;