From 4d6ad7ac60a0b4b0c5f38f7d415430553f74279b Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 10 Mar 2007 02:47:47 -0800 Subject: Fixed bug #26830: a crash for the query with a subselect containing ROLLUP. Crash happened because the function get_best_group_min_max detected joins with ROLLUP incorrectly. mysql-test/r/olap.result: Added a test case for bug #26830. mysql-test/t/olap.test: Added a test case for bug #26830. --- sql/opt_range.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/opt_range.cc') diff --git a/sql/opt_range.cc b/sql/opt_range.cc index dfb3af87c29..0e284850cbe 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -7504,7 +7504,7 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree) if ((join->tables != 1) || /* The query must reference one table. */ ((!join->group_list) && /* Neither GROUP BY nor a DISTINCT query. */ (!join->select_distinct)) || - (thd->lex->select_lex.olap == ROLLUP_TYPE)) /* Check (B3) for ROLLUP */ + (join->select_lex->olap == ROLLUP_TYPE)) /* Check (B3) for ROLLUP */ DBUG_RETURN(NULL); if (table->s->keys == 0) /* There are no indexes to use. */ DBUG_RETURN(NULL); -- cgit v1.2.1