Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
f6524e49
Commit
f6524e49
authored
May 12, 2014
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-4925 Wrong result - count(distinct), Using index for group-by (scanning)
added the test case
parent
124428a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
mysql-test/suite/innodb/r/count_distinct.result
mysql-test/suite/innodb/r/count_distinct.result
+12
-0
mysql-test/suite/innodb/t/count_distinct.test
mysql-test/suite/innodb/t/count_distinct.test
+15
-0
No files found.
mysql-test/suite/innodb/r/count_distinct.result
0 → 100644
View file @
f6524e49
CREATE TABLE t1 (
id int NOT NULL AUTO_INCREMENT,
a int NOT NULL,
b int NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY ba (b, a)
) ENGINE=InnoDB;
INSERT INTO t1 (a, b) VALUES(1,101),(1,102),(1,103),(1,104),(1,105),(1,106),(1,107),(1,108),(1,109),(1,110);
SELECT COUNT(DISTINCT b) FROM t1 WHERE a = 1;
COUNT(DISTINCT b)
10
DROP TABLE t1;
mysql-test/suite/innodb/t/count_distinct.test
0 → 100644
View file @
f6524e49
--
source
include
/
have_innodb
.
inc
#
# MDEV-4925 Wrong result - count(distinct), Using index for group-by (scanning)
#
CREATE
TABLE
t1
(
id
int
NOT
NULL
AUTO_INCREMENT
,
a
int
NOT
NULL
,
b
int
NOT
NULL
,
PRIMARY
KEY
(
id
),
UNIQUE
KEY
ba
(
b
,
a
)
)
ENGINE
=
InnoDB
;
INSERT
INTO
t1
(
a
,
b
)
VALUES
(
1
,
101
),(
1
,
102
),(
1
,
103
),(
1
,
104
),(
1
,
105
),(
1
,
106
),(
1
,
107
),(
1
,
108
),(
1
,
109
),(
1
,
110
);
SELECT
COUNT
(
DISTINCT
b
)
FROM
t1
WHERE
a
=
1
;
DROP
TABLE
t1
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment