Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
5b3da95b
Commit
5b3da95b
authored
Nov 17, 2017
by
Michael Widenius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify fn_rext
- Change interface according to real usage - Fix comment - Rename to fn_frm_ext
parent
326bfb07
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
15 deletions
+9
-15
sql/ha_partition.cc
sql/ha_partition.cc
+1
-1
sql/sql_db.cc
sql/sql_db.cc
+1
-2
sql/table.cc
sql/table.cc
+6
-11
sql/table.h
sql/table.h
+1
-1
No files found.
sql/ha_partition.cc
View file @
5b3da95b
...
...
@@ -685,7 +685,7 @@ int ha_partition::create(const char *name, TABLE *table_arg,
handler
**
file
,
**
abort_file
;
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 */
if
(
create_info
&&
create_info
->
tmp_table
())
...
...
sql/sql_db.cc
View file @
5b3da95b
...
...
@@ -1725,8 +1725,7 @@ bool mysql_upgrade_db(THD *thd, LEX_CSTRING *old_db)
DBUG_PRINT
(
"info"
,(
"Examining: %s"
,
file
->
name
));
/* skiping non-FRM files */
if
(
my_strcasecmp
(
files_charset_info
,
(
extension
=
fn_rext
(
file
->
name
)),
reg_ext
))
if
(
!
(
extension
=
(
char
*
)
fn_frm_ext
(
file
->
name
)))
continue
;
/* A frm file found, add the table info rename list */
...
...
sql/table.cc
View file @
5b3da95b
...
...
@@ -217,31 +217,26 @@ static uchar *get_field_name(Field **buff, size_t *length,
Returns pointer to '.frm' extension of the file name.
SYNOPSIS
fn_
r
ext()
fn_
frm_
ext()
name file name
DESCRIPTION
Checks file name part starting with the rightmost '.' character,
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
Pointer to the '.frm' extension. If there is no extension,
or extension is not '.frm', pointer at the end of file name.
Pointer to the '.frm' extension or NULL if not a .frm file
*/
c
har
*
fn_rext
(
char
*
name
)
c
onst
char
*
fn_frm_ext
(
const
char
*
name
)
{
char
*
res
=
strrchr
(
name
,
'.'
);
c
onst
c
har
*
res
=
strrchr
(
name
,
'.'
);
if
(
res
&&
!
strcmp
(
res
,
reg_ext
))
return
res
;
return
name
+
strlen
(
name
)
;
return
0
;
}
TABLE_CATEGORY
get_table_category
(
const
LEX_CSTRING
*
db
,
const
LEX_CSTRING
*
name
)
{
...
...
sql/table.h
View file @
5b3da95b
...
...
@@ -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
prepare_frm_header
(
THD
*
thd
,
uint
reclength
,
uchar
*
fileinfo
,
HA_CREATE_INFO
*
create_info
,
uint
keys
,
KEY
*
key_info
);
c
har
*
fn_rext
(
char
*
name
);
c
onst
char
*
fn_frm_ext
(
const
char
*
name
);
/* Check that the integer is in the internal */
static
inline
int
set_zone
(
int
nr
,
int
min_zone
,
int
max_zone
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment