From efbb3c6c90279f2bed8dda9c48dbaaf8b09a8cae Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Fri, 24 Dec 2010 15:30:23 -0800 Subject: Fixed LP bug #639935 (bug #58727). When the optimizer creates items out of other items it does not have to call the fix_fields method. Usually in these cases it calls quick_fix_field() that just marks the created item as fixed. If the created item is an Item_func object then calling quick_fix_field() works fine if the arguments of the created functional item are already fixed. Otherwise some unfixed nodes remain in the item tree and it triggers an assertion failure whenever the item is evaluated. Fixed the problem by making the method quick_fix_field virtual and providing an implementation for the class Item_func objects that recursively calls the method for unfixed arguments of any functional item. --- sql/item_func.h | 1 + 1 file changed, 1 insertion(+) (limited to 'sql/item_func.h') diff --git a/sql/item_func.h b/sql/item_func.h index e45638472e4..3d2cb709ce3 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -117,6 +117,7 @@ public: // Constructor used for Item_cond_and/or (see Item comment) Item_func(THD *thd, Item_func *item); bool fix_fields(THD *, Item **ref); + void quick_fix_field(); table_map used_tables() const; table_map not_null_tables() const; void update_used_tables(); -- cgit v1.2.1