Bug #48165 Partitions: search fails with information_schema
Submitted: 19 Oct 2009 18:24 Modified: 12 Nov 2009 12:05
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Partitions Severity:S3 (Non-critical)
Version:5.4.3-beta OS:Linux (SUSE 11.1 64-bit)
Assigned to: CPU Architecture:Any

[19 Oct 2009 18:24] Peter Gulutzan
Description:
I'm using mysql-trunk-wl3352.

I create a partitioned table based on an invalid date.
I change sql_mode so that invalid dates are unacceptable.
I try to select from information_schema.partitions.
I fail.

The MySQL Reference Manual
http://dev.mysql.com/doc/refman/5.1/en/partitioning-limitations.html
warns "... a change in the SQL mode at any time after the creation
of partitioned tables may lead to major changes in the behavior of such
tables ...".
But this is not a change in the behaviour of partitioned tables.
It is a change in the behaviour of information_schema tables.

How to repeat:
drop table t1;
set @@sql_mode=allow_invalid_dates;
CREATE TABLE t1 (a CHAR, b CHAR, c date)
PARTITION BY RANGE COLUMN_LIST(a,b,c)
(PARTITION p0 VALUES LESS THAN (COLUMN_LIST('x','y','3000-11-31')));
set @@sql_mode='';
select * from information_schema.partitions where table_name='t1'\G
[19 Oct 2009 19:20] MySQL Verification Team
Thank you for the bug report. Verified as described.
[28 Oct 2009 0:14] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/88432

2901 Mikael Ronstrom	2009-10-28
      BUG#48165, needed to introduce length restrictions on partitioning fields to ensure that no stack overruns occur
      modified:
        mysql-test/r/partition_column.result
        mysql-test/r/partition_datatype.result
        mysql-test/t/partition_column.test
        mysql-test/t/partition_datatype.test
        sql/opt_range.cc
        sql/partition_info.cc
        sql/partition_info.h
        sql/share/errmsg.txt
        sql/sql_partition.cc
        sql/sql_partition.h
        sql/sql_show.cc
[5 Nov 2009 6:51] Bugs System
Pushed into 6.0.14-alpha (revid:mikael@mysql.com-20091104090210-om5lq1v39ppduu0e) (version source revid:mikael@mysql.com-20091030163450-387z4yevx0lrj3fb) (merge vers: 6.0.14-alpha) (pib:13)
[5 Nov 2009 17:39] Jon Stephens
Discussed with Mikael; he confirmed that this fix was pushed together with main push for WL#3352; closed without further action.
[12 Nov 2009 8:19] Bugs System
Pushed into 5.5.0-beta (revid:alik@sun.com-20091110093229-0bh5hix780cyeicl) (version source revid:mikael@mysql.com-20091028172236-0v5j962mh2opxpkj) (merge vers: 5.5.0-beta) (pib:13)
[12 Nov 2009 12:05] Jon Stephens
Re-closed; see previous comments.