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
48c22a68
Commit
48c22a68
authored
Jun 28, 2017
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-13089 identifier quoting in partitioning
remove ANSI_QUOTES when generating partition syntax for frm
parent
e1093e24
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
4 deletions
+49
-4
mysql-test/suite/parts/r/quoting.result
mysql-test/suite/parts/r/quoting.result
+30
-0
mysql-test/suite/parts/t/quoting.test
mysql-test/suite/parts/t/quoting.test
+13
-0
sql/sql_table.cc
sql/sql_table.cc
+6
-4
No files found.
mysql-test/suite/parts/r/quoting.result
View file @
48c22a68
...
...
@@ -60,4 +60,34 @@ t2 CREATE TABLE `t2` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
PARTITION BY RANGE (`f1`)
(PARTITION `p1` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
flush tables;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`select` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
PARTITION BY RANGE (`select`)
(PARTITION `select` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`f1` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
PARTITION BY RANGE (`f1`)
(PARTITION `p1` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
set sql_mode=ansi_quotes;
show create table t1;
Table Create Table
t1 CREATE TABLE "t1" (
"select" int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
PARTITION BY RANGE ("select")
(PARTITION "select" VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
show create table t2;
Table Create Table
t2 CREATE TABLE "t2" (
"f1" int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
PARTITION BY RANGE ("f1")
(PARTITION "p1" VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
drop table t1, t2;
mysql-test/suite/parts/t/quoting.test
View file @
48c22a68
...
...
@@ -5,15 +5,28 @@ source include/have_partition.inc;
set
sql_mode
=
ansi_quotes
;
create
table
t1
(
"select"
int
)
partition
by
range
(
"select"
)
(
partition
"select"
values
less
than
maxvalue
);
create
table
t2
(
f1
int
)
partition
by
range
(
f1
)
(
partition
p1
values
less
than
maxvalue
);
# "select", "f1", "p1"
show
create
table
t1
;
show
create
table
t2
;
set
sql_quote_show_create
=
0
;
# "select", f1, p1
show
create
table
t1
;
show
create
table
t2
;
set
sql_mode
=
default
;
# `select`, f1, p1
show
create
table
t1
;
show
create
table
t2
;
set
sql_quote_show_create
=
1
;
# `select`, `f1`, `p1`
show
create
table
t1
;
show
create
table
t2
;
# re-parse
flush
tables
;
# `select`, `f1`, `p1`
show
create
table
t1
;
show
create
table
t2
;
set
sql_mode
=
ansi_quotes
;
# "select", "f1", "p1"
show
create
table
t1
;
show
create
table
t2
;
drop
table
t1
,
t2
;
sql/sql_table.cc
View file @
48c22a68
...
...
@@ -4543,10 +4543,12 @@ handler *mysql_create_frm_image(THD *thd,
We reverse the partitioning parser and generate a standard format
for syntax stored in frm file.
*/
if
(
!
(
part_syntax_buf
=
generate_partition_syntax
(
thd
,
part_info
,
&
syntax_len
,
TRUE
,
create_info
,
alter_info
)))
sql_mode_t
old_mode
=
thd
->
variables
.
sql_mode
;
thd
->
variables
.
sql_mode
&=
~
MODE_ANSI_QUOTES
;
part_syntax_buf
=
generate_partition_syntax
(
thd
,
part_info
,
&
syntax_len
,
true
,
create_info
,
alter_info
);
thd
->
variables
.
sql_mode
=
old_mode
;
if
(
!
part_syntax_buf
)
goto
err
;
part_info
->
part_info_string
=
part_syntax_buf
;
part_info
->
part_info_len
=
syntax_len
;
...
...
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