List:Commits« Previous MessageNext Message »
From:ramil Date:May 17 2006 2:00pm
Subject:bk commit into 4.1 tree (ramil:1.2482)
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of ram. When ram does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2482 06/05/17 17:00:30 ramil@stripped +3 -0
  Fix for #16327: invalid TIMESTAMP values retrieved

  sql/field.cc
    1.230 06/05/17 17:00:25 ramil@stripped +1 -1
    Fix for #16327: invalid TIMESTAMP values retrieved
      - let 1969 as well

  mysql-test/t/func_time.test
    1.34 06/05/17 17:00:25 ramil@stripped +10 -0
    Fix for #16327: invalid TIMESTAMP values retrieved
      - test case

  mysql-test/r/func_time.result
    1.39 06/05/17 17:00:25 ramil@stripped +7 -0
    Fix for #16327: invalid TIMESTAMP values retrieved
      - test result

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	ramil
# Host:	myoffice.izhnet.ru
# Root:	/usr/home/ram/work/4.1.b16327

--- 1.229/sql/field.cc	2006-03-28 18:32:37 +05:00
+++ 1.230/sql/field.cc	2006-05-17 17:00:25 +05:00
@@ -3809,7 +3809,7 @@ String *Field_timestamp::val_str(String 
   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';

--- 1.38/mysql-test/r/func_time.result	2006-04-25 14:34:13 +05:00
+++ 1.39/mysql-test/r/func_time.result	2006-05-17 17:00:25 +05:00
@@ -630,3 +630,10 @@ select 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;

--- 1.33/mysql-test/t/func_time.test	2006-04-25 14:34:13 +05:00
+++ 1.34/mysql-test/t/func_time.test	2006-05-17 17:00:25 +05:00
@@ -322,4 +322,14 @@ 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;
+
 # End of 4.1 tests
Thread
bk commit into 4.1 tree (ramil:1.2482)ramil17 May