From: Date: March 10 2007 11:47am Subject: bk commit into 5.0 tree (igor:1.2472) BUG#26830 List-Archive: http://lists.mysql.com/commits/21673 X-Bug: 26830 Message-Id: <20070310104758.69CF01C629E@olga.mysql.com> Below is the list of changes that have just been committed into a local 5.0 repository of igor. When igor does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2007-03-10 02:47:47-08:00, igor@stripped +3 -0 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@stripped, 2007-03-10 02:47:44-08:00, igor@stripped +9 -0 Added a test case for bug #26830. mysql-test/t/olap.test@stripped, 2007-03-10 02:47:44-08:00, igor@stripped +15 -0 Added a test case for bug #26830. sql/opt_range.cc@stripped, 2007-03-10 02:47:45-08:00, igor@stripped +1 -1 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. # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: igor # Host: olga.mysql.com # Root: /home/igor/dev-opt/mysql-5.0-opt-bug26830 --- 1.240/sql/opt_range.cc 2007-03-10 02:47:58 -08:00 +++ 1.241/sql/opt_range.cc 2007-03-10 02:47:58 -08:00 @@ -7504,7 +7504,7 @@ 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); --- 1.35/mysql-test/r/olap.result 2007-03-10 02:47:58 -08:00 +++ 1.36/mysql-test/r/olap.result 2007-03-10 02:47:58 -08:00 @@ -645,3 +645,12 @@ NULL NULL 2 DROP VIEW v1; DROP TABLE t1; +CREATE TABLE t1 (a int, KEY (a)); +INSERT INTO t1 VALUES (3), (1), (4), (1), (3), (1), (1); +SELECT * FROM (SELECT a, SUM(a) FROM t1 GROUP BY a WITH ROLLUP) as t; +a SUM(a) +1 4 +3 6 +4 4 +NULL 14 +DROP TABLE t1; --- 1.26/mysql-test/t/olap.test 2007-03-10 02:47:58 -08:00 +++ 1.27/mysql-test/t/olap.test 2007-03-10 02:47:58 -08:00 @@ -327,3 +327,18 @@ DROP VIEW v1; DROP TABLE t1; + +# +# Bug #26830: derived table with ROLLUP +# + +CREATE TABLE t1 (a int, KEY (a)); +INSERT INTO t1 VALUES (3), (1), (4), (1), (3), (1), (1); + +SELECT * FROM (SELECT a, SUM(a) FROM t1 GROUP BY a WITH ROLLUP) as t; + +DROP TABLE t1; + + + +