Description:
When slow query log is enabled, number of examined rows is wrongly reported with UNION's
are used.
Instead of total number of examined rows, only rows from temporary tables are reported.
How to repeat:
create table foo (id int(11));
insert into foo values (1),(2),(3),(4);
Turn on slow query logging in the long format, with:
--log-slow-queries --log-long-format
select count(*) from foo a, foo b, foo c where a.id=1;
select count(*) from foo a, foo b, foo c where a.id=1 union select count(*) from foo a,
foo b, foo c where a.id=1;
drop table foo;
First entry will have many examined rows while second will have zero rows reported.