mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Store and read engine type string in extra block of .frm.
This commit is contained in:
@ -183,15 +183,18 @@ enum db_type ha_resolve_by_name(const char *name, uint namelen)
|
||||
THD *thd= current_thd;
|
||||
show_table_alias_st *table_alias;
|
||||
handlerton **types;
|
||||
const char *ptr= name;
|
||||
|
||||
if (thd && !my_strcasecmp(&my_charset_latin1, ptr, "DEFAULT"))
|
||||
if (thd && !my_strnncoll(&my_charset_latin1,
|
||||
(const uchar *)name, namelen,
|
||||
(const uchar *)"DEFAULT", 7))
|
||||
return (enum db_type) thd->variables.table_type;
|
||||
|
||||
retest:
|
||||
for (types= sys_table_types; *types; types++)
|
||||
{
|
||||
if (!my_strcasecmp(&my_charset_latin1, ptr, (*types)->name))
|
||||
if (!my_strnncoll(&my_charset_latin1,
|
||||
(const uchar *)name, namelen,
|
||||
(const uchar *)(*types)->name, strlen((*types)->name)))
|
||||
return (enum db_type) (*types)->db_type;
|
||||
}
|
||||
|
||||
@ -200,9 +203,12 @@ retest:
|
||||
*/
|
||||
for (table_alias= sys_table_aliases; table_alias->type; table_alias++)
|
||||
{
|
||||
if (!my_strcasecmp(&my_charset_latin1, ptr, table_alias->alias))
|
||||
if (!my_strnncoll(&my_charset_latin1,
|
||||
(const uchar *)name, namelen,
|
||||
(const uchar *)table_alias->alias, strlen(table_alias->alias)))
|
||||
{
|
||||
ptr= table_alias->type;
|
||||
name= table_alias->type;
|
||||
namelen= strlen(name);
|
||||
goto retest;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user