summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorunknown <tulin@dl145b.mysql.com>2005-06-18 09:21:50 +0200
committerunknown <tulin@dl145b.mysql.com>2005-06-18 09:21:50 +0200
commit5ac7f0b3e4f3b019f212d9d3b82995bd1ac38d76 (patch)
tree3dcc8706f4e1e391d796702969759c1e135a4620 /sql/handler.cc
parent06d99235b7f1d7d80012ccf2fc8276780fb3de15 (diff)
parent0945dea8d08b13189691052b79fe2bd255e0f008 (diff)
downloadmariadb-git-5ac7f0b3e4f3b019f212d9d3b82995bd1ac38d76.tar.gz
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into dl145b.mysql.com:/home/ndbdev/tomas/mysql-5.1 sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/sql_delete.cc: Auto merged sql/sql_table.cc: Auto merged sql/table.cc: Auto merged sql/unireg.cc: Auto merged
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 555b6ccc1cb..06a1c09fcc8 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -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 !=