mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Simplify fn_rext
- Change interface according to real usage - Fix comment - Rename to fn_frm_ext
This commit is contained in:
@ -685,7 +685,7 @@ int ha_partition::create(const char *name, TABLE *table_arg,
|
|||||||
handler **file, **abort_file;
|
handler **file, **abort_file;
|
||||||
DBUG_ENTER("ha_partition::create");
|
DBUG_ENTER("ha_partition::create");
|
||||||
|
|
||||||
DBUG_ASSERT(*fn_rext((char*)name) == '\0');
|
DBUG_ASSERT(!fn_frm_ext(name));
|
||||||
|
|
||||||
/* Not allowed to create temporary partitioned tables */
|
/* Not allowed to create temporary partitioned tables */
|
||||||
if (create_info && create_info->tmp_table())
|
if (create_info && create_info->tmp_table())
|
||||||
|
@ -1725,8 +1725,7 @@ bool mysql_upgrade_db(THD *thd, LEX_CSTRING *old_db)
|
|||||||
DBUG_PRINT("info",("Examining: %s", file->name));
|
DBUG_PRINT("info",("Examining: %s", file->name));
|
||||||
|
|
||||||
/* skiping non-FRM files */
|
/* skiping non-FRM files */
|
||||||
if (my_strcasecmp(files_charset_info,
|
if (!(extension= (char*) fn_frm_ext(file->name)))
|
||||||
(extension= fn_rext(file->name)), reg_ext))
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* A frm file found, add the table info rename list */
|
/* A frm file found, add the table info rename list */
|
||||||
|
17
sql/table.cc
17
sql/table.cc
@ -217,31 +217,26 @@ static uchar *get_field_name(Field **buff, size_t *length,
|
|||||||
Returns pointer to '.frm' extension of the file name.
|
Returns pointer to '.frm' extension of the file name.
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
fn_rext()
|
fn_frm_ext()
|
||||||
name file name
|
name file name
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
Checks file name part starting with the rightmost '.' character,
|
Checks file name part starting with the rightmost '.' character,
|
||||||
and returns it if it is equal to '.frm'.
|
and returns it if it is equal to '.frm'.
|
||||||
|
|
||||||
TODO
|
|
||||||
It is a good idea to get rid of this function modifying the code
|
|
||||||
to garantee that the functions presently calling fn_rext() always
|
|
||||||
get arguments in the same format: either with '.frm' or without '.frm'.
|
|
||||||
|
|
||||||
RETURN VALUES
|
RETURN VALUES
|
||||||
Pointer to the '.frm' extension. If there is no extension,
|
Pointer to the '.frm' extension or NULL if not a .frm file
|
||||||
or extension is not '.frm', pointer at the end of file name.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
char *fn_rext(char *name)
|
const char *fn_frm_ext(const char *name)
|
||||||
{
|
{
|
||||||
char *res= strrchr(name, '.');
|
const char *res= strrchr(name, '.');
|
||||||
if (res && !strcmp(res, reg_ext))
|
if (res && !strcmp(res, reg_ext))
|
||||||
return res;
|
return res;
|
||||||
return name + strlen(name);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TABLE_CATEGORY get_table_category(const LEX_CSTRING *db,
|
TABLE_CATEGORY get_table_category(const LEX_CSTRING *db,
|
||||||
const LEX_CSTRING *name)
|
const LEX_CSTRING *name)
|
||||||
{
|
{
|
||||||
|
@ -2702,7 +2702,7 @@ ulong get_form_pos(File file, uchar *head, TYPELIB *save_names);
|
|||||||
void append_unescaped(String *res, const char *pos, uint length);
|
void append_unescaped(String *res, const char *pos, uint length);
|
||||||
void prepare_frm_header(THD *thd, uint reclength, uchar *fileinfo,
|
void prepare_frm_header(THD *thd, uint reclength, uchar *fileinfo,
|
||||||
HA_CREATE_INFO *create_info, uint keys, KEY *key_info);
|
HA_CREATE_INFO *create_info, uint keys, KEY *key_info);
|
||||||
char *fn_rext(char *name);
|
const char *fn_frm_ext(const char *name);
|
||||||
|
|
||||||
/* Check that the integer is in the internal */
|
/* Check that the integer is in the internal */
|
||||||
static inline int set_zone(int nr,int min_zone,int max_zone)
|
static inline int set_zone(int nr,int min_zone,int max_zone)
|
||||||
|
Reference in New Issue
Block a user