[MDEV-4025] Wrong estimate of rows in the test case for LP bug #934348 Created: 2013-01-12  Updated: 2015-11-06  Resolved: 2015-11-06

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 5.3.11
Fix Version/s: 5.3.12

Type: Bug Priority: Minor
Reporter: Igor Babaev Assignee: Igor Babaev
Resolution: Fixed Votes: 0
Labels: None


 Description   

The following EXPLAIN command from the test case for LP bug #934348

EXPLAIN
SELECT a FROM t1 t WHERE a IN (SELECT b FROM t1, t2 WHERE b = a)
GROUP BY a HAVING a != 'z';

returns

id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	PRIMARY	t	index	idx_a	idx_a	4	NULL	1	Using index
...

It should return

id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	PRIMARY	t	index	idx_a	idx_a	4	NULL	3	Using index

as the number of rows in the table t1 is equal to 3.



 Comments   
Comment by Elena Stepanova [ 2015-11-06 ]

It was fixed in 5.3.12, here is the commit message:

revno: 3612
revision-id: igor@askmonty.org-20130112042634-peaxz8hj6e32rqln
parent: wlad@montyprogram.com-20130111114421-j0y44s7tpukn7i9m
committer: Igor Babaev <igor@askmonty.org>
branch nick: maria-5.3
timestamp: Fri 2013-01-11 20:26:34 -0800
message:
  Fixed bug mdev-4025.
  The bug could lead to a wrong estimate of the number of expected rows
  in the output of the EXPLAIN commands for queries with GROUP BY.
  This could be observed in the test case for LP bug 934348.

Generated at Thu Feb 08 06:53:09 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.