~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/row/row0mysql.c

Merge Revision revid:marko.makela@oracle.com-20100514130815-ym7j7cfu88ro6km4 from MySQL InnoDB

Original revid:marko.makela@oracle.com-20100514130815-ym7j7cfu88ro6km4

Original Authors: Marko Mkel <marko.makela@oracle.com>
Original commit message:
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.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2030
2030
                                FOREIGN KEY (a, b) REFERENCES table2(c, d),
2031
2031
                                        table2 can be written also with the
2032
2032
                                        database name before it: test.table2 */
 
2033
        size_t          sql_length,     /*!< in: length of sql_string */
2033
2034
        const char*     name,           /*!< in: table full name in the
2034
2035
                                        normalized form
2035
2036
                                        database_name/table_name */
2051
2052
 
2052
2053
        trx_set_dict_operation(trx, TRX_DICT_OP_TABLE);
2053
2054
 
2054
 
        err = dict_create_foreign_constraints(trx, sql_string, name,
2055
 
                                              reject_fks);
 
2055
        err = dict_create_foreign_constraints(trx, sql_string, sql_length,
 
2056
                                              name, reject_fks);
2056
2057
        if (err == DB_SUCCESS) {
2057
2058
                /* Check that also referencing constraints are ok */
2058
2059
                err = dict_load_foreigns(name, TRUE);