Bug #38784 | Mysql server crash if table is altered with partition changes. | ||
---|---|---|---|
Submitted: | 13 Aug 2008 21:49 | Modified: | 20 Jan 2009 21:13 |
Reporter: | Hema Sridharan | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Partitions | Severity: | S2 (Serious) |
Version: | 5.1+ | OS: | Windows |
Assigned to: | Mattias Jonsson | CPU Architecture: | Any |
[13 Aug 2008 21:49]
Hema Sridharan
[14 Aug 2008 3:19]
Hema Sridharan
I got this crash from latest tree (pulled on 08/13/08). I am also able to reproduce this crash when we alter table by Dropping partitions, Rebuild partitions and Coalesce operations for Hash and Key partitions. Example: 1) CREATE TABLE t2( col1 INT, col2 CHAR(20), col3 DATE) PARTITION BY HASH (YEAR(col3)) PARTITIONS 4; ALTER TABLE t2 COALESCE PARTITION 2; Result ====== main.part_bug [ fail ] mysqltest: At line 33: query 'ALTER TABLE t2 COALESCE PARTITION 2' faile d: 2013: Lost connection to MySQL server during query 2) ALTER TABLE t1 DROP PARTITION p1; 3) ALTER TABLE t1 REBUILD PARTITION p0, p1; Example 2 and 3 also results in Server crash.
[10 Oct 2008 23:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
[10 Nov 2008 11:48]
Mattias Jonsson
I got some pointers from Ingo: Probably only with debug build on windows. The problem is the use of FN_LEN for buffers that are intended to take paths. FN_REFLEN would be appropriate there. The problem is that build_table_filename disregards the buffer size argument because it uses unpack_dirname, which does not have a size argument and expects FN_REFLEN. It seems that multiple write_log_*() functions are affected. FN_LEN is for a file name (a single element of a file path). FN_REFLEN is for a full path name.
[11 Nov 2008 18:19]
Mattias Jonsson
This also affects 5.1, but is harder to repeat, since it seams to need EXTRA_DEBUG, which is not yet supported in the configure.js and CMakeList.txt files. I will commit a patch which is against 5.1 and include the addition of EXTRA_DEBUG. The problem was that some local path variables was too small, changing them from FN_LEN to FN_REFLEN worked. The bug would probably affect 'release' build too, if one used very long file names or paths.
[12 Nov 2008 12:37]
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/58545 2706 Mattias Jonsson 2008-11-12 Bug#38784: Mysql server crash if table is altered with partition changes. Occurred with EXTRA_DEBUG on windows. Problem was insufficient length of a local variable that stored path names. Solution was to use the correct length.
[12 Nov 2008 14:35]
Mattias Jonsson
Mikael approved it.
[12 Nov 2008 15:06]
Ingo Strüwing
Approved.
[8 Dec 2008 15:19]
Mattias Jonsson
Pushed into mysql-5.1-bugteam and mysql-6.0-bugteam
[15 Jan 2009 6:41]
Bugs System
Pushed into 5.1.31 (revid:joro@sun.com-20090115053147-tx1oapthnzgvs1ro) (version source revid:azundris@mysql.com-20081230114838-cn52tu180wcrvh0h) (merge vers: 5.1.31) (pib:6)
[15 Jan 2009 16:30]
Jon Stephens
Documented in the 5.1.31 changelog as follows: ALTER TABLE ... ADD PARTITION and ALTER TABLE ... DROP PARTITION could cause the MySQL server to crash. This was only known to occur on Windows platforms where MySQL had been built with the EXTRA_DEBUG option. Set bug status back to PQ pending merge to 6.0 tree.
[15 Jan 2009 18:30]
Jon Stephens
Status should have been set to NDI.
[15 Jan 2009 18:50]
Mattias Jonsson
for Doc: Also note that EXTRA_DEBUG was not available on 5.1 until this fix, so it only affected 6.0! (i.e. with this fix it was made available on 5.1 AND fixed, so in reality the bug never affected 5.1).
[19 Jan 2009 11:26]
Bugs System
Pushed into 5.1.31-ndb-6.2.17 (revid:tomas.ulin@sun.com-20090119095303-uwwvxiibtr38djii) (version source revid:tomas.ulin@sun.com-20090115073240-1wanl85vlvw2she1) (merge vers: 5.1.31-ndb-6.2.17) (pib:6)
[19 Jan 2009 13:04]
Bugs System
Pushed into 5.1.31-ndb-6.3.21 (revid:tomas.ulin@sun.com-20090119104956-guxz190n2kh31fxl) (version source revid:tomas.ulin@sun.com-20090119104956-guxz190n2kh31fxl) (merge vers: 5.1.31-ndb-6.3.21) (pib:6)
[19 Jan 2009 13:51]
Jon Stephens
Commented out 5.1 changelog entry per developer comment. Set status to NDI pending merge to 6.0 (at which time I'll un-comment and re-tag the changelog entry written originally for 5.1).
[19 Jan 2009 16:10]
Bugs System
Pushed into 5.1.31-ndb-6.4.1 (revid:tomas.ulin@sun.com-20090119144033-4aylstx5czzz88i5) (version source revid:tomas.ulin@sun.com-20090119144033-4aylstx5czzz88i5) (merge vers: 5.1.31-ndb-6.4.1) (pib:6)
[19 Jan 2009 17:03]
Jon Stephens
Set back to NDI pending merge to 6.0.
[20 Jan 2009 18:56]
Bugs System
Pushed into 6.0.10-alpha (revid:joro@sun.com-20090119171328-2hemf2ndc1dxl0et) (version source revid:azundris@mysql.com-20081230114916-c290n83z25wkt6e4) (merge vers: 6.0.9-alpha) (pib:6)
[20 Jan 2009 21:13]
Jon Stephens
Fix noted in 6.0.10 changelog; closed.