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:
unknown 2005-02-16 16:06:41 +01:00
commit 0f466d046c
3 changed files with 30 additions and 1 deletions

View file

@ -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);
}