summaryrefslogtreecommitdiff
path: root/mysql-test/r/order_by.result
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2016-07-05 16:53:03 +0300
committerSergei Petrunia <psergey@askmonty.org>2016-07-05 16:55:11 +0300
commit95c286cedf4b9330240a0a91a9fc3e58a17782b9 (patch)
tree7ec297064b2266b58e8daf500a0ea9506d067298 /mysql-test/r/order_by.result
parentd1b25890745a140446e4bdd5fd4f489ce1f76fae (diff)
downloadmariadb-git-95c286cedf4b9330240a0a91a9fc3e58a17782b9.tar.gz
MDEV-10324: Server crash in get_sel_arg_for_keypart or Assertion
The crash was caused by this problem: get_best_group_min_max() tries to construct query plans for keys that are not processed by the range optimizer. This wasn't a problem as long as SEL_TREE::keys was an array of MAX_KEY elements. However, now it is a Mem_root_array and only has elements for the used keys, and get_best_group_min_max attempts to address beyond the end of the array. The obvious way to fix the crash was to port (and improve) a part of 96fcfcbd7b5120e8f64fd45985001eca8d36fbfb from mysql-5.7. This makes get_best_group_min_max not to consider indexes that Mem_root_arrays have no element for. After that, I got non-sensical query plans (see MDEV-10325 for details). Fixed that by making get_best_group_min_max to check if the index is in table->keys_in_use_for_group_by bitmap.
Diffstat (limited to 'mysql-test/r/order_by.result')
-rw-r--r--mysql-test/r/order_by.result2
1 files changed, 1 insertions, 1 deletions
diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result
index 03e7c48951a..d108bce5eb1 100644
--- a/mysql-test/r/order_by.result
+++ b/mysql-test/r/order_by.result
@@ -1163,7 +1163,7 @@ INSERT INTO t1 SELECT a +32, b +32 FROM t1;
INSERT INTO t1 SELECT a +64, b +64 FROM t1;
EXPLAIN SELECT a FROM t1 IGNORE INDEX FOR GROUP BY (a, ab) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL ab 4 NULL 10 Using index for group-by
+1 SIMPLE t1 index NULL PRIMARY 4 NULL 128 Using index
SELECT a FROM t1 IGNORE INDEX FOR GROUP BY (a, ab) GROUP BY a;
a
1