diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-04-06 12:08:30 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-04-06 12:08:30 +0300 |
commit | 9d94c60f2b67b6008c69d51b0b85ac539a1ce647 (patch) | |
tree | f4a3198e4326358343abf9bfe3c667a726e23495 /sql/datadict.cc | |
parent | d6758efbe126cdc6a0718a4b560d9e8f494c0399 (diff) | |
parent | cacb61b6be78b01a9c62890cc81d059ee46921ac (diff) | |
download | mariadb-git-9d94c60f2b67b6008c69d51b0b85ac539a1ce647.tar.gz |
Merge 10.5 into 10.6
Diffstat (limited to 'sql/datadict.cc')
-rw-r--r-- | sql/datadict.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sql/datadict.cc b/sql/datadict.cc index b2c4b615c4d..e85478a710c 100644 --- a/sql/datadict.cc +++ b/sql/datadict.cc @@ -1,4 +1,5 @@ /* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2017, 2022, MariaDB corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -105,16 +106,12 @@ Table_type dd_frm_type(THD *thd, char *path, LEX_CSTRING *engine_name, goto err; } - /* engine_name is 0 if we only want to know if table is view or not */ - if (!engine_name) - goto err; - if (!is_binary_frm_header(header)) goto err; dbt= header[3]; - if (((header[39] >> 4) & 3) == HA_CHOICE_YES) + if ((header[39] & 0x30) == (HA_CHOICE_YES << 4)) { DBUG_PRINT("info", ("Sequence found")); type= TABLE_TYPE_SEQUENCE; @@ -134,7 +131,8 @@ Table_type dd_frm_type(THD *thd, char *path, LEX_CSTRING *engine_name, handlerton *ht= ha_resolve_by_legacy_type(thd, (legacy_db_type) dbt); if (ht) { - *engine_name= hton2plugin[ht->slot]->name; + if (engine_name) + *engine_name= hton2plugin[ht->slot]->name; #ifdef WITH_PARTITION_STORAGE_ENGINE if (partition_engine_name && dbt == DB_TYPE_PARTITION_DB) { @@ -155,6 +153,7 @@ Table_type dd_frm_type(THD *thd, char *path, LEX_CSTRING *engine_name, cont: #endif /* read the true engine name */ + if (engine_name) { MY_STAT state; uchar *frm_image= 0; |