summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.h
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2006-01-11 22:49:43 +0300
committerunknown <evgen@moonbone.local>2006-01-11 22:49:43 +0300
commit593bed0d929cdc2827439d4697ce6f4b2bc9d941 (patch)
tree6b8d0de32ad9d2874c9c9803e328edad542e33fa /sql/item_cmpfunc.h
parent95cabee1dc3a6d44a7e7a4c74c0bd49e00047f5b (diff)
downloadmariadb-git-593bed0d929cdc2827439d4697ce6f4b2bc9d941.tar.gz
Fixed bug #15633: Evaluation of Item_equal for non-const table caused wrong
select result Item equal objects are employed only at the optimize phase. Usually they are not supposed to be evaluated. Yet in some cases we call the method val_int() for them. Here we have to take care of restricting the predicate such an object represents f1=f2= ...=fn to the projection of known fields fi1=...=fik. Added a check for field's table being const in Item_equal::val_int(). If the field's table is not const val_int() just skips that field when evaluating Item_equal. mysql-test/t/select.test: Added test case for bug #15633: Evaluation of Item_equal for non-const table caused wrong select result mysql-test/r/select.result: Added test case for bug #15633: Evaluation of Item_equal for non-const table caused wrong select result mysql-test/r/func_group.result: Corrected test result for bug #12882 after fix for bug#15633 sql/item_cmpfunc.h: Fixed bug #15633: Evaluation of Item_equal for non-const table caused wrong select result Added comment about fields from non-const tables in class description. sql/item_cmpfunc.cc: Fixed bug #15633: Evaluation of Item_equal for non-const table caused wrong select result Added check for field's table being const in Item_equal::val_int().
Diffstat (limited to 'sql/item_cmpfunc.h')
-rw-r--r--sql/item_cmpfunc.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index bfd32223d4c..89d117ee4ec 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -1150,6 +1150,11 @@ public:
are deleted in the end of execution. All changes made to these
objects need not be registered in the list of changes of the parse
tree and do not harm PS/SP re-execution.
+
+ Item equal objects are employed only at the optimize phase. Usually they are
+ not supposed to be evaluated. Yet in some cases we call the method val_int()
+ for them. We have to take care of restricting the predicate such an
+ object represents f1=f2= ...=fn to the projection of known fields fi1=...=fik.
*/
class Item_equal: public Item_bool_func