diff options
author | Sergei Golubchik <serg@mariadb.org> | 2020-06-15 14:06:08 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2020-07-04 01:44:46 +0200 |
commit | 35f566db8d847c707d0ba7f3de239bfeee9ca845 (patch) | |
tree | b3089bb0b9185ac60c00a3a2b1eb8ba2e02f3721 /sql/datadict.cc | |
parent | 2bb5981c202f85c8399485d6a57a69d8c6f627af (diff) | |
download | mariadb-git-35f566db8d847c707d0ba7f3de239bfeee9ca845.tar.gz |
cleanup: make dd_frm_type to work as documented
remove redundant argument, return all possible enum values
Diffstat (limited to 'sql/datadict.cc')
-rw-r--r-- | sql/datadict.cc | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/sql/datadict.cc b/sql/datadict.cc index 5cfda166b2b..e09eee98565 100644 --- a/sql/datadict.cc +++ b/sql/datadict.cc @@ -49,16 +49,13 @@ static int read_string(File file, uchar**to, size_t length) If engine_name is 0, then the function will only test if the file is a view or not - @param[out] is_sequence 1 if table is a SEQUENCE, 0 otherwise - @retval TABLE_TYPE_UNKNOWN error - file can't be opened @retval TABLE_TYPE_NORMAL table @retval TABLE_TYPE_SEQUENCE sequence table @retval TABLE_TYPE_VIEW view */ -Table_type dd_frm_type(THD *thd, char *path, LEX_CSTRING *engine_name, - bool *is_sequence) +Table_type dd_frm_type(THD *thd, char *path, LEX_CSTRING *engine_name) { File file; uchar header[40]; //"TYPE=VIEW\n" it is 10 characters @@ -67,10 +64,8 @@ Table_type dd_frm_type(THD *thd, char *path, LEX_CSTRING *engine_name, uchar dbt; DBUG_ENTER("dd_frm_type"); - *is_sequence= 0; - - if ((file= mysql_file_open(key_file_frm, path, O_RDONLY | O_SHARE, MYF(0))) - < 0) + file= mysql_file_open(key_file_frm, path, O_RDONLY | O_SHARE, MYF(0)); + if (file < 0) DBUG_RETURN(TABLE_TYPE_UNKNOWN); /* @@ -110,7 +105,7 @@ Table_type dd_frm_type(THD *thd, char *path, LEX_CSTRING *engine_name, if (((header[39] >> 4) & 3) == HA_CHOICE_YES) { DBUG_PRINT("info", ("Sequence found")); - *is_sequence= 1; + type= TABLE_TYPE_SEQUENCE; } /* cannot use ha_resolve_by_legacy_type without a THD */ |