Commit c661b4d0 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-13017 LOCK TABLE fails with irrelevant error while working with tables affected by ANSI_QUOTES

parent 5cbbfe9f
set sql_mode=ansi_quotes;
create table t1 (i int) partition by range (i) (partition flush values less than maxvalue);
set sql_mode=default;
lock tables t1 read local;
unlock tables;
drop table t1;
#
# MDEV-13017 LOCK TABLE fails with irrelevant error while working with tables affected by ANSI_QUOTES
#
--source include/have_partition.inc
set sql_mode=ansi_quotes;
create table t1 (i int) partition by range (i) (partition flush values less than maxvalue);
set sql_mode=default;
lock tables t1 read local;
unlock tables;
drop table t1;
......@@ -1918,9 +1918,12 @@ 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_sql_mode= thd->variables.sql_mode;
thd->variables.sql_mode&= ~MODE_ANSI_QUOTES;
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.sql_mode= save_sql_mode;
thd->variables.option_bits= save_options;
err= add_string_object(fptr, &name_string);
return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment