Commit cf595632 authored by unknown's avatar unknown

row0ins.c:

  Return the code of row_ins_foreign_check_on_constraint() as close to 4.0 as possible, except that we use mem_strdup() to allocate the memory for the modified table name


innobase/row/row0ins.c:
  Return the code of row_ins_foreign_check_on_constraint() as close to 4.0 as possible, except that we use mem_strdup() to allocate the memory for the modified table name
parent 56392008
...@@ -651,25 +651,27 @@ row_ins_foreign_check_on_constraint( ...@@ -651,25 +651,27 @@ row_ins_foreign_check_on_constraint(
ulint n_to_update; ulint n_to_update;
ulint err; ulint err;
ulint i; ulint i;
const char* ptr; char* ptr;
char* table_name; char* table_name_buf;
ut_a(thr && foreign && pcur && mtr); ut_a(thr && foreign && pcur && mtr);
#ifndef UNIV_HOTBACKUP
/* Since we are going to delete or update a row, we have to invalidate /* Since we are going to delete or update a row, we have to invalidate
the MySQL query cache for table */ the MySQL query cache for table */
ptr = strchr(table->name, '/'); table_name_buf = mem_strdup(table->name);
ptr = strchr(table_name_buf, '/');
ut_a(ptr); ut_a(ptr);
table_name = mem_strdup(table->name); *ptr = '\0';
table_name[ptr - table->name] = 0;
#ifndef UNIV_HOTBACKUP
/* We call a function in ha_innodb.cc */ /* We call a function in ha_innodb.cc */
innobase_invalidate_query_cache(thr_get_trx(thr), table_name, innobase_invalidate_query_cache(thr_get_trx(thr), table_name_buf,
strlen(table->name) + 1); strlen(table->name) + 1);
mem_free(table_name);
#endif #endif
mem_free(table_name_buf);
node = thr->run_node; node = thr->run_node;
if (node->is_delete && 0 == (foreign->type & if (node->is_delete && 0 == (foreign->type &
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment