From: Date: September 19 2008 3:33pm Subject: bzr push into mysql-5.1 branch (kgeorge:2687 to 2689) Bug#31434 List-Archive: http://lists.mysql.com/commits/54362 X-Bug: 31434 Message-Id: <20080919133312.210E210E43B3@macbook.local> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 2689 Georgi Kodinov 2008-09-19 fixed a problem with the push of bug #31434 modified: mysql-test/t/mysqldump-max.test 2688 Georgi Kodinov 2008-09-19 [merge] merge of bug 39353 5.0-5.1.29-rc -> 5.1-5.1.29-rc modified: mysql-test/r/compare.result mysql-test/t/compare.test sql/item.cc 2687 Gleb Shchepa 2008-09-18 Post-push fix for bug #26020: User-Defined Variables are not consistence with columns data types. --ps-protocol problem has been fixed. modified: sql/item_func.cc === modified file 'mysql-test/r/compare.result' --- a/mysql-test/r/compare.result 2008-03-12 10:22:58 +0000 +++ b/mysql-test/r/compare.result 2008-09-19 12:34:37 +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('0',`test`.`t2`.`a`,'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 'mysql-test/t/mysqldump-max.test' --- a/mysql-test/t/mysqldump-max.test 2008-09-11 06:14:19 +0000 +++ b/mysql-test/t/mysqldump-max.test 2008-09-19 13:24:32 +0000 @@ -1114,9 +1114,9 @@ CREATE VIEW v1 AS SELECT * FROM t1; INSERT INTO t1 VALUES(); SELECT COUNT(*) FROM v1; ---exec $MYSQL_DUMP --allow-keywords --single-transaction --quick --verbose test --result-file $MYSQL_TEST_DIR/var/tmp/bug31434.sql ---exec $MYSQL test < $MYSQL_TEST_DIR/var/tmp/bug31434.sql ---remove_file $MYSQL_TEST_DIR/var/tmp/bug31434.sql +--exec $MYSQL_DUMP --allow-keywords --single-transaction --quick --verbose test --result-file $MYSQLTEST_VARDIR/tmp/bug31434.sql +--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug31434.sql +--remove_file $MYSQLTEST_VARDIR/tmp/bug31434.sql SELECT COUNT(*) FROM v1; === modified file 'sql/item.cc' --- a/sql/item.cc 2008-09-08 10:04:42 +0000 +++ b/sql/item.cc 2008-09-19 12:34:37 +0000 @@ -4342,7 +4342,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;