Bug #17497 Partitions: crash if add partition on temporary table
Submitted: 16 Feb 2006 23:30 Modified: 15 Mar 2006 14:51
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Partitions Severity:S3 (Non-critical)
Version:5.1.7-beta-debug OS:Linux (SUSE 10.0)
Assigned to: Jim Winstead CPU Architecture:Any

[16 Feb 2006 23:30] Peter Gulutzan
Description:
I create a temporary table with partitioning.
I try to alter ... add partition. Failure.
I say "show create table". Crash.

How to repeat:
mysql> create temporary table t9 (s1 int) partition by list (s1) (partition p1 values in (1));
Query OK, 0 rows affected (0.00 sec)

mysql> alter table t9 add partition (partition p2 values in (5));
ERROR 1005 (HY000): Can't create table 't9' (errno: 17)
mysql> show create table t9;
ERROR 2013 (HY000): Lost connection to MySQL server during query
[17 Feb 2006 0:06] MySQL Verification Team
Thank you for the bug report.

060216 20:51:03 [Note] libexec/mysqld: ready for connections.
Version: '5.1.7-beta-debug'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
mysqld got signal 11;

<cut>

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0x922bfa0 = show create table t9
thd->thread_id=2
[23 Feb 2006 0:16] Brian Aker
Should we even allow someone to create a partition on a temp table?
[23 Feb 2006 5:02] Reggie Burnett
No, we should not allow adding partitions to temp tables.  Jim, can you just disallow alter table add partition when the underlying table is temp?
[8 Mar 2006 17:44] 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/3595
[13 Mar 2006 19:05] Jim Winstead
Fixed in 5.1.8.
[15 Mar 2006 10:19] Jim Winstead
From the changeset comment: "Temporary tables are no longer allowed to be partitioned."

you can no longer even do a CREATE TEMPORARY TABLE ... PARTITION BY
[15 Mar 2006 14:51] Jon Stephens
Thank you for your bug report. This issue has been addressed in the
documentation. The updated documentation will appear on our website
shortly, and will be included in the next release of the relevant
product(s).

Additional info:

Documented new restriction in 5.1.8 changelog and 5.1 Manual partitioning chapter.