List:Commits« Previous MessageNext Message »
From:Jan Wedvik Date:January 19 2011 12:28pm
Subject:bzr commit into mysql-trunk branch (jan.wedvik:3532) Bug#59612
View as plain text  
#At file:///net/atum17/export/home/tmp/jw159207/mysql/repo/mysql-trunk/ based on revid:anders.song@stripped

 3532 Jan Wedvik	2011-01-19
      Proposed fix for Bug#59612 . This fix makes sure that when trying to build a 
      SEL_TREE for 'field1 <operator> field2', then 'field2 reverse(<operator>) field1' will also
      be considered if 'reverse(<opertor>)' exists (e.g. >= is the reverse operator of <=).

    modified:
      sql/opt_range.cc
=== modified file 'sql/opt_range.cc'
--- a/sql/opt_range.cc	2010-12-29 00:38:59 +0000
+++ b/sql/opt_range.cc	2011-01-19 12:27:59 +0000
@@ -5643,17 +5643,16 @@ static SEL_TREE *get_mm_tree(RANGE_OPT_P
     {
       field_item= (Item_field*) (cond_func->arguments()[0]->real_item());
       value= cond_func->arg_count > 1 ? cond_func->arguments()[1] : 0;
+      ftree= get_full_func_mm_tree(param, cond_func, field_item, value, inv);
     }
-    else if (cond_func->have_rev_func() &&
-             cond_func->arguments()[1]->real_item()->type() ==
-                                                            Item::FIELD_ITEM)
+    if (ftree == NULL &&
+        cond_func->have_rev_func() &&
+        cond_func->arguments()[1]->real_item()->type() == Item::FIELD_ITEM)
     {
       field_item= (Item_field*) (cond_func->arguments()[1]->real_item());
       value= cond_func->arguments()[0];
+      ftree= get_full_func_mm_tree(param, cond_func, field_item, value, inv);
     }
-    else
-      DBUG_RETURN(0);
-    ftree= get_full_func_mm_tree(param, cond_func, field_item, value, inv);
   }
 
   DBUG_RETURN(ftree);


Attachment: [text/bzr-bundle] bzr/jan.wedvik@sun.com-20110119122759-9xwzh1wrvpjh7twi.bundle
Thread
bzr commit into mysql-trunk branch (jan.wedvik:3532) Bug#59612Jan Wedvik19 Jan