List:Commits« Previous MessageNext Message »
From:Georgi Kodinov Date:September 19 2008 3:32pm
Subject:bzr push into mysql-5.1-bugteam branch (kgeorge:2686)
View as plain text  
 2686 Georgi Kodinov	2008-09-19 [merge]
      merged 5.0-5.1.29-rc into B39353 tree
removed:
  extra/yassl/taocrypt/taocrypt.vcproj
  extra/yassl/yassl.vcproj
  mysql-test/t/rpl_view-slave.opt
  server-tools/instance-manager/mysqlmanager.vcproj
added:
  win/build-vs9.bat
  win/build-vs9_x64.bat
modified:
  .bzr-mysql/default.conf
  CMakeLists.txt
  client/mysqldump.c
  libmysql/dll.c
  mysql-test/r/mysqldump.result
  mysql-test/r/rpl_log.result
  mysql-test/t/disabled.def
  mysql-test/t/rpl_ddl.test
  mysql-test/t/rpl_log-slave.opt
  mysql-test/t/rpl_log.test
  zlib/zutil.h

=== modified file 'mysql-test/r/compare.result'
--- a/mysql-test/r/compare.result	2008-02-15 13:47:32 +0000
+++ b/mysql-test/r/compare.result	2008-09-18 12:55:36 +0000
@@ -90,4 +90,9 @@ Note	1276	Field or reference 'test.t2.a'
 Note	1276	Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
 Note	1003	select `test`.`t2`.`a` AS `a`,(select count(0) AS `COUNT(*)` from `test`.`t1`
where ((`test`.`t1`.`b` = `test`.`t2`.`a`) and (concat(`test`.`t1`.`b`,`test`.`t1`.`c`) =
concat(_latin1'0',`test`.`t2`.`a`,_latin1'01')))) AS `x` from `test`.`t2` order by
`test`.`t2`.`a`
 DROP TABLE t1,t2;
+CREATE TABLE t1 (a TIMESTAMP);
+INSERT INTO t1 VALUES (NOW()),(NOW()),(NOW());
+SELECT * FROM t1 WHERE a > '2008-01-01' AND a = '0000-00-00';
+a
+DROP TABLE t1;
 End of 5.0 tests

=== modified file 'mysql-test/t/compare.test'
--- a/mysql-test/t/compare.test	2008-02-15 13:47:32 +0000
+++ b/mysql-test/t/compare.test	2008-09-18 12:55:36 +0000
@@ -76,4 +76,13 @@ FROM t2 ORDER BY a;
 
 DROP TABLE t1,t2;
 
+#
+# Bug #39353: Multiple conditions on timestamp column crashes server
+#
+
+CREATE TABLE t1 (a TIMESTAMP); 
+INSERT INTO t1 VALUES (NOW()),(NOW()),(NOW());
+SELECT * FROM t1 WHERE a > '2008-01-01' AND a = '0000-00-00';
+DROP TABLE t1;
+
 --echo End of 5.0 tests

=== modified file 'sql/item.cc'
--- a/sql/item.cc	2008-09-03 07:59:48 +0000
+++ b/sql/item.cc	2008-09-18 12:55:36 +0000
@@ -4220,7 +4220,12 @@ Item *Item_field::equal_fields_propagato
     item= this;
   else if (field && (field->flags & ZEROFILL_FLAG) &&
IS_NUM(field->type()))
   {
-    if (item && cmp_context != INT_RESULT)
+    /*
+      We don't need to zero-fill timestamp columns here because they will be 
+      first converted to a string (in date/time format) and compared as such if
+      compared with another string.
+    */
+    if (item && field->type() != FIELD_TYPE_TIMESTAMP && cmp_context
!= INT_RESULT)
       convert_zerofill_number_to_string(&item, (Field_num *)field);
     else
       item= this;

Thread
bzr push into mysql-5.1-bugteam branch (kgeorge:2686) Georgi Kodinov19 Sep