1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Make the InnoDB FOREIGN KEY parser understand multi-statements. (Bug #48024)

Also make InnoDB thinks that /*/ only starts a comment. (Bug #53644).

This fixes the bugs in the InnoDB Plugin.

ha_innodb.h: Use trx_query_string() instead of trx_query() when
available (MySQL 5.1.42 or later).

innobase_get_stmt(): New function, to retrieve the currently running
SQL statement.

struct trx_struct: Remove mysql_query_str. Use innobase_get_stmt() instead.

dict_strip_comments(): Add and observe the parameter sql_length. Treat
/*/ as the start of a comment.

dict_create_foreign_constraints(), row_table_add_foreign_constraints():
Add the parameter sql_length.
This commit is contained in:
Marko Mäkelä
2010-05-14 16:08:15 +03:00
parent c3c2279cbd
commit 54f59fb55e
12 changed files with 131 additions and 53 deletions

View File

@ -2059,6 +2059,7 @@ row_table_add_foreign_constraints(
FOREIGN KEY (a, b) REFERENCES table2(c, d),
table2 can be written also with the
database name before it: test.table2 */
size_t sql_length, /*!< in: length of sql_string */
const char* name, /*!< in: table full name in the
normalized form
database_name/table_name */
@ -2080,8 +2081,8 @@ row_table_add_foreign_constraints(
trx_set_dict_operation(trx, TRX_DICT_OP_TABLE);
err = dict_create_foreign_constraints(trx, sql_string, name,
reject_fks);
err = dict_create_foreign_constraints(trx, sql_string, sql_length,
name, reject_fks);
if (err == DB_SUCCESS) {
/* Check that also referencing constraints are ok */
err = dict_load_foreigns(name, TRUE);