Loading mysql-test/r/func_time.result +7 −0 Original line number Diff line number Diff line Loading @@ -636,6 +636,13 @@ select monthname(str_to_date(null, '%m')), monthname(str_to_date(null, '%m')), monthname(str_to_date(1, '%m')), monthname(str_to_date(0, '%m')); monthname(str_to_date(null, '%m')) monthname(str_to_date(null, '%m')) monthname(str_to_date(1, '%m')) monthname(str_to_date(0, '%m')) NULL NULL January NULL set time_zone='-6:00'; create table t1(a timestamp); insert into t1 values (19691231190001); select * from t1; a 1969-12-31 19:00:01 drop table t1; create table t1(f1 date, f2 time, f3 datetime); insert into t1 values ("2006-01-01", "12:01:01", "2006-01-01 12:01:01"); insert into t1 values ("2006-01-02", "12:01:02", "2006-01-02 12:01:02"); Loading mysql-test/t/func_time.test +10 −0 Original line number Diff line number Diff line Loading @@ -328,6 +328,16 @@ select last_day('2005-01-00'); select monthname(str_to_date(null, '%m')), monthname(str_to_date(null, '%m')), monthname(str_to_date(1, '%m')), monthname(str_to_date(0, '%m')); # # Bug #16327: problem with timestamp < 1970 # set time_zone='-6:00'; create table t1(a timestamp); insert into t1 values (19691231190001); select * from t1; drop table t1; # # Bug#16377 result of DATE/TIME functions were compared as strings which # can lead to a wrong result. Loading sql/field.cc +1 −1 Original line number Diff line number Diff line Loading @@ -3809,7 +3809,7 @@ String *Field_timestamp::val_str(String *val_buffer, String *val_ptr) thd->time_zone_used= 1; temp= time_tmp.year % 100; if (temp < YY_PART_YEAR) if (temp < YY_PART_YEAR - 1) { *to++= '2'; *to++= '0'; Loading Loading
mysql-test/r/func_time.result +7 −0 Original line number Diff line number Diff line Loading @@ -636,6 +636,13 @@ select monthname(str_to_date(null, '%m')), monthname(str_to_date(null, '%m')), monthname(str_to_date(1, '%m')), monthname(str_to_date(0, '%m')); monthname(str_to_date(null, '%m')) monthname(str_to_date(null, '%m')) monthname(str_to_date(1, '%m')) monthname(str_to_date(0, '%m')) NULL NULL January NULL set time_zone='-6:00'; create table t1(a timestamp); insert into t1 values (19691231190001); select * from t1; a 1969-12-31 19:00:01 drop table t1; create table t1(f1 date, f2 time, f3 datetime); insert into t1 values ("2006-01-01", "12:01:01", "2006-01-01 12:01:01"); insert into t1 values ("2006-01-02", "12:01:02", "2006-01-02 12:01:02"); Loading
mysql-test/t/func_time.test +10 −0 Original line number Diff line number Diff line Loading @@ -328,6 +328,16 @@ select last_day('2005-01-00'); select monthname(str_to_date(null, '%m')), monthname(str_to_date(null, '%m')), monthname(str_to_date(1, '%m')), monthname(str_to_date(0, '%m')); # # Bug #16327: problem with timestamp < 1970 # set time_zone='-6:00'; create table t1(a timestamp); insert into t1 values (19691231190001); select * from t1; drop table t1; # # Bug#16377 result of DATE/TIME functions were compared as strings which # can lead to a wrong result. Loading
sql/field.cc +1 −1 Original line number Diff line number Diff line Loading @@ -3809,7 +3809,7 @@ String *Field_timestamp::val_str(String *val_buffer, String *val_ptr) thd->time_zone_used= 1; temp= time_tmp.year % 100; if (temp < YY_PART_YEAR) if (temp < YY_PART_YEAR - 1) { *to++= '2'; *to++= '0'; Loading