1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

MCOL-4109 Error out instead of sending a warning

when a non-existing table is dropped.

This patch accomodates the changes made to server 10.5 as part
of MDEV-11412, where the server now tries to drop the table from
all storage engines when a .frm table does not exist.

We were earlier retuning a warning to the client and setting the
return code to 0. We now instead return ER_NO_SUCH_TABLE_IN_ENGINE
error code to the server if the table does not exist in
ColumnStore.
This commit is contained in:
Gagan Goel
2020-06-25 22:57:05 -04:00
parent 53e144cb90
commit bdf1336ad7
3 changed files with 9 additions and 7 deletions

View File

@ -2128,6 +2128,11 @@ int ProcessDDLStatement(string& ddlStatement, string& schema, const string& tabl
ci->isAlter = false;
}
if (b == ddlpackageprocessor::DDLPackageProcessor::DROP_TABLE_NOT_IN_CATALOG_ERROR)
{
return ER_NO_SUCH_TABLE_IN_ENGINE;
}
if ((b != 0) && (b != ddlpackageprocessor::DDLPackageProcessor::WARNING))
{
thd->get_stmt_da()->set_overwrite_status(true);
@ -2583,7 +2588,7 @@ int ha_mcs_impl_delete_table_(const char* db, const char* name, cal_connection_i
stmt += ";";
int rc = ProcessDDLStatement(stmt, schema, tbl, tid2sid(thd->thread_id), emsg);
if (rc != 0)
if (rc != 0 && rc != ER_NO_SUCH_TABLE_IN_ENGINE)
{
push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 9999, emsg.c_str());
}