mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 18:41:56 +01:00
bug #1335 tests followup:
--disable_query_log was not a good idea, Serg says
This commit is contained in:
parent
5fa5a8df4e
commit
25a0bfb268
2 changed files with 14 additions and 4 deletions
|
@ -597,6 +597,13 @@ count(*) category
|
||||||
1 3
|
1 3
|
||||||
1 4
|
1 4
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
userid int(10) unsigned,
|
||||||
|
score smallint(5) unsigned,
|
||||||
|
key (score)
|
||||||
|
);
|
||||||
|
INSERT INTO t1 VALUES (1,1),(2,2),(1,1),(3,3),(3,3),(3,3),(3,3),(3,3);
|
||||||
|
SELECT userid,count(*) FROM t1 GROUP BY userid DESC;
|
||||||
userid count(*)
|
userid count(*)
|
||||||
3 5
|
3 5
|
||||||
2 1
|
2 1
|
||||||
|
@ -604,6 +611,13 @@ userid count(*)
|
||||||
EXPLAIN SELECT userid,count(*) FROM t1 GROUP BY userid DESC;
|
EXPLAIN SELECT userid,count(*) FROM t1 GROUP BY userid DESC;
|
||||||
table type possible_keys key key_len ref rows Extra
|
table type possible_keys key key_len ref rows Extra
|
||||||
t1 ALL NULL NULL NULL NULL 8 Using temporary; Using filesort
|
t1 ALL NULL NULL NULL NULL 8 Using temporary; Using filesort
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (
|
||||||
|
i int(11) default NULL,
|
||||||
|
j int(11) default NULL
|
||||||
|
);
|
||||||
|
INSERT INTO t1 VALUES (1,2),(2,3),(4,5),(3,5),(1,5),(23,5);
|
||||||
|
SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL;
|
||||||
i COUNT(DISTINCT(i))
|
i COUNT(DISTINCT(i))
|
||||||
1 1
|
1 1
|
||||||
2 1
|
2 1
|
||||||
|
|
|
@ -427,7 +427,6 @@ drop table t1;
|
||||||
# Tests for bug #1355: 'Using filesort' is missing in EXPLAIN when ORDER BY
|
# Tests for bug #1355: 'Using filesort' is missing in EXPLAIN when ORDER BY
|
||||||
# NULL is used.
|
# NULL is used.
|
||||||
#
|
#
|
||||||
--disable_query_log
|
|
||||||
CREATE TABLE t1 (
|
CREATE TABLE t1 (
|
||||||
userid int(10) unsigned,
|
userid int(10) unsigned,
|
||||||
score smallint(5) unsigned,
|
score smallint(5) unsigned,
|
||||||
|
@ -438,9 +437,7 @@ INSERT INTO t1 VALUES (1,1),(2,2),(1,1),(3,3),(3,3),(3,3),(3,3),(3,3);
|
||||||
# and then sort it with filesort (GROUP BY in MySQL
|
# and then sort it with filesort (GROUP BY in MySQL
|
||||||
# implies sorted order of results)
|
# implies sorted order of results)
|
||||||
SELECT userid,count(*) FROM t1 GROUP BY userid DESC;
|
SELECT userid,count(*) FROM t1 GROUP BY userid DESC;
|
||||||
--enable_query_log
|
|
||||||
EXPLAIN SELECT userid,count(*) FROM t1 GROUP BY userid DESC;
|
EXPLAIN SELECT userid,count(*) FROM t1 GROUP BY userid DESC;
|
||||||
--disable_query_log
|
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
CREATE TABLE t1 (
|
CREATE TABLE t1 (
|
||||||
i int(11) default NULL,
|
i int(11) default NULL,
|
||||||
|
@ -448,6 +445,5 @@ CREATE TABLE t1 (
|
||||||
);
|
);
|
||||||
INSERT INTO t1 VALUES (1,2),(2,3),(4,5),(3,5),(1,5),(23,5);
|
INSERT INTO t1 VALUES (1,2),(2,3),(4,5),(3,5),(1,5),(23,5);
|
||||||
SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL;
|
SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL;
|
||||||
--enable_query_log
|
|
||||||
explain SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL;
|
explain SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue