1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Bug#6877 MySQL should give an error if the requested table type is not available

Implement new SQL mode - NO_ENGINE_SUBSTITUTION
This commit is contained in:
acurtis@xiphis.org
2005-06-17 22:14:44 +01:00
parent c78b19768d
commit 51dd521dfc
12 changed files with 95 additions and 38 deletions

View File

@ -165,12 +165,22 @@ my_bool ha_storage_engine_is_enabled(enum db_type database_type)
/* Use other database handler if databasehandler is not incompiled */
enum db_type ha_checktype(enum db_type database_type)
enum db_type ha_checktype(THD *thd, enum db_type database_type,
bool no_substitute, bool report_error)
{
THD *thd;
if (ha_storage_engine_is_enabled(database_type))
return database_type;
if (no_substitute)
{
if (report_error)
{
const char *engine_name= ha_get_storage_engine(database_type);
my_error(ER_FEATURE_DISABLED,MYF(0),engine_name,engine_name);
}
return DB_TYPE_UNKNOWN;
}
switch (database_type) {
#ifndef NO_HASH
case DB_TYPE_HASH:
@ -182,7 +192,6 @@ enum db_type ha_checktype(enum db_type database_type)
break;
}
thd= current_thd;
return ((enum db_type) thd->variables.table_type != DB_TYPE_UNKNOWN ?
(enum db_type) thd->variables.table_type :
((enum db_type) global_system_variables.table_type !=