mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-13089 identifier quoting in partitioning
remove ANSI_QUOTES when generating partition syntax for frm
This commit is contained in:
@ -60,4 +60,34 @@ t2 CREATE TABLE `t2` (
|
|||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
PARTITION BY RANGE (`f1`)
|
PARTITION BY RANGE (`f1`)
|
||||||
(PARTITION `p1` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
|
(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;
|
drop table t1, t2;
|
||||||
|
@ -5,15 +5,28 @@ source include/have_partition.inc;
|
|||||||
set sql_mode=ansi_quotes;
|
set sql_mode=ansi_quotes;
|
||||||
create table t1 ("select" int) partition by range ("select") (partition "select" values less than maxvalue);
|
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);
|
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 t1;
|
||||||
show create table t2;
|
show create table t2;
|
||||||
set sql_quote_show_create=0;
|
set sql_quote_show_create=0;
|
||||||
|
# "select", f1, p1
|
||||||
show create table t1;
|
show create table t1;
|
||||||
show create table t2;
|
show create table t2;
|
||||||
set sql_mode=default;
|
set sql_mode=default;
|
||||||
|
# `select`, f1, p1
|
||||||
show create table t1;
|
show create table t1;
|
||||||
show create table t2;
|
show create table t2;
|
||||||
set sql_quote_show_create=1;
|
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 t1;
|
||||||
show create table t2;
|
show create table t2;
|
||||||
drop table t1, 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
|
We reverse the partitioning parser and generate a standard format
|
||||||
for syntax stored in frm file.
|
for syntax stored in frm file.
|
||||||
*/
|
*/
|
||||||
if (!(part_syntax_buf= generate_partition_syntax(thd, part_info,
|
sql_mode_t old_mode= thd->variables.sql_mode;
|
||||||
&syntax_len, TRUE,
|
thd->variables.sql_mode &= ~MODE_ANSI_QUOTES;
|
||||||
create_info,
|
part_syntax_buf= generate_partition_syntax(thd, part_info, &syntax_len,
|
||||||
alter_info)))
|
true, create_info, alter_info);
|
||||||
|
thd->variables.sql_mode= old_mode;
|
||||||
|
if (!part_syntax_buf)
|
||||||
goto err;
|
goto err;
|
||||||
part_info->part_info_string= part_syntax_buf;
|
part_info->part_info_string= part_syntax_buf;
|
||||||
part_info->part_info_len= syntax_len;
|
part_info->part_info_len= syntax_len;
|
||||||
|
Reference in New Issue
Block a user