Mysql distinct count returns wrong value in some circumstances
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MySQL Server |
Unknown
|
Unknown
|
|||
mysql-5.5 (Ubuntu) |
Triaged
|
High
|
Unassigned |
Bug Description
Under some circumstances, an SQL query containing count(distinct(
I have been unable to determine the exact qualities of the data that cause this situation to occur, however the test case attached reproduces the problem reliably.
Example of expected output from the attached script (Server is Ubuntu 10.04)
dave@hp:~$ mysql -u davetest -p -h 10.0.3.85 < ~/dumps/
Enter password:
count(distinct(
111
count(testtab.foo)
111
count(distinct(
111
Example of incorrect output from Ubuntu 12.10 / 12.04
dave@hp:~$ mysql -u davetest -p < ~/dumps/
Enter password:
count(distinct(
56
count(testtab.foo)
111
count(distinct(
111
The same client machine was used for both tests. The problem is also seen with the php5-mysql client.
ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: mysql-server 5.5.29-
ProcVersionSign
Uname: Linux 3.5.0-22-generic x86_64
ApportVersion: 2.6.1-0ubuntu10
Architecture: amd64
Date: Thu Jan 31 16:40:31 2013
InstallationDate: Installed on 2013-01-21 (10 days ago)
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Release amd64 (20121017.5)
Logs.var.
MarkForUpload: True
MySQLConf.
[mysqld_safe]
syslog
MySQLVarLibDirL
PackageArchitec
SourcePackage: mysql-5.5
UpgradeStatus: No upgrade log present (probably fresh install)
tags: | added: needs-upstream-sync |
Changed in mysql-5.5 (Ubuntu): | |
status: | Confirmed → Triaged |
Thank you for taking the time to report this bug and helping to make Ubuntu better.
I've confirmed that I can reproduce this in Precise, Quantal and Raring. It certainly looks wrong to me. But with it being MySQL I'm half expecting someone to tell me that this is expected behaviour for some obscure reason.
So two things we can do from here:
1) Verify that this behaviour is in fact a bug.
2) Build the latest upstream version without packaging, check if the behaviour is still the same, and report upstream if appropriate.