summaryrefslogtreecommitdiff
path: root/sql/opt_range.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-04-12 01:01:18 +0200
committerSergei Golubchik <sergii@pisem.net>2013-04-12 01:01:18 +0200
commitce926c90accc6ca36c62f0b954e651d89db66da8 (patch)
tree737c9571a90e6e1f07be30d8bdc64c2f06d6fbf3 /sql/opt_range.cc
parent5ae72bb73cceafe5062be3827dbe3b4f488a7a73 (diff)
parentea4a417a8d456e8e09b6b4306f22c7c20b3e594c (diff)
downloadmariadb-git-ce926c90accc6ca36c62f0b954e651d89db66da8.tar.gz
5.3 merge
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r--sql/opt_range.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 3f49e1664f0..823699d14b1 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -132,7 +132,12 @@
static int sel_cmp(Field *f,uchar *a,uchar *b,uint8 a_flag,uint8 b_flag);
-static uchar is_null_string[2]= {1,0};
+/*
+ this should be long enough so that any memcmp with a string that
+ starts from '\0' won't cross is_null_string boundaries, even
+ if the memcmp is optimized to compare 4- 8- or 16- bytes at once
+*/
+static uchar is_null_string[20]= {1,0};
class RANGE_OPT_PARAM;
/*
@@ -7368,8 +7373,10 @@ static SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param,COND *cond)
DBUG_RETURN(tree);
}
/* Here when simple cond */
- if (cond->const_item() && !cond->is_expensive())
+ if (cond->const_item())
{
+ if (cond->is_expensive())
+ DBUG_RETURN(0);
/*
During the cond->val_int() evaluation we can come across a subselect
item which may allocate memory on the thd->mem_root and assumes