mirror of
https://github.com/MariaDB/server.git
synced 2026-05-03 13:45:34 +02:00
Fixed BUG#8540: Local variable overrides an alias.
mysql-test/r/sp.result: New test case for BUG#8540. mysql-test/t/sp.test: New test case for BUG#8540. sql/item.h: Use the existing name (if any) for a SP local variable (to get the correct field name in a select in the case of an alias).
This commit is contained in:
parent
ec075331b0
commit
0f466d046c
3 changed files with 30 additions and 1 deletions
|
|
@ -460,7 +460,10 @@ public:
|
|||
{
|
||||
Item *it= this_item();
|
||||
|
||||
it->set_name(m_name.str, m_name.length, system_charset_info);
|
||||
if (name)
|
||||
it->set_name(name, strlen(name), system_charset_info);
|
||||
else
|
||||
it->set_name(m_name.str, m_name.length, system_charset_info);
|
||||
it->make_field(field);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue