diff options
author | unknown <heikki@hundin.mysql.fi> | 2004-12-27 04:40:10 +0200 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2004-12-27 04:40:10 +0200 |
commit | 562df4ee0a89e7fa1bf2cd98298a0dc3f804b8b0 (patch) | |
tree | 782b6556c3fec05c13ed158786bfcdaf774aebda /sql | |
parent | 92655f14d2d439a620cf5de5f56e38befd702818 (diff) | |
download | mariadb-git-562df4ee0a89e7fa1bf2cd98298a0dc3f804b8b0.tar.gz |
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
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_innodb.cc | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 7b6fb31acc6..14b143ca04b 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -278,15 +278,15 @@ convert_error_code_to_mysql( } else if (error == (int) DB_LOCK_WAIT_TIMEOUT) { - /* Since we rolled back the whole transaction, we must - tell it also to MySQL so that MySQL knows to empty the - cached binlog for this transaction */ + /* Since we rolled back the whole transaction, we must + tell it also to MySQL so that MySQL knows to empty the + cached binlog for this transaction */ - if (thd) { - ha_rollback(thd); - } + if (thd) { + ha_rollback(thd); + } - return(HA_ERR_LOCK_WAIT_TIMEOUT); + return(HA_ERR_LOCK_WAIT_TIMEOUT); } else if (error == (int) DB_NO_REFERENCED_ROW) { @@ -3954,11 +3954,9 @@ ha_innobase::discard_or_import_tablespace( err = row_import_tablespace_for_mysql(dict_table->name, trx); } - if (err == DB_SUCCESS) { - DBUG_RETURN(0); - } + err = convert_error_code_to_mysql(err, NULL); - DBUG_RETURN(-1); + DBUG_RETURN(err); } /********************************************************************* |