Bug #25596 | InnoDB Alter Table Failures | ||
---|---|---|---|
Submitted: | 12 Jan 2007 21:13 | Modified: | 20 Feb 2007 20:30 |
Reporter: | Richard Harms | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S2 (Serious) |
Version: | 5.0.32, 5.0.36-bk | OS: | Linux (Linux, Windows, Mac OS X 10.4.8) |
Assigned to: | Marko Mäkelä | CPU Architecture: | Any |
[12 Jan 2007 21:13]
Richard Harms
[15 Jan 2007 7:38]
Sveta Smirnova
Thank you for the report. Please provide output of SHOW CREATE TABLE for some of tables, adding FOREIGN KEY to which causes error.
[15 Jan 2007 12:20]
Heikki Tuuri
Hi! Hmm... there were not that many changes between 5.0.30 and .32. I will diff the InnoDB source files. The bug looks like memory corruption, or a stray pointer. Regards, Heikki
[16 Jan 2007 16:23]
Heikki Tuuri
This may be a duplicate of http://bugs.mysql.com/bug.php?id=25653
[16 Jan 2007 16:35]
Axel Schwenke
Modified according to duplicate bug#25653
[16 Jan 2007 18:04]
Heikki Tuuri
The bug is probably that strchr(" \v\f\t\r\n", c) checks also if c matches to the last character in the string, and the last character is \0! It is a nul-terminated string. Thus, the parser thinks that also the ending nul character is a space! This is a gotcha of standard C. We need to check all occurrences of strchr() in InnoDB if there is a similar bug somewhere. Assigning this to Marko. Fix: replace strchr(" \v\f\t\r\n", c) with (strchr(" \v\f\t\r\n", c) && c != '\0')
[16 Jan 2007 18:32]
Richard Harms
I made the change that you suggested to this file: innobase/dict/dict0dict.c:#define ib_isspace(c) strchr(" \v\f\t\r\n", c) And it does appear to correct the problem. Thank you!
[16 Jan 2007 20:08]
Marko Mäkelä
My bad: my draft copy of ISO/IEC 9899:1999 indeed says: "The strchr function locates the first occurrence of c (converted to a char) in the string pointed to by s. The terminating null character is considered to be part of the string." The GNU libc documentation of strchr did not mention that the terminating null character is considered to be part of the string.
[16 Jan 2007 20:30]
Marko Mäkelä
The only other occurrence of strchr with the second parameter being something else than '/' is in mem_strdupq(), where the second parameter is always the single quote. The only place where the terminating null character of the string passed to strchr() makes a difference is the definition of the ib_isspace() macro.
[14 Feb 2007 15:00]
Chad MILLER
Available in 4.1.23, 5.0.36, and 5.1.16-beta.
[14 Feb 2007 19:01]
Marko Mäkelä
Chad, 5.1 was never affected by Bug #24299, whose fix in 4.1 and 5.0 caused this bug. Thus, I do not understand how any fix could be available in 5.1.16-beta.
[20 Feb 2007 20:30]
Paul DuBois
Noted in 4.1.23, 5.0.36 (but not 5.1.16) changelogs. The InnoDB parser sometimes did not account for null bytes, causing spurious failure of some queries.
[20 Feb 2007 20:48]
Chad MILLER
Sorry, Marko, I didn't notice that what went into 5.1 was a null-merge changeset that affected nothing.
[7 Feb 2008 3:01]
rajeshwar reddy
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
[7 Feb 2008 3:02]
rajeshwar reddy
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946) com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870) com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:812) com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3269) com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1182) com.mysql.jdbc.Connection.createNewIO(Connection.java:2670) com.mysql.jdbc.Connection.<init>(Connection.java:1531) com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266) java.sql.DriverManager.getConnection(Unknown Source) java.sql.DriverManager.getConnection(Unknown Source) com.mysql.grt.modules.ReverseEngineeringGeneric.establishConnection(ReverseEngineeringGeneric.java:141) com.mysql.grt.modules.ReverseEngineeringMysqlJdbc.getSchemata(ReverseEngineeringMysqlJdbc.java:42) sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) com.mysql.grt.Grt.callModuleFunction(Unknown Source)
[7 Feb 2008 7:09]
Timothy Smith
Rajeshwar, Hi. From what you've posted, it looks unrelated to the present bug. I suggest that, if you have a MySQL support contract, you open a new support issue. The support engineer will help diagnose what's happening, and open a new bug report if needed on your behalf. Or, please post to our user forums (forums.mysql.com), perhaps in the JDBC and Java forum. Post more than just the stack trace - a complete program that demonstrates the problem is best, but at least give a description of what you're doing. Regards, Timothy