diff options
Diffstat (limited to 'sql/opt_range.h')
-rw-r--r-- | sql/opt_range.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sql/opt_range.h b/sql/opt_range.h index ae0e3822272..73def7bde92 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -459,8 +459,9 @@ public: uint res= key_tree->store_min(key[key_tree->part].store_length, range_key, *range_key_flag); // add flags only if a key_part is written to the buffer - if (res) - *range_key_flag|= key_tree->min_flag; + if (!res) + return 0; + *range_key_flag|= key_tree->min_flag; if (key_tree->next_key_part && key_tree->next_key_part->type == SEL_ARG::KEY_RANGE && key_tree->part != last_part && @@ -482,8 +483,9 @@ public: SEL_ARG *key_tree= last(); uint res=key_tree->store_max(key[key_tree->part].store_length, range_key, *range_key_flag); - if (res) - (*range_key_flag)|= key_tree->max_flag; + if (!res) + return 0; + *range_key_flag|= key_tree->max_flag; if (key_tree->next_key_part && key_tree->next_key_part->type == SEL_ARG::KEY_RANGE && key_tree->part != last_part && |