1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-21 06:21:35 +03:00
Files
mariadb/mysql-test/r
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-01-15 17:27:55 +02:00
2010-03-20 15:01:47 +03:00
2010-10-27 16:31:22 -07:00
2009-08-10 15:46:20 -03:00
2010-05-26 21:55:40 +03:00
2010-12-10 23:23:34 -08:00
2010-01-15 17:27:55 +02:00
2011-03-09 15:47:59 +02:00
2011-04-20 18:36:55 +03:00
2010-11-25 00:57:34 +02:00
2011-02-03 17:00:28 +02:00
2009-06-01 16:00:38 +04:00
2011-03-09 15:47:59 +02:00
2011-03-30 10:10:59 +03:00
2010-10-10 17:18:11 +03:00
2010-11-25 00:57:34 +02:00
2011-03-09 15:47:59 +02:00
2011-02-20 18:51:43 +02:00
2011-03-09 15:47:59 +02:00
2011-02-03 17:00:28 +02:00
2011-02-03 17:00:28 +02:00
2011-02-23 14:46:16 +02:00
2011-02-03 17:00:28 +02:00
2009-12-08 23:47:54 +02:00
2010-10-10 17:18:11 +03:00
2010-10-19 15:58:35 +02:00
2011-03-01 15:54:21 +02:00
2011-03-01 14:16:28 +02:00
2010-12-10 23:23:34 -08:00
2011-03-30 10:10:59 +03:00
2011-03-09 15:47:59 +02:00
2011-02-03 17:00:28 +02:00
2010-09-06 02:15:34 +03:00
2011-03-09 15:47:59 +02:00
2010-12-14 12:33:03 +03:00
2009-10-28 09:52:34 +02:00
2011-02-18 21:45:32 +02:00
2011-03-01 14:16:28 +02:00
2011-03-29 22:43:35 +02:00
2010-09-06 02:15:34 +03:00
2010-12-01 12:25:31 +05:30
2009-10-04 01:20:51 +02:00
2010-09-20 15:17:59 +02:00
2011-02-20 18:51:43 +02:00
2009-11-06 17:54:19 +03:00
2011-03-01 14:16:28 +02:00
2010-10-15 20:13:35 +05:00
2010-12-31 10:39:14 +01:00
2010-12-06 10:25:44 +02:00
2010-11-23 23:39:59 +02:00
2010-11-23 23:39:59 +02:00
2010-11-23 23:39:59 +02:00
2011-02-03 17:00:28 +02:00
2009-10-27 14:09:36 +04:00
2010-12-06 10:25:44 +02:00
2010-12-27 14:22:05 -08:00
2010-12-27 14:22:05 -08:00
2010-12-27 14:22:05 -08:00
2009-06-09 17:08:46 +02:00
2010-12-10 23:23:34 -08:00
2010-09-28 12:39:33 -07:00
2011-01-26 11:30:29 -08:00
2011-02-20 18:51:43 +02:00
2010-06-01 21:52:20 +02:00
2009-11-27 18:10:28 +02:00
2010-06-26 14:05:41 +04:00
2009-06-10 11:58:36 +03:00
2011-02-03 17:00:28 +02:00
2011-04-20 18:36:55 +03:00
2011-04-20 18:36:55 +03:00
2011-04-20 18:36:55 +03:00
2011-02-03 17:00:28 +02:00
2011-02-22 12:44:58 +02:00
2011-02-22 12:44:58 +02:00
2011-04-20 18:36:55 +03:00
2011-04-20 18:36:55 +03:00
2011-04-20 18:36:55 +03:00
2011-04-20 18:36:55 +03:00
2011-03-01 15:54:21 +02:00
2011-03-01 14:16:28 +02:00
2011-03-01 14:16:28 +02:00
2011-03-01 14:16:28 +02:00
2011-03-01 14:16:28 +02:00
2011-04-20 18:36:55 +03:00
2010-09-28 12:39:33 -07:00
2011-01-13 02:59:11 +02:00
2010-12-31 10:39:14 +01:00
2010-10-19 15:58:35 +02:00
2011-02-14 08:26:36 +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