You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-12-07 20:42:15 +03:00
MCOL-5 We've had problems with CREATE and DELETE crashing. Add some better error handling
This commit is contained in:
@@ -3123,6 +3123,18 @@ int ha_calpont_impl_create(const char *name, TABLE *table_arg, HA_CREATE_INFO *c
|
||||
//@Bug 1948. Mysql calls create table to create a new table with new signature.
|
||||
if (ci->alterTableState > 0) return 0;
|
||||
|
||||
// Just to be sure
|
||||
if (!table_arg)
|
||||
{
|
||||
setError(thd, ER_INTERNAL_ERROR, "ha_calpont_impl_create_: table_arg is NULL");
|
||||
return 1;
|
||||
}
|
||||
if (!table_arg->s)
|
||||
{
|
||||
setError(thd, ER_INTERNAL_ERROR, "ha_calpont_impl_create_: table_arg->s is NULL");
|
||||
return 1;
|
||||
}
|
||||
|
||||
int rc = ha_calpont_impl_create_(name, table_arg, create_info, *ci);
|
||||
|
||||
return rc;
|
||||
@@ -3130,11 +3142,17 @@ int ha_calpont_impl_create(const char *name, TABLE *table_arg, HA_CREATE_INFO *c
|
||||
|
||||
int ha_calpont_impl_delete_table(const char *name)
|
||||
{
|
||||
THD *thd = current_thd;
|
||||
|
||||
if (!name)
|
||||
{
|
||||
setError(thd, ER_INTERNAL_ERROR, "Drop Table with NULL name not permitted");
|
||||
return 1;
|
||||
}
|
||||
|
||||
//if this is an InfiniDB tmp table ('#sql*.frm') just leave...
|
||||
if (!memcmp((uchar*)name, tmp_file_prefix, tmp_file_prefix_length)) return 0;
|
||||
|
||||
THD *thd = current_thd;
|
||||
|
||||
// @bug1940 Do nothing for select query. Support of set default engine to IDB.
|
||||
if (string(name).find("@0024vtable") != string::npos)
|
||||
return 0;
|
||||
@@ -3156,6 +3174,11 @@ int ha_calpont_impl_delete_table(const char *name)
|
||||
}
|
||||
|
||||
TABLE_LIST *first_table= (TABLE_LIST*) thd->lex->select_lex.table_list.first;
|
||||
if (!first_table->db)
|
||||
{
|
||||
setError(thd, ER_INTERNAL_ERROR, "Drop Table with NULL schema not permitted");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!ci) return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user