List:Commits« Previous MessageNext Message »
From:Martin Hansson Date:January 20 2011 8:29am
Subject:bzr push into mysql-5.1 branch (martin.hansson:3563)
View as plain text  
 3563 Martin Hansson	2011-01-20 [merge]
      Merge.

    modified:
      strings/bchange.c
      strings/bcopy-duff.c
      strings/bfill.c
      strings/bmove.c
      strings/bmove512.c
      strings/bmove_upp.c
      strings/conf_to_src.c
      strings/ctype-big5.c
      strings/ctype-bin.c
      strings/ctype-cp932.c
      strings/ctype-czech.c
      strings/ctype-euc_kr.c
      strings/ctype-eucjpms.c
      strings/ctype-extra.c
      strings/ctype-gb2312.c
      strings/ctype-gbk.c
      strings/ctype-latin1.c
      strings/ctype-mb.c
      strings/ctype-simple.c
      strings/ctype-sjis.c
      strings/ctype-tis620.c
      strings/ctype-uca.c
      strings/ctype-ucs2.c
      strings/ctype-ujis.c
      strings/ctype-utf8.c
      strings/ctype-win1250ch.c
      strings/ctype.c
      strings/decimal.c
      strings/do_ctype.c
      strings/dump_map.c
      strings/int2str.c
      strings/is_prefix.c
      strings/llstr.c
      strings/longlong2str.c
      strings/longlong2str_asm.c
      strings/memcmp.c
      strings/memcpy.c
      strings/memset.c
      strings/my_strchr.c
      strings/my_strtoll10.c
      strings/my_vsnprintf.c
      strings/r_strinstr.c
      strings/str2int.c
      strings/str_alloc.c
      strings/str_test.c
      strings/strappend.c
      strings/strcat.c
      strings/strcend.c
      strings/strchr.c
      strings/strcmp.c
      strings/strcont.c
      strings/strend.c
      strings/strfill.c
      strings/strinstr.c
      strings/strlen.c
      strings/strmake.c
      strings/strmov.c
      strings/strnlen.c
      strings/strnmov.c
      strings/strrchr.c
      strings/strstr.c
      strings/strto.c
      strings/strtod.c
      strings/strtol.c
      strings/strtoll.c
      strings/strtoul.c
      strings/strtoull.c
      strings/strxmov.c
      strings/strxnmov.c
      strings/uca-dump.c
      strings/uctypedump.c
      strings/udiv.c
      strings/utr11-dump.c
      strings/xml.c
=== modified file 'mysql-test/r/type_datetime.result'
--- a/mysql-test/r/type_datetime.result	2010-03-09 10:36:26 +0000
+++ b/mysql-test/r/type_datetime.result	2011-01-19 14:09:32 +0000
@@ -637,4 +637,15 @@ CAST(CAST('2008-07-29T10:42:51.1234567' 
 20080729104251.1234560
 Warnings:
 Warning	1292	Truncated incorrect datetime value: '2008-07-29T10:42:51.1234567'
+# 
+# Bug#59173: Failure to handle DATE(TIME) values where Year, Month or
+# Day is ZERO 
+# 
+CREATE TABLE t1 (dt1 DATETIME);
+INSERT INTO t1 (dt1) VALUES ('0000-00-01 00:00:01');
+DELETE   FROM t1 WHERE dt1 = '0000-00-01 00:00:01';
+# Should be empty
+SELECT * FROM t1;
+dt1
+DROP TABLE t1;
 End of 5.1 tests

=== modified file 'mysql-test/t/type_datetime.test'
--- a/mysql-test/t/type_datetime.test	2009-02-13 18:07:03 +0000
+++ b/mysql-test/t/type_datetime.test	2011-01-19 14:09:32 +0000
@@ -445,4 +445,15 @@ SELECT CAST(CAST('00000002006-000008-000
 # show we truncate microseconds from the right
 SELECT CAST(CAST('2008-07-29T10:42:51.1234567' AS DateTime) AS DECIMAL(30,7));
 
+--echo # 
+--echo # Bug#59173: Failure to handle DATE(TIME) values where Year, Month or
+--echo # Day is ZERO 
+--echo # 
+CREATE TABLE t1 (dt1 DATETIME);
+INSERT INTO t1 (dt1) VALUES ('0000-00-01 00:00:01');
+DELETE   FROM t1 WHERE dt1 = '0000-00-01 00:00:01';
+--echo # Should be empty
+SELECT * FROM t1;
+DROP TABLE t1;
+
 --echo End of 5.1 tests

=== modified file 'sql/item_cmpfunc.cc'
--- a/sql/item_cmpfunc.cc	2010-12-28 23:47:05 +0000
+++ b/sql/item_cmpfunc.cc	2011-01-19 14:09:32 +0000
@@ -913,7 +913,7 @@ int Arg_comparator::set_cmp_func(Item_re
         cache_converted_constant can't be used here because it can't
         correctly convert a DATETIME value from string to int representation.
       */
-      Item_cache_int *cache= new Item_cache_int();
+      Item_cache_int *cache= new Item_cache_int(MYSQL_TYPE_DATETIME);
       /* Mark the cache as non-const to prevent re-caching. */
       cache->set_used_tables(1);
       if (!(*a)->is_datetime())


Attachment: [text/bzr-bundle] bzr/martin.hansson@oracle.com-20110120082517-h4k1n2nncwf47cks.bundle
Thread
bzr push into mysql-5.1 branch (martin.hansson:3563) Martin Hansson20 Jan