mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
MDEV-13089 identifier quoting in partitioning
remove ANSI_QUOTES when generating partition syntax for frm
This commit is contained in:
parent
e1093e2464
commit
48c22a68b1
3 changed files with 49 additions and 4 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue