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
163478db
Commit
163478db
authored
Oct 23, 2016
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: InnoDB: is_partition()
parent
4aab0588
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
35 deletions
+26
-35
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+26
-35
No files found.
storage/innobase/handler/ha_innodb.cc
View file @
163478db
...
...
@@ -281,6 +281,26 @@ void set_my_errno(int err)
errno
=
err
;
}
/** Checks whether the file name belongs to a partition of a table.
@param[in] file_name file name
@return pointer to the end of the table name part of the file name, or NULL */
static
char
*
is_partition
(
/*=========*/
char
*
file_name
)
{
/* We look for pattern #P# to see if the table is partitioned
MariaDB table. */
#ifdef _WIN32
return
strstr
(
file_name
,
"#p#"
);
#else
return
strstr
(
file_name
,
"#P#"
);
#endif
/* _WIN32 */
}
/** Return the InnoDB ROW_FORMAT enum value
@param[in] row_format row_format from "innodb_default_row_format"
@return InnoDB ROW_FORMAT value from rec_format_t enum. */
...
...
@@ -6715,7 +6735,6 @@ ha_innobase::open(
dict_table_t
*
ib_table
;
char
norm_name
[
FN_REFLEN
];
THD
*
thd
;
char
*
is_part
=
NULL
;
dict_err_ignore_t
ignore_err
=
DICT_ERR_IGNORE_NONE
;
DBUG_ENTER
(
"ha_innobase::open"
);
...
...
@@ -6745,13 +6764,7 @@ ha_innobase::open(
m_upd_buf
=
NULL
;
m_upd_buf_size
=
0
;
/* We look for pattern #P# to see if the table is partitioned
MySQL table. */
#ifdef _WIN32
is_part
=
strstr
(
norm_name
,
"#p#"
);
#else
is_part
=
strstr
(
norm_name
,
"#P#"
);
#endif
/* _WIN32 */
char
*
is_part
=
is_partition
(
norm_name
);
/* Check whether FOREIGN_KEY_CHECKS is set to 0. If so, the table
can be opened even if some FK indexes are missing. If not, the table
...
...
@@ -14546,12 +14559,7 @@ ha_innobase::delete_table(
if
(
err
==
DB_TABLE_NOT_FOUND
&&
innobase_get_lower_case_table_names
()
==
1
)
{
char
*
is_part
=
NULL
;
#ifdef __WIN__
is_part
=
strstr
(
norm_name
,
"#p#"
);
#else
is_part
=
strstr
(
norm_name
,
"#P#"
);
#endif
/* __WIN__ */
char
*
is_part
=
is_partition
(
norm_name
);
if
(
is_part
)
{
char
par_case_name
[
FN_REFLEN
];
...
...
@@ -14616,11 +14624,7 @@ ha_innobase::delete_table(
native innodb partitioning is completed */
if
(
err
==
DB_TABLE_NOT_FOUND
&&
innobase_get_lower_case_table_names
()
==
1
)
{
#ifdef _WIN32
char
*
is_part
=
strstr
(
norm_name
,
"#p#"
);
#else
char
*
is_part
=
strstr
(
norm_name
,
"#P#"
);
#endif
/* _WIN32 */
char
*
is_part
=
is_partition
(
norm_name
);
if
(
is_part
!=
NULL
)
{
char
par_case_name
[
FN_REFLEN
];
...
...
@@ -15213,12 +15217,7 @@ innobase_rename_table(
if
(
error
!=
DB_SUCCESS
)
{
if
(
error
==
DB_TABLE_NOT_FOUND
&&
innobase_get_lower_case_table_names
()
==
1
)
{
char
*
is_part
=
NULL
;
#ifdef _WIN32
is_part
=
strstr
(
norm_from
,
"#p#"
);
#else
is_part
=
strstr
(
norm_from
,
"#P#"
);
#endif
/* _WIN32 */
char
*
is_part
=
is_partition
(
norm_from
);
if
(
is_part
)
{
char
par_case_name
[
FN_REFLEN
];
...
...
@@ -23526,11 +23525,7 @@ innobase_init_vc_templ(
/* For partition table, remove the partition name and use the
"main" table name to build the template */
#ifdef _WIN32
char
*
is_part
=
strstr
(
tbname
,
"#p#"
);
#else
char
*
is_part
=
strstr
(
tbname
,
"#P#"
);
#endif
/* _WIN32 */
char
*
is_part
=
is_partition
(
tbname
);
if
(
is_part
!=
NULL
)
{
*
is_part
=
'\0'
;
...
...
@@ -23581,11 +23576,7 @@ innobase_rename_vc_templ(
/* For partition table, remove the partition name and use the
"main" table name to build the template */
#ifdef _WIN32
char
*
is_part
=
strstr
(
tbname
,
"#p#"
);
#else
char
*
is_part
=
strstr
(
tbname
,
"#P#"
);
#endif
/* _WIN32 */
char
*
is_part
=
is_partition
(
tbname
);
if
(
is_part
!=
NULL
)
{
*
is_part
=
'\0'
;
...
...
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