List:Commits« Previous MessageNext Message »
From:ramil Date:February 8 2007 6:52am
Subject:bk commit into 5.0 tree (ramil:1.2406) BUG#25301
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 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@stripped, 2007-02-08 09:52:52+04:00, ramil@stripped +5 -0
  Fix for bug #25301: Non-zero dates with year 0000 are invalid
  
  The 0000 year is valid.
  The ISO standard for "Representation of dates and times" says:
  "Calendar years are numbered in ascending order according to the 
  Gregorian calendar by values in the range [0000] to [9999]."
   
  Reverted fix for 19370 DateTime datatype in MySQL has two bugs in it
  as it's not a bug.

  mysql-test/r/date_formats.result@stripped, 2007-02-08 09:34:35+04:00, ramil@stripped +1 -3
    Fix for bug #25301: Non-zero dates with year 0000 are invalid
      - test result adjusted

  mysql-test/r/strict.result@stripped, 2007-02-08 09:34:35+04:00, ramil@stripped +4 -10
    Fix for bug #25301: Non-zero dates with year 0000 are invalid
      - test result adjusted

  mysql-test/r/type_datetime.result@stripped, 2007-02-08 09:34:35+04:00, ramil@stripped +1 -3
    Fix for bug #25301: Non-zero dates with year 0000 are invalid
      - test result adjusted

  mysql-test/t/strict.test@stripped, 2007-02-08 09:34:35+04:00, ramil@stripped +0 -8
    Fix for bug #25301: Non-zero dates with year 0000 are invalid
      - test adjusted

  sql-common/my_time.c@stripped, 2007-02-08 09:34:35+04:00, ramil@stripped +1 -2
    Fix for bug #25301: Non-zero dates with year 0000 are invalid
      - reverted fix for 19370 DateTime datatype in MySQL has two bugs in it

# 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:	ramil.myoffice.izhnet.ru
# Root:	/home/ram/work/b25301/b25301.5.0

--- 1.31/mysql-test/r/date_formats.result	2007-02-08 09:52:55 +04:00
+++ 1.32/mysql-test/r/date_formats.result	2007-02-08 09:52:55 +04:00
@@ -470,8 +470,6 @@ create table t1 select str_to_date("2003
 str_to_date("10:11:12.0012", "%H:%i:%S.%f") as f2,
 str_to_date("2003-01-02", "%Y-%m-%d") as f3,
 str_to_date("02", "%d") as f4, str_to_date("02 10", "%d %H") as f5;
-Warnings:
-Warning	1265	Data truncated for column 'f4' at row 1
 describe t1;
 Field	Type	Null	Key	Default	Extra
 f1	datetime	YES		NULL	
@@ -481,7 +479,7 @@ f4	date	YES		NULL	
 f5	time	YES		NULL	
 select * from t1;
 f1	f2	f3	f4	f5
-2003-01-02 10:11:12	10:11:12	2003-01-02	0000-00-00	58:00:00
+2003-01-02 10:11:12	10:11:12	2003-01-02	0000-00-02	58:00:00
 drop table t1;
 create table t1 select "02 10" as a, "%d %H" as b;
 select str_to_date(a,b) from t1;

--- 1.28/sql-common/my_time.c	2007-02-08 09:52:55 +04:00
+++ 1.29/sql-common/my_time.c	2007-02-08 09:52:55 +04:00
@@ -85,8 +85,7 @@ my_bool check_date(const MYSQL_TIME *lti
         (!(flags & TIME_INVALID_DATES) &&
          ltime->month && ltime->day > days_in_month[ltime->month-1]
&&
          (ltime->month != 2 || calc_days_in_year(ltime->year) != 366 ||
-          ltime->day != 29)) ||
-        (ltime->year == 0 && (ltime->month != 0 || ltime->day != 0)))
+          ltime->day != 29)))
     {
       *was_cut= 2;
       return TRUE;

--- 1.33/mysql-test/r/type_datetime.result	2007-02-08 09:52:56 +04:00
+++ 1.34/mysql-test/r/type_datetime.result	2007-02-08 09:52:56 +04:00
@@ -26,8 +26,6 @@ Table	Op	Msg_type	Msg_text
 test.t1	check	status	OK
 delete from t1;
 insert into t1
values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030100000000"),("20030000000000");
-Warnings:
-Warning	1264	Out of range value adjusted for column 't' at row 5
 insert into t1 values ("2003-003-03");
 insert into t1 values ("20030102T131415"),("2001-01-01T01:01:01"), ("2001-1-1T1:01:01");
 select * from t1;
@@ -36,7 +34,7 @@ t
 2069-12-31 00:00:00
 1970-01-01 00:00:00
 1999-12-31 00:00:00
-0000-00-00 00:00:00
+0000-01-01 00:00:00
 0001-01-01 00:00:00
 9999-12-31 00:00:00
 2000-10-10 00:00:00

--- 1.31/mysql-test/r/strict.result	2007-02-08 09:52:56 +04:00
+++ 1.32/mysql-test/r/strict.result	2007-02-08 09:52:56 +04:00
@@ -7,7 +7,6 @@ DROP TABLE IF EXISTS t1;
 CREATE TABLE t1 (col1 date);
 INSERT INTO t1 VALUES('2004-01-01'),('2004-02-29');
 INSERT INTO t1 VALUES('0000-10-31');
-ERROR 22007: Incorrect date value: '0000-10-31' for column 'col1' at row 1
 INSERT INTO t1 VALUES('2004-0-31');
 ERROR 22007: Incorrect date value: '2004-0-31' for column 'col1' at row 1
 INSERT INTO t1 VALUES('2004-01-02'),('2004-0-31');
@@ -57,6 +56,7 @@ select * from t1;
 col1
 2004-01-01
 2004-02-29
+0000-10-31
 2004-01-02
 2004-01-03
 2004-00-31
@@ -124,7 +124,6 @@ set @@sql_mode='ansi,traditional';
 CREATE TABLE t1 (col1 datetime);
 INSERT INTO t1 VALUES('2004-10-31 15:30:00'),('2004-02-29 15:30:00');
 INSERT INTO t1 VALUES('0000-10-31 15:30:00');
-ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col1' at row 1
 INSERT INTO t1 VALUES('2004-0-31 15:30:00');
 ERROR 22007: Incorrect datetime value: '2004-0-31 15:30:00' for column 'col1' at row 1
 INSERT INTO t1 VALUES('2004-10-0 15:30:00');
@@ -145,6 +144,7 @@ select * from t1;
 col1
 2004-10-31 15:30:00
 2004-02-29 15:30:00
+0000-10-31 15:30:00
 drop table t1;
 CREATE TABLE t1 (col1 timestamp);
 INSERT INTO t1 VALUES('2004-10-31 15:30:00'),('2004-02-29 15:30:00');
@@ -206,7 +206,6 @@ INSERT INTO t1 (col1) VALUES (STR_TO_DAT
 INSERT INTO t1 (col2) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i'));
 INSERT INTO t1 (col3) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i'));
 INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
-ERROR 22007: Incorrect date value: '0000-10-31 15:30:00' for column 'col1' at row 1
 INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i'));
 ERROR 22007: Incorrect date value: '2004-00-31 15:30:00' for column 'col1' at row 1
 INSERT INTO t1 (col1) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i'));
@@ -222,7 +221,6 @@ ERROR HY000: Incorrect datetime value: '
 INSERT INTO t1 (col1) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y'));
 ERROR 22007: Incorrect date value: '0000-00-00' for column 'col1' at row 1
 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
-ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col2' at row 1
 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i'));
 ERROR 22007: Incorrect datetime value: '2004-00-31 15:30:00' for column 'col2' at row 1
 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i'));
@@ -259,7 +257,6 @@ INSERT INTO t1 (col1) VALUES (CAST('2004
 INSERT INTO t1 (col2) VALUES (CAST('2004-10-15 10:15' AS DATETIME));
 INSERT INTO t1 (col3) VALUES (CAST('2004-10-15 10:15' AS DATETIME));
 INSERT INTO t1 (col1) VALUES(CAST('0000-10-31' AS DATE));
-ERROR 22007: Truncated incorrect datetime value: '0000-10-31'
 INSERT INTO t1 (col1) VALUES(CAST('2004-10-0' AS DATE));
 ERROR 22007: Incorrect date value: '2004-10-00' for column 'col1' at row 1
 INSERT INTO t1 (col1) VALUES(CAST('2004-0-10' AS DATE));
@@ -267,7 +264,6 @@ ERROR 22007: Incorrect date value: '2004
 INSERT INTO t1 (col1) VALUES(CAST('0000-00-00' AS DATE));
 ERROR 22007: Truncated incorrect datetime value: '0000-00-00'
 INSERT INTO t1 (col2) VALUES(CAST('0000-10-31 15:30' AS DATETIME));
-ERROR 22007: Truncated incorrect datetime value: '0000-10-31 15:30'
 INSERT INTO t1 (col2) VALUES(CAST('2004-10-0 15:30' AS DATETIME));
 ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col2' at row 1
 INSERT INTO t1 (col2) VALUES(CAST('2004-0-10 15:30' AS DATETIME));
@@ -275,7 +271,7 @@ ERROR 22007: Incorrect datetime value: '
 INSERT INTO t1 (col2) VALUES(CAST('0000-00-00' AS DATETIME));
 ERROR 22007: Truncated incorrect datetime value: '0000-00-00'
 INSERT INTO t1 (col3) VALUES(CAST('0000-10-31 15:30' AS DATETIME));
-ERROR 22007: Truncated incorrect datetime value: '0000-10-31 15:30'
+ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col3' at row 1
 INSERT INTO t1 (col3) VALUES(CAST('2004-10-0 15:30' AS DATETIME));
 ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col3' at row 1
 INSERT INTO t1 (col3) VALUES(CAST('2004-0-10 15:30' AS DATETIME));
@@ -288,7 +284,6 @@ INSERT INTO t1 (col1) VALUES (CONVERT('2
 INSERT INTO t1 (col2) VALUES (CONVERT('2004-10-15 10:15',DATETIME));
 INSERT INTO t1 (col3) VALUES (CONVERT('2004-10-15 10:15',DATETIME));
 INSERT INTO t1 (col1) VALUES(CONVERT('0000-10-31' , DATE));
-ERROR 22007: Truncated incorrect datetime value: '0000-10-31'
 INSERT INTO t1 (col1) VALUES(CONVERT('2004-10-0' , DATE));
 ERROR 22007: Incorrect date value: '2004-10-00' for column 'col1' at row 1
 INSERT INTO t1 (col1) VALUES(CONVERT('2004-0-10' , DATE));
@@ -296,7 +291,6 @@ ERROR 22007: Incorrect date value: '2004
 INSERT INTO t1 (col1) VALUES(CONVERT('0000-00-00',DATE));
 ERROR 22007: Truncated incorrect datetime value: '0000-00-00'
 INSERT INTO t1 (col2) VALUES(CONVERT('0000-10-31 15:30',DATETIME));
-ERROR 22007: Truncated incorrect datetime value: '0000-10-31 15:30'
 INSERT INTO t1 (col2) VALUES(CONVERT('2004-10-0 15:30',DATETIME));
 ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col2' at row 1
 INSERT INTO t1 (col2) VALUES(CONVERT('2004-0-10 15:30',DATETIME));
@@ -304,7 +298,7 @@ ERROR 22007: Incorrect datetime value: '
 INSERT INTO t1 (col2) VALUES(CONVERT('0000-00-00',DATETIME));
 ERROR 22007: Truncated incorrect datetime value: '0000-00-00'
 INSERT INTO t1 (col3) VALUES(CONVERT('0000-10-31 15:30',DATETIME));
-ERROR 22007: Truncated incorrect datetime value: '0000-10-31 15:30'
+ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col3' at row 1
 INSERT INTO t1 (col3) VALUES(CONVERT('2004-10-0 15:30',DATETIME));
 ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col3' at row 1
 INSERT INTO t1 (col3) VALUES(CONVERT('2004-0-10 15:30',DATETIME));

--- 1.24/mysql-test/t/strict.test	2007-02-08 09:52:56 +04:00
+++ 1.25/mysql-test/t/strict.test	2007-02-08 09:52:56 +04:00
@@ -14,7 +14,6 @@ DROP TABLE IF EXISTS t1;
 
 CREATE TABLE t1 (col1 date);
 INSERT INTO t1 VALUES('2004-01-01'),('2004-02-29');
---error 1292
 INSERT INTO t1 VALUES('0000-10-31');
 
 # All test cases expected to fail should return 
@@ -100,7 +99,6 @@ set @@sql_mode='ansi,traditional';
 
 CREATE TABLE t1 (col1 datetime);
 INSERT INTO t1 VALUES('2004-10-31 15:30:00'),('2004-02-29 15:30:00');
---error 1292
 INSERT INTO t1 VALUES('0000-10-31 15:30:00');
 
 # All test cases expected to fail should return 
@@ -194,7 +192,6 @@ INSERT INTO t1 (col3) VALUES (STR_TO_DAT
 #       All test cases expected to fail should return 
 #       SQLSTATE 22007 <invalid date value>
 
---error 1292
 INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
 
 --error 1292
@@ -216,7 +213,6 @@ INSERT INTO t1 (col1) VALUES(STR_TO_DATE
 #       All test cases expected to fail should return 
 #       SQLSTATE 22007 <invalid datetime value>
 
---error 1292
 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i'));
 
 --error 1292
@@ -271,7 +267,6 @@ INSERT INTO t1 (col3) VALUES (CAST('2004
 #       All test cases expected to fail should return 
 #       SQLSTATE 22007 <invalid date value>
 
---error 1292
 INSERT INTO t1 (col1) VALUES(CAST('0000-10-31' AS DATE));
 
 --error 1292
@@ -299,7 +294,6 @@ INSERT INTO t1 (col1) VALUES(CAST('0000-
 #       All test cases expected to fail should return 
 #       SQLSTATE 22007 <invalid datetime value>
 
---error 1292
 INSERT INTO t1 (col2) VALUES(CAST('0000-10-31 15:30' AS DATETIME));
 
 --error 1292
@@ -367,7 +361,6 @@ INSERT INTO t1 (col3) VALUES (CONVERT('2
 #       All test cases expected to fail should return 
 #       SQLSTATE 22007 <invalid date value>
 
---error 1292
 INSERT INTO t1 (col1) VALUES(CONVERT('0000-10-31' , DATE));
 
 --error 1292
@@ -394,7 +387,6 @@ INSERT INTO t1 (col1) VALUES(CONVERT('00
 #       All test cases expected to fail should return 
 #       SQLSTATE 22007 <invalid datetime value>
 
---error 1292
 INSERT INTO t1 (col2) VALUES(CONVERT('0000-10-31 15:30',DATETIME));
 
 --error 1292
Thread
bk commit into 5.0 tree (ramil:1.2406) BUG#25301ramil8 Feb