Bug #64460 | Federated returns multiple records, for same record, for every "or" operator | ||
---|---|---|---|
Submitted: | 27 Feb 2012 5:06 | Modified: | 26 May 2012 17:14 |
Reporter: | Desmond Coertzen | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Server: Federated storage engine | Severity: | S1 (Critical) |
Version: | 5.1.59 | OS: | Linux (open suse 11.2) |
Assigned to: | CPU Architecture: | Any |
[27 Feb 2012 5:06]
Desmond Coertzen
[27 Feb 2012 7:08]
Valeriy Kravchuk
It would be nice to check if the same problem still happens with a newer version, 5.1.61. If you can not check this, please, send a dump of data for the table that demonstrates the problem described.
[27 Feb 2012 11:04]
Desmond Coertzen
The two fixes to federated mentioned in release notes for 5.1.60 does not sound like it will fix this problem. I did not see anything regarding federated in the release notes for 5.1.61. I will do a test anyway.
[1 Mar 2012 5:39]
Desmond Coertzen
Performed two tests: Upgraded test system from 5.1.59 to 5.1.61 Test 1: ------- Federated table on test server 5.1.61 to real table on live server with 5.1.59 Problem still persists Test 2: ------- Federated table on test server 5.1.61 to real table on another live server with 5.1.61 Problem still persists
[1 Mar 2012 5:59]
Desmond Coertzen
NOTE: On another test (5.1.61 -> 5.1.61) where a duplicate record really existed between LKey and MicroKey, only the real records were returned, not a set of duplicates: mysql> select * from fed_dbn_pay_StaffLoans where MicroKey = 27 or LKey = 68690; +-------+----------+------------+------------+-------------+-----------+----------------+----------+-------------+----------+----------+--------+------------+---------+----------------+-----------+------------+---------+-----------+ | LKey | StaffKey | LoanAmount | DateOfLoan | Description | Repayment | BeneficiaryKey | LoanPaid | Type | MicroKey | Interest | IniFee | ServiceFee | Monthly | ActivationDate | SpecRepay | SpecPreiod | Dormant | Insurance | +-------+----------+------------+------------+-------------+-----------+----------------+----------+-------------+----------+----------+--------+------------+---------+----------------+-----------+------------+---------+-----------+ | 27887 | 68690 | 1466.86 | 17/07/2007 | BAB LN | 122.24 | 0 | 1 | Baberki Lns | 27 | 124.86 | 171.00 | 171.00 | 0 | NULL | NULL | NULL | 0 | 0.00 | | 68690 | 138585 | 81.00 | 15/05/2011 | OVERPAYMENT | 81.00 | 0 | 1 | Other | 0 | 0.00 | 0.00 | 0.00 | 0 | 15/05/2011 | NULL | NULL | 0 | 0.00 | +-------+----------+------------+------------+-------------+-----------+----------------+----------+-------------+----------+----------+--------+------------+---------+----------------+-----------+------------+---------+-----------+ 2 rows in set (4 min 14.17 sec) Looks like the bug only surfaces in specific conditions
[2 Mar 2012 8:25]
Valeriy Kravchuk
That was my initial idea that the reason is related to some optimizer bug on original server that can be fixed in 5.1.61. That's why I asked for CREATE TABLE for the original (not federated) table. I need to know is it InnoDB table, for example.
[5 Mar 2012 10:03]
Desmond Coertzen
I tried remote server 5.1.61 as well. No change. The federated table is a replica of the real table. The real table is using the MyISAM engine
[13 Mar 2012 13:18]
Desmond Coertzen
I believe I gave enough information to reproduce the bug. Can someone try to reproduce? I'm trying to avoid giving a dump of the data so that I do not have to scrub it of private information
[25 Mar 2012 13:19]
Valeriy Kravchuk
Please, send the output of EXPLAIN for the query that gives duplicate records and for the case when results are correct.
[27 Mar 2012 9:01]
Desmond Coertzen
*** explain for incorrect results: mysql> explain select * from fed_jhb_pay_StaffLoans where MicroKey = 143775 or LKey = 157617; +----+-------------+------------------------+-------------+------------------+------------------+---------+------+------+--------------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+------------------------+-------------+------------------+------------------+---------+------+------+--------------------------------------------+ | 1 | SIMPLE | fed_jhb_pay_StaffLoans | index_merge | PRIMARY,MicroKey | MicroKey,PRIMARY | 5,4 | NULL | 3 | Using union(MicroKey,PRIMARY); Using where | +----+-------------+------------------------+-------------+------------------+------------------+---------+------+------+--------------------------------------------+ 1 row in set (0.00 sec) *** explain for correct results: explain select * from fed_dbn_pay_StaffLoans where MicroKey = 27 or LKey = 68690; +----+-------------+-------------------------+-------------+------------------+------------------+---------+------+------+--------------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------------------------+-------------+------------------+------------------+---------+------+------+--------------------------------------------+ | 1 | SIMPLE | fed_dbnr_pay_StaffLoans | index_merge | PRIMARY,MicroKey | MicroKey,PRIMARY | 5,4 | NULL | 3 | Using union(MicroKey,PRIMARY); Using where | +----+-------------+-------------------------+-------------+------------------+------------------+---------+------+------+--------------------------------------------+ 1 row in set (0.00 sec)
[26 Apr 2012 17:14]
Sveta Smirnova
Thank you for the feedback. I can not repeat described behavior with generic data. Could you please provide [partial] dump of original table, so we can repeat it?
[27 May 2012 1:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".