Description:
This is a spin-off of bug #40877.
Innodb threats the query text that is passed to it by the server (through thd_query()) as
a null-terminated string.
This causes problems with multi-statements that contain foreign key definition code, as
demonstrated by the example in bug #40877 because the individual statements in such a
multi statement are not null terminated and Innodb gets confused by reading the foreign
key definitions in the next statement(s).
How to repeat:
See the example in bug #40877
Suggested fix:
I will implement a new function for 5.1 that returns a pointer to LEX_STRING instead
(string pointer and length).
Please update the innodb logic to use the new function in 5.1 codebase instead of
thd_query() (that I want to obsolete).
Please update the the 5.0 innodb code to use store and use THD::query_length.
Note that the fix for bug #40877 (the extended API function) is a pre-requisite for this
bug.