1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-07 03:22:57 +03:00

Merge pull request #1311 from tntnatbry/MCOL-4109

MCOL-4109 Error out instead of sending a warning
This commit is contained in:
Patrick LeBlanc
2020-06-29 14:20:12 -05:00
committed by GitHub
3 changed files with 9 additions and 7 deletions

View File

@@ -88,7 +88,7 @@ public:
*/ */
enum ResultCode { NO_ERROR, CREATE_ERROR, ALTER_ERROR, DROP_ERROR, TRUNC_ERROR, enum ResultCode { NO_ERROR, CREATE_ERROR, ALTER_ERROR, DROP_ERROR, TRUNC_ERROR,
TOKENIZATION_ERROR, NOT_ACCEPTING_PACKAGES, PK_NOTNULL_ERROR, WARNING, USER_ERROR, NETWORK_ERROR, PARTITION_WARNING, TOKENIZATION_ERROR, NOT_ACCEPTING_PACKAGES, PK_NOTNULL_ERROR, WARNING, USER_ERROR, NETWORK_ERROR, PARTITION_WARNING,
WARN_NO_PARTITION WARN_NO_PARTITION, DROP_TABLE_NOT_IN_CATALOG_ERROR
}; };
enum DebugLevel /** @brief Debug level type enumeration */ enum DebugLevel /** @brief Debug level type enumeration */

View File

@@ -151,12 +151,9 @@ DropTableProcessor::DDLResult DropTableProcessor::processPackage(ddlpackage::Dro
{ {
Message::Args args; Message::Args args;
Message message(1); Message message(1);
args.add("Table dropped with warning "); args.add("Table does not exist in ColumnStore.");
args.add("Table does not exist in columnstore engine.");
args.add("");
args.add("");
message.format(args); message.format(args);
result.result = WARNING; result.result = DROP_TABLE_NOT_IN_CATALOG_ERROR;
result.message = message; result.message = message;
fSessionManager.rolledback(txnID); fSessionManager.rolledback(txnID);
return result; return result;

View File

@@ -2128,6 +2128,11 @@ int ProcessDDLStatement(string& ddlStatement, string& schema, const string& tabl
ci->isAlter = false; 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)) if ((b != 0) && (b != ddlpackageprocessor::DDLPackageProcessor::WARNING))
{ {
thd->get_stmt_da()->set_overwrite_status(true); 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 += ";"; stmt += ";";
int rc = ProcessDDLStatement(stmt, schema, tbl, tid2sid(thd->thread_id), emsg); 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()); push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 9999, emsg.c_str());
} }