diff options
author | Igor Babaev <igor@askmonty.org> | 2013-10-10 10:08:26 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2013-10-10 10:08:26 -0700 |
commit | 7c87385e3075143de18e50c1d327eeb2e224603a (patch) | |
tree | 7819d66c3d59be663839b70b0204d281b849f98a /sql/item_func.h | |
parent | ec226e553aa56718ed9939e333fe36b3499ac9be (diff) | |
download | mariadb-git-7c87385e3075143de18e50c1d327eeb2e224603a.tar.gz |
Fixed bug mdev-5105.
The bug caused a memory overwrite in the function update_ref_and_keys()
It happened due to a wrong value of SELECT_LEX::cond_count. This value
historically was calculated by the fix_fields method. Now the logic of
calling this method became too complicated and, as a result, this value
is calculated not always correctly.
The patch changes the way how and when the values of SELECT_LEX::cond_count
and of SELECT_LEX::between_count are calculated. The new code does it just at
the beginning of update_ref_and_keys().
Diffstat (limited to 'sql/item_func.h')
-rw-r--r-- | sql/item_func.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/item_func.h b/sql/item_func.h index 80b794f30d5..310b312d1e4 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -485,6 +485,8 @@ class Item_num_op :public Item_func_numhybrid class Item_int_func :public Item_func { +protected: + bool sargable; public: Item_int_func() :Item_func() { max_length= 21; } Item_int_func(Item *a) :Item_func(a) { max_length= 21; } @@ -496,7 +498,8 @@ public: double val_real(); String *val_str(String*str); enum Item_result result_type () const { return INT_RESULT; } - void fix_length_and_dec() {} + void fix_length_and_dec() { sargable= false; } + bool count_sargable_conds(uchar *arg); }; |