From 2e758a7c23fda7fada49d0cca547680cf26cafad Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 27 Nov 2006 19:12:10 +0300 Subject: Fix for bug #24261 "crash when WHERE contains NOT IN ('') for unsigned column type" When calculating a SEL_TREE for the "c_{i-1} < X < c_i" interval, check if the tree returned for the "-inf < X < c_0" interval is NULL mysql-test/r/func_in.result: Added testcase for bug #24261 "crash when WHERE contains NOT IN ('') for unsigned column type" mysql-test/t/func_in.test: Added testcase for bug #24261 "crash when WHERE contains NOT IN ('') for unsigned column type" sql/opt_range.cc: When calculating a SEL_TREE for the "c_{i-1} < X < c_i" interval, check if the tree returned for the "-inf < X < c_0" interval is NULL --- sql/opt_range.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql/opt_range.cc') diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 96239315026..efef9361bda 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -3703,7 +3703,8 @@ static SEL_TREE *get_func_mm_tree(PARAM *param, Item_func *cond_func, for (uint idx= 0; idx < param->keys; idx++) { SEL_ARG *new_interval, *last_val; - if (((new_interval= tree2->keys[idx])) && + if (((new_interval= tree2->keys[idx])) && + (tree->keys[idx]) && ((last_val= tree->keys[idx]->last()))) { new_interval->min_value= last_val->max_value; -- cgit v1.2.1