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
5cbbfe9f
Commit
5cbbfe9f
authored
Jun 14, 2017
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: remove duplicate code
parent
918e4703
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
24 deletions
+15
-24
sql/sql_partition.cc
sql/sql_partition.cc
+14
-23
sql/sql_priv.h
sql/sql_priv.h
+1
-1
No files found.
sql/sql_partition.cc
View file @
5cbbfe9f
...
...
@@ -1913,6 +1913,19 @@ static int add_subpartition_by(File fptr)
return
err
+
add_partition_by
(
fptr
);
}
static
int
add_name_string
(
File
fptr
,
const
char
*
name
)
{
int
err
;
String
name_string
(
""
,
0
,
system_charset_info
);
THD
*
thd
=
current_thd
;
ulonglong
save_options
=
thd
->
variables
.
option_bits
;
thd
->
variables
.
option_bits
&=
~
OPTION_QUOTE_SHOW_CREATE
;
append_identifier
(
thd
,
&
name_string
,
name
,
strlen
(
name
));
thd
->
variables
.
option_bits
=
save_options
;
err
=
add_string_object
(
fptr
,
&
name_string
);
return
err
;
}
static
int
add_part_field_list
(
File
fptr
,
List
<
char
>
field_list
)
{
uint
i
,
num_fields
;
...
...
@@ -1924,15 +1937,7 @@ static int add_part_field_list(File fptr, List<char> field_list)
err
+=
add_begin_parenthesis
(
fptr
);
while
(
i
<
num_fields
)
{
const
char
*
field_str
=
part_it
++
;
String
field_string
(
""
,
0
,
system_charset_info
);
THD
*
thd
=
current_thd
;
ulonglong
save_options
=
thd
->
variables
.
option_bits
;
thd
->
variables
.
option_bits
&=
~
OPTION_QUOTE_SHOW_CREATE
;
append_identifier
(
thd
,
&
field_string
,
field_str
,
strlen
(
field_str
));
thd
->
variables
.
option_bits
=
save_options
;
err
+=
add_string_object
(
fptr
,
&
field_string
);
err
+=
add_name_string
(
fptr
,
part_it
++
);
if
(
i
!=
(
num_fields
-
1
))
err
+=
add_comma
(
fptr
);
i
++
;
...
...
@@ -1941,20 +1946,6 @@ static int add_part_field_list(File fptr, List<char> field_list)
return
err
;
}
static
int
add_name_string
(
File
fptr
,
const
char
*
name
)
{
int
err
;
String
name_string
(
""
,
0
,
system_charset_info
);
THD
*
thd
=
current_thd
;
ulonglong
save_options
=
thd
->
variables
.
option_bits
;
thd
->
variables
.
option_bits
&=
~
OPTION_QUOTE_SHOW_CREATE
;
append_identifier
(
thd
,
&
name_string
,
name
,
strlen
(
name
));
thd
->
variables
.
option_bits
=
save_options
;
err
=
add_string_object
(
fptr
,
&
name_string
);
return
err
;
}
static
int
add_int
(
File
fptr
,
longlong
number
)
{
char
buff
[
32
];
...
...
sql/sql_priv.h
View file @
5cbbfe9f
...
...
@@ -121,7 +121,7 @@
#define OPTION_AUTOCOMMIT (1ULL << 8) // THD, user
#define OPTION_BIG_SELECTS (1ULL << 9) // THD, user
#define OPTION_LOG_OFF (1ULL << 10) // THD, user
#define OPTION_QUOTE_SHOW_CREATE (1ULL << 11) // THD, user
, unused
#define OPTION_QUOTE_SHOW_CREATE (1ULL << 11) // THD, user
#define TMP_TABLE_ALL_COLUMNS (1ULL << 12) // SELECT, intern
#define OPTION_WARNINGS (1ULL << 13) // THD, user
#define OPTION_AUTO_IS_NULL (1ULL << 14) // THD, user, binlog
...
...
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