1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

current_thd is 0 if ha_resolve_by_name() is called when parsing command-line options

This commit is contained in:
serg@serg.mylan
2004-05-17 18:45:59 +02:00
parent e58b9c62fb
commit 7961968ada

View File

@@ -103,15 +103,16 @@ TYPELIB tx_isolation_typelib= {array_elements(tx_isolation_names)-1,"",
enum db_type ha_resolve_by_name(const char *name, uint namelen)
{
if (!my_strcasecmp(&my_charset_latin1, name, "DEFAULT")) {
return(enum db_type) current_thd->variables.table_type;
THD *thd=current_thd;
if (thd && !my_strcasecmp(&my_charset_latin1, name, "DEFAULT")) {
return (enum db_type) thd->variables.table_type;
}
show_table_type_st *types;
for (types= sys_table_types; types->type; types++)
{
if (!my_strcasecmp(&my_charset_latin1, name, types->type))
return(enum db_type)types->db_type;
return (enum db_type) types->db_type;
}
return DB_TYPE_UNKNOWN;
}