Commit 562df4ee authored by unknown's avatar unknown

ha_innodb.cc:

  Return a sensible error code from DISCARD TABLESPACE, if it fails because the table is referenced by a FOREIGN KEY


sql/ha_innodb.cc:
  Return a sensible error code from DISCARD TABLESPACE, if it fails because the table is referenced by a FOREIGN KEY
parent 92655f14
...@@ -278,15 +278,15 @@ convert_error_code_to_mysql( ...@@ -278,15 +278,15 @@ convert_error_code_to_mysql(
} else if (error == (int) DB_LOCK_WAIT_TIMEOUT) { } else if (error == (int) DB_LOCK_WAIT_TIMEOUT) {
/* Since we rolled back the whole transaction, we must /* Since we rolled back the whole transaction, we must
tell it also to MySQL so that MySQL knows to empty the tell it also to MySQL so that MySQL knows to empty the
cached binlog for this transaction */ cached binlog for this transaction */
if (thd) { if (thd) {
ha_rollback(thd); ha_rollback(thd);
} }
return(HA_ERR_LOCK_WAIT_TIMEOUT); return(HA_ERR_LOCK_WAIT_TIMEOUT);
} else if (error == (int) DB_NO_REFERENCED_ROW) { } else if (error == (int) DB_NO_REFERENCED_ROW) {
...@@ -3954,11 +3954,9 @@ ha_innobase::discard_or_import_tablespace( ...@@ -3954,11 +3954,9 @@ ha_innobase::discard_or_import_tablespace(
err = row_import_tablespace_for_mysql(dict_table->name, trx); err = row_import_tablespace_for_mysql(dict_table->name, trx);
} }
if (err == DB_SUCCESS) { err = convert_error_code_to_mysql(err, NULL);
DBUG_RETURN(0);
}
DBUG_RETURN(-1); DBUG_RETURN(err);
} }
/********************************************************************* /*********************************************************************
......
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