summaryrefslogtreecommitdiff
path: root/sql/opt_range.cc
diff options
context:
space:
mode:
authoraivanov@mysql.com <>2005-09-06 18:03:08 +0400
committeraivanov@mysql.com <>2005-09-06 18:03:08 +0400
commitfa51afedeb4bc53117b909352558b98ed4ab5882 (patch)
treed6ae557d23c29875371111ed32a93908ec4af8f1 /sql/opt_range.cc
parent7f91ddcd88142985e18ae8b5f28624fe8722d4fb (diff)
downloadmariadb-git-fa51afedeb4bc53117b909352558b98ed4ab5882.tar.gz
item_cmpfunc.h:
Fixed bugs #12101, #12102: wrong calculation of not_null_tables() for some expressions. The classes Item_func_between, Item_func_if, Item_func_in are modified. Item_func_between/in objects can represent now [NOT]BETWEEN/IN expressions. The class Item_func_opt_neg is added to factor out the functionality common for the modified classes Item_func_between and Item_func_in. item_cmpfunc.cc: Fixed bugs #12101, #12102: wrong calculation of not_null_tables() for some expressions. Added Item_func_between::fix_fields(), Item_func_if::fix_fields(), Item_func_in::fix_fields(). They correct generic calculation of the not_null_tables attribute when it is needed. Modified Item_func_between::val_int(), Item_func_in::val_int(). opt_range.cc: Fixed bugs #12101, #12102: wrong calculation of not_null_tables() for some expressions. The function get_mm_tree() is modified. There cannot be NOT before BETWEEN/IN anymore. Rather Item_func_between/in objects can represent now [NOT]BETWEEN/IN expressions. sql_yacc.yy: Fixed bugs #12101, #12102: wrong calculation of not_null_tables() for some expressions. Item_func_between/in objects can represent now [NOT]BETWEEN/IN expresions. join_outer.result: Fixed some testcases results (bugs #12101, #12102) join_outer.test: Added testcases for bugs #12101, #12102
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r--sql/opt_range.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 2dd097cbaab..5cb330100f8 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -849,7 +849,8 @@ static SEL_TREE *get_mm_tree(PARAM *param,COND *cond)
if (cond_func->functype() == Item_func::BETWEEN)
{
- if (cond_func->arguments()[0]->type() == Item::FIELD_ITEM)
+ if (!((Item_func_between *)(cond_func))->negated &&
+ cond_func->arguments()[0]->type() == Item::FIELD_ITEM)
{
Field *field=((Item_field*) (cond_func->arguments()[0]))->field;
Item_result cmp_type=field->cmp_type();
@@ -866,7 +867,7 @@ static SEL_TREE *get_mm_tree(PARAM *param,COND *cond)
if (cond_func->functype() == Item_func::IN_FUNC)
{ // COND OR
Item_func_in *func=(Item_func_in*) cond_func;
- if (func->key_item()->type() == Item::FIELD_ITEM)
+ if (!func->negated && func->key_item()->type() == Item::FIELD_ITEM)
{
Field *field=((Item_field*) (func->key_item()))->field;
Item_result cmp_type=field->cmp_type();