@@ -1207,9 +1207,9 @@ class Item_func_coalesce :public Item_func_case_expression
12071207 bool fix_length_and_dec (THD *thd) override
12081208 {
12091209 update_nullability_post_fix_fields ();
1210- if (aggregate_for_result (func_name_cstring (), args, arg_count, true ))
1210+ if (aggregate_for_result (func_name_cstring (), args, arg_count, true ) ||
1211+ fix_attributes (args, arg_count))
12111212 return TRUE ;
1212- fix_attributes (args, arg_count);
12131213 return FALSE ;
12141214 }
12151215 LEX_CSTRING func_name_cstring () const override
@@ -1236,9 +1236,9 @@ class Item_func_case_abbreviation2 :public Item_func_case_expression
12361236protected:
12371237 bool fix_length_and_dec2 (Item **items)
12381238 {
1239- if (aggregate_for_result (func_name_cstring (), items, 2 , true ))
1239+ if (aggregate_for_result (func_name_cstring (), items, 2 , true ) ||
1240+ fix_attributes (items, 2 ))
12401241 return TRUE ;
1241- fix_attributes (items, 2 );
12421242 return FALSE ;
12431243 }
12441244
@@ -1376,7 +1376,9 @@ class Item_func_if :public Item_func_case_abbreviation2_switch
13761376 bool fix_fields (THD *, Item **) override ;
13771377 bool fix_length_and_dec (THD *thd) override
13781378 {
1379- return fix_length_and_dec2_eliminate_null (args + 1 );
1379+ if (fix_length_and_dec2_eliminate_null (args + 1 ))
1380+ return TRUE ;
1381+ return FALSE ;
13801382 }
13811383 LEX_CSTRING func_name_cstring () const override
13821384 {
@@ -1413,7 +1415,9 @@ class Item_func_nvl2 :public Item_func_case_abbreviation2_switch
14131415 }
14141416 bool fix_length_and_dec (THD *thd) override
14151417 {
1416- return fix_length_and_dec2_eliminate_null (args + 1 );
1418+ if (fix_length_and_dec2_eliminate_null (args + 1 ))
1419+ return TRUE ;
1420+ return FALSE ;
14171421 }
14181422
14191423protected:
0 commit comments