Bug 786631

Summary: Different count with SELECT and CREATE SELECT queries
Product: Red Hat Enterprise Linux 6 Reporter: Christopher Hirschmann <c.hirschmann-bugs>
Component: mysqlAssignee: Tom Lane <tgl>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2CC: byte, hhorak
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: mysql-5.1.61-1.el6_2.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-14 17:31:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Christopher Hirschmann 2012-02-02 00:00:48 UTC
Description of problem:

mysql-server Package in RHEL 6 is affected by this MySQL bug:

http://bugs.mysql.com/bug.php?id=56423

Version-Release number of selected component (if applicable):

5.1.52

How reproducible:

always, see test case attached to MySQL bugreport

Steps to Reproduce:

1. create a table with the appropiate content (see test case attached to MySQL bugreport)
2. run a 'select *' on that table to see what it contains
3. now run a 'create … select' (as shown in the test case attached to MySQL bugreport) and look at the results of the 'create' part of that statement
  
Actual results:

'create … select' statement produces fewer results than corresponding 'select' statement

Expected results:

'create … select' and 'select' statements should produce exactly the same results

Additional info:

Fixed in MySQL 5.1.53 and newer, but this bug seems have had many regressions, so it might be a good idea to implement some kind of regression test for this, too.

This is a serious MySQL bug, that makes affected MySQL versions unfit for production use. The bugfix should definetly be backported to the mysql-server package in RHEL 6.

Our client wasn't even aware that his application used these kind of statements, because they had been created by a framework.

Comment 2 Tom Lane 2012-02-14 17:31:12 UTC
The upstream fix for this should be included in our recent security update:
RHSA-2012:0105 https://rhn.redhat.com/errata/RHSA-2012-0105.html
although this bug is not listed there since it is not a security issue.