diff options
author | unknown <dlenev@mysql.com> | 2005-03-28 23:36:25 +0400 |
---|---|---|
committer | unknown <dlenev@mysql.com> | 2005-03-28 23:36:25 +0400 |
commit | 22f6c58bb148fad71595d122635071ebbfb9f32c (patch) | |
tree | b7c9f6ef3685edce52e94cdb3b5cac891a57ac43 /mysql-test | |
parent | 606ee28d2a34159295a5f587d306f684fb68e27b (diff) | |
download | mariadb-git-22f6c58bb148fad71595d122635071ebbfb9f32c.tar.gz |
Fix for bug #8894 "TIMESTAMP values scrambled/misaligned when using --new".
Fixed Field_timestamp::val_int() so now it works correctly in --new mode
(or for TIMESTAMP(19) columns).
Also removed unused Field_timestamp::fill_and_store() method.
mysql-test/r/type_timestamp.result:
Added test for bug #8894 "TIMESTAMP values scrambled/misaligned when
using --new".
mysql-test/t/type_timestamp.test:
Added test for bug #8894 "TIMESTAMP values scrambled/misaligned when
using --new".
sql/field.cc:
Field_timestamp::fill_and_store()
Removed unused method.
Field_timestamp::val_int()
Even in --new mode integer representation of TIMESTAMP value should
not exceed 14 digits.
sql/field.h:
Removed unused Field_timestamp::fill_and_store() method.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/type_timestamp.result | 9 | ||||
-rw-r--r-- | mysql-test/t/type_timestamp.test | 13 |
2 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index 6253fa96ba8..d22fe9a94ae 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -221,3 +221,12 @@ ts1 20040101000000 20040101010000 drop table t1; +create table t1 (ts timestamp); +set TIMESTAMP=1000000000; +insert into t1 values (); +set new=1; +select ts+0 from t1; +ts+0 +20010909044640 +set new=0; +drop table t1; diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test index 464ee63c137..9d61e0eaef1 100644 --- a/mysql-test/t/type_timestamp.test +++ b/mysql-test/t/type_timestamp.test @@ -148,3 +148,16 @@ select * from t1; set new=0; select * from t1; drop table t1; + +# +# Test for bug #8894 "TIMESTAMP values scrambled/misaligned when using +# --new". TIMESTAMP columns should have correct values when they are used in +# integer context in --new mode. +# +create table t1 (ts timestamp); +set TIMESTAMP=1000000000; +insert into t1 values (); +set new=1; +select ts+0 from t1; +set new=0; +drop table t1; |