mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
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.
This commit is contained in:
@ -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;
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user