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

Throw warning when table doesn't exist in columnstore so drop table if exists can still remove the front end table.

This commit is contained in:
Ben Thompson
2016-10-28 15:37:38 -05:00
parent a439b33a3f
commit c975f00973

View File

@ -137,7 +137,40 @@ DropTableProcessor::DDLResult DropTableProcessor::processPackage(ddlpackage::Dro
CalpontSystemCatalog::TableName tableName;
tableName.schema = dropTableStmt.fTableName->fSchema;
tableName.table = dropTableStmt.fTableName->fName;
roPair = systemCatalogPtr->tableRID( tableName );
try
{
roPair = systemCatalogPtr->tableRID(tableName);
}
catch (IDBExcept &ie)
{
if (ie.errorCode() == ERR_TABLE_NOT_IN_CATALOG)
{
Message::Args args;
Message message(1);
args.add("Table dropped with warning ");
args.add("Table does not exist in columnstore engine.");
args.add("");
args.add("");
message.format(args);
result.result = WARNING;
result.message = message;
fSessionManager.rolledback(txnID);
return result;
}
else
{
result.result = DROP_ERROR;
Message::Args args;
Message message(9);
args.add("Drop table failed due to ");
args.add(ie.what());
message.format(args);
result.message = message;
fSessionManager.rolledback(txnID);
return result;
}
}
uint32_t processID = ::getpid();
int32_t txnid = txnID.id;