From: Date: March 9 2006 4:34pm Subject: bk commit into 5.1 tree (SergeyV:1.2159) BUG#15142 List-Archive: http://lists.mysql.com/commits/3646 X-Bug: 15142 Message-Id: <200603091534.k29FYE6c001219@selena.creware.com> Below is the list of changes that have just been committed into a local 5.1 repository of sergeyv. When sergeyv 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.2159 06/03/09 18:33:54 SergeyV@selena. +3 -0 Fixes bug #15142. timezone tables was not prezerved in lex context when timezone related function is used only in partition expression. sql/sql_partition.cc 1.44 06/03/09 18:33:43 SergeyV@selena. +8 -0 Fixes bug #15142. timezone tables was not prezerved in lex context when timezone related function is used only in partition expression. mysql-test/t/partition.test 1.20 06/03/09 18:33:42 SergeyV@selena. +7 -0 Bug #15142 - test case added mysql-test/r/partition.result 1.17 06/03/09 18:33:41 SergeyV@selena. +3 -0 Bug #15142 - test case 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: SergeyV # Host: selena. # Root: H:/MYSQL/src/#15142-mysql-5.1 --- 1.16/mysql-test/r/partition.result 2006-03-07 22:37:52 +03:00 +++ 1.17/mysql-test/r/partition.result 2006-03-09 18:33:41 +03:00 @@ -422,4 +422,7 @@ x123 11,12 1 x234 NULL,1 1 drop table t1; +create table t1 (s1 datetime) partition by list (extract(hour from convert_tz(s1,'+00:00','+00:00'))) (partition p1 values in (0), partition p2 values in (1)); +insert into t1 values ('2004-01-01 00:00:00'); +drop table t1; End of 5.1 tests --- 1.19/mysql-test/t/partition.test 2006-03-07 22:37:52 +03:00 +++ 1.20/mysql-test/t/partition.test 2006-03-09 18:33:42 +03:00 @@ -540,4 +540,11 @@ from information_schema.partitions where table_schema ='test'; drop table t1; +# +# Bug #15142: Partitions: crash if list(convert_tz) +# +create table t1 (s1 datetime) partition by list (extract(hour from convert_tz(s1,'+00:00','+00:00'))) (partition p1 values in (0), partition p2 values in (1)); +insert into t1 values ('2004-01-01 00:00:00'); +drop table t1; + --echo End of 5.1 tests --- 1.43/sql/sql_partition.cc 2006-03-07 22:37:53 +03:00 +++ 1.44/sql/sql_partition.cc 2006-03-09 18:33:43 +03:00 @@ -3728,6 +3728,14 @@ DBUG_PRINT("info", ("Successful parse")); part_info= lex.part_info; + + /* + necessary to preserve timezone tables in lex context when timezone related + functions used in partition expression + */ + if (!old_lex->time_zone_tables_used) + old_lex->time_zone_tables_used= lex.time_zone_tables_used; + DBUG_PRINT("info", ("default engine = %d, default_db_type = %d", ha_legacy_type(part_info->default_engine_type), ha_legacy_type(default_db_type)));