File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -8921,8 +8921,8 @@ push_new_name_resolution_context(THD *thd,
89218921
89228922
89238923/* *
8924- Fix condition which contains only field (f turns to f <> 0 )
8925- or only contains the function NOT field (not f turns to f == 0 )
8924+ Fix condition which contains only field (f turns to f IS TRUE )
8925+ or only contains the function NOT field (not f turns to f IS FALSE )
89268926
89278927 @param cond The condition to fix
89288928
@@ -8936,7 +8936,8 @@ Item *normalize_cond(THD *thd, Item *cond)
89368936 Item::Type type= cond->type ();
89378937 if (type == Item::FIELD_ITEM || type == Item::REF_ITEM)
89388938 {
8939- item_base_t is_cond_flag= cond->base_flags & item_base_t ::IS_COND;
8939+ item_base_t is_cond_flag= cond->base_flags &
8940+ (item_base_t ::IS_COND | item_base_t ::AT_TOP_LEVEL);
89408941 cond->base_flags &= ~item_base_t ::IS_COND;
89418942 cond= new (thd->mem_root ) Item_func_istrue (thd, cond);
89428943 if (cond)
Original file line number Diff line number Diff line change @@ -12457,11 +12457,9 @@ opt_where_clause:
1245712457 }
1245812458 search_condition
1245912459 {
12460- SELECT_LEX *select= Select;
12461- select->where= normalize_cond(thd, $3);
12462- select->parsing_place= NO_MATTER;
12463- if ($3)
12464- $3->top_level_item();
12460+ $3->top_level_item();
12461+ Select->where= normalize_cond(thd, $3);
12462+ Select->parsing_place= NO_MATTER;
1246512463 }
1246612464 ;
1246712465
You can’t perform that action at this time.
0 commit comments