From 516a0ad46448cd7f622808f8fd07d97191cbb131 Mon Sep 17 00:00:00 2001 From: Neeraj Bisht Date: Tue, 29 Jan 2013 10:05:00 +0530 Subject: [PATCH] Bug#16208709 - CRASH IN GET_SEL_ARG_FOR_KEYPART ON SELECT DISTINCT ON COL WITH COMPOSITE INDEX This problem is caused by the patch for the bug#11751794. While checking for the keypart covering non grouping attribute. we are not checking whether the root node of the SEL_ARG* tree for the index have any cvalue or not. --- sql/opt_range.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 4e67727462c..ae6878c6756 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -9870,6 +9870,8 @@ get_sel_arg_for_keypart(Field *nga_field, SEL_ARG *keypart_tree, SEL_ARG **cur_range) { + if(keypart_tree == NULL) + return false; if(keypart_tree->field->eq(nga_field)) { /*