mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Bug #33811: Call to stored procedure with SELECT * / RIGHT JOIN
fails after the first time Two separate problems : 1. When flattening joins the linked list used for name resolution (next_name_resolution_table) was not updated. Fixed by updating the pointers when extending the table list 2. The items created by expanding a * (star) as a column reference were marked as fixed, but no cached table was assigned to them (unlike what Item_field::fix_fields does). Fixed by assigning a cached table (so the re-preparation is done faster). Note that the fix for #2 hides the fix for #1 in most cases (except when a table reference cannot be cached).
This commit is contained in:
@@ -5508,6 +5508,10 @@ insert_fields(THD *thd, Name_resolution_context *context, const char *db_name,
|
||||
|
||||
if (!(item= field_iterator.create_item(thd)))
|
||||
DBUG_RETURN(TRUE);
|
||||
DBUG_ASSERT(item->fixed);
|
||||
/* cache the table for the Item_fields inserted by expanding stars */
|
||||
if (item->type() == Item::FIELD_ITEM && tables->cacheable_table)
|
||||
((Item_field *)item)->cached_table= tables;
|
||||
|
||||
if (!found)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user