1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-21 06:21:35 +03:00
Files
mariadb/mysql-test/t
unknown 43acceeb47 Fix LP BUG#715069
Analysis:
The wrong result is a consquence of sorting the subquery
result and then selecting only the first row due to the
artificial LIMIT 1 introduced by the fix_fields phase.
Normally, if there is an ORDER BY in a subquery, the ORDER
is removed (Item_in_subselect::select_in_like_transformer),
however if a GROUP BY is transformed into ORDER, this happens
later, after the removal of the ORDER clause of subqueries, so
we end up with a subquery with an ORDER clause, and an artificially
added LIMIT 1.

The reason why the same works in the main 5.3 without MWL#89, is
that the 5.3 performs all subquery transformations, including
IN->EXISTS before JOIN::optimize(). The beginning of JOIN::optimize
does:
  if (having || (select_options & OPTION_FOUND_ROWS))
    select_limit= HA_POS_ERROR;
which sets the limit back to infinity, thus 5.3 sorts the whole
subquery result, and IN performs the lookup into all subquery result
rows.

Solution:
Sorting of subqueries without LIMIT is meaningless. Since LIMIT in
subqueries is not supported, the patch removes sorting by setting
  join->skip_sort_order= true
for each subquery JOIN object. This improves a number of execution
plans to not perform unnecessary sorting at all.
2011-04-20 18:36:55 +03:00
..
2010-02-25 23:13:11 +04:00
2010-09-12 18:40:01 +02:00
2010-06-10 11:11:52 +02:00
2009-10-28 09:52:34 +02:00
2009-10-28 09:52:34 +02:00
2009-10-28 09:52:34 +02:00
2010-09-12 18:40:01 +02:00
2011-03-09 15:47:59 +02:00
2009-10-28 09:52:34 +02:00
2010-05-26 21:55:40 +03:00
2010-11-25 00:57:34 +02:00
2009-09-29 17:38:40 +02:00
2010-01-15 17:27:55 +02:00
2011-02-20 18:51:43 +02:00
2011-03-30 10:10:59 +03:00
2009-09-08 00:50:10 +04:00
2010-11-25 00:57:34 +02:00
2009-09-08 00:50:10 +04:00
2011-03-30 10:10:59 +03:00
2010-11-25 00:57:34 +02:00
2011-02-20 18:51:43 +02:00
2011-02-20 18:51:43 +02:00
2010-11-25 00:57:34 +02:00
2011-01-18 00:53:41 +02:00
2009-10-28 09:52:34 +02:00
2010-12-27 14:22:05 -08:00
2011-02-20 18:51:43 +02:00
2010-10-19 15:58:35 +02:00
2010-10-27 16:31:22 -07:00
2010-10-27 16:31:22 -07:00
2011-01-11 15:36:41 +02:00
2011-03-12 00:49:03 -08:00
2010-08-30 16:25:23 +03:00
2011-01-11 15:36:41 +02:00
2010-09-06 02:15:34 +03:00
2010-11-23 23:39:59 +02:00
2011-03-09 15:47:59 +02:00
2009-10-28 09:52:34 +02:00
2009-10-28 09:52:34 +02:00
2010-09-06 02:15:34 +03:00
2011-02-20 18:51:43 +02:00
2009-10-04 01:20:51 +02:00
2010-09-20 15:17:59 +02:00
2010-08-25 22:22:33 +02:00
2011-02-20 18:51:43 +02:00
2011-01-26 20:45:23 -08:00
2009-10-28 09:52:34 +02:00
2009-08-12 12:03:05 +02:00
2010-06-14 18:58:52 +02:00
2010-11-25 00:57:34 +02:00
2011-02-20 18:51:43 +02:00
2010-12-06 10:25:44 +02:00
2009-09-08 00:50:10 +04:00
2010-12-10 01:17:09 -08:00
2009-10-28 09:52:34 +02:00
2010-10-27 16:31:22 -07:00
2011-01-26 11:30:29 -08:00
2009-10-28 09:52:34 +02:00
2009-11-27 18:10:28 +02:00
2010-04-08 14:10:05 +02:00
2010-03-21 21:58:19 +01:00
2010-10-27 16:31:22 -07:00
2011-01-11 14:04:08 +02:00
2011-04-20 18:36:55 +03:00
2011-02-22 12:44:58 +02:00
2011-02-22 12:44:58 +02:00
2011-04-01 15:42:59 +03:00
2011-02-03 17:00:28 +02:00
2010-11-25 00:34:50 +02:00
2011-02-03 17:00:28 +02:00
2011-03-01 14:16:28 +02:00
2011-03-30 10:10:59 +03:00
2010-05-26 21:55:40 +03:00
2010-06-10 11:11:52 +02:00
2010-09-20 15:17:59 +02:00
2011-03-09 15:47:59 +02:00
2011-03-09 15:47:59 +02:00
2011-03-09 15:47:59 +02:00
2010-10-27 16:31:22 -07:00
2010-11-22 12:21:10 +03:00