Commit 45dd187e authored by unknown's avatar unknown

Fix column name where it starts with a backtick


mysql-test/r/sp.result:
  test for backticks
mysql-test/t/sp.test:
  test for backticks
parent 26c755ab
...@@ -1649,3 +1649,8 @@ call p1(); ...@@ -1649,3 +1649,8 @@ call p1();
1 1
drop procedure p1; drop procedure p1;
drop table t1; drop table t1;
create function `foo` () returns int return 5;
select `foo` ();
`foo` ()
5
drop function `foo`;
...@@ -1853,3 +1853,9 @@ call p1(); ...@@ -1853,3 +1853,9 @@ call p1();
drop procedure p1; drop procedure p1;
drop table t1; drop table t1;
#
# backticks
#
create function `foo` () returns int return 5;
select `foo` ();
drop function `foo`;
...@@ -3609,8 +3609,12 @@ select_item: ...@@ -3609,8 +3609,12 @@ select_item:
YYABORT; YYABORT;
if ($4.str) if ($4.str)
$2->set_name($4.str,$4.length,system_charset_info); $2->set_name($4.str,$4.length,system_charset_info);
else if (!$2->name) else if (!$2->name) {
$2->set_name($1,(uint) ($3 - $1), YYTHD->charset()); char *str = $1;
if (str[-1] == '`')
str--;
$2->set_name(str,(uint) ($3 - str), YYTHD->charset());
}
}; };
remember_name: remember_name:
......
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