1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-31 22:22:30 +03:00
Files
mariadb/mysql-test/r
unknown 213476ef3e Fix for bug lp:992405
The patch backports two patches from mysql 5.6:
- BUG#12640437: USING SQL_BUFFER_RESULT RESULTS IN A DIFFERENT QUERY OUTPUT
- Bug#12578908: SELECT SQL_BUFFER_RESULT OUTPUTS TOO MANY ROWS WHEN GROUP IS OPTIMIZED AWAY

Original comment:
-----------------
3714 Jorgen Loland	2012-03-01
      BUG#12640437 - USING SQL_BUFFER_RESULT RESULTS IN A DIFFERENT 
                     QUERY OUTPUT
      
      For all but simple grouped queries, temporary tables are used to
      resolve grouping. In these cases, the list of grouping fields is
      stored in the temporary table and grouping is resolved
      there (e.g. by adding a unique constraint on the involved
      fields). Because of this, grouping is already done when the rows
      are read from the temporary table.
      
      In the case where a group clause may be optimized away, grouping
      does not have to be resolved using a temporary table. However, if
      a temporary table is explicitly requested (e.g. because the
      SQL_BUFFER_RESULT hint is used, or the statement is
      INSERT...SELECT), a temporary table is used anyway. In this case,
      the temporary table is created with an empty group list (because
      the group clause was optimized away) and it will therefore not
      create groups. Since the temporary table does not take care of
      grouping, JOIN::group shall not be set to false in 
      make_simple_join(). This was fixed in bug 12578908. 
      
      However, there is an exception where make_simple_join() should
      set JOIN::group to false even if the query uses a temporary table
      that was explicitly requested but is not strictly needed. That
      exception is if the loose index scan access method (explain
      says "Using index for group-by") is used to read into the 
      temporary table. With loose index scan, grouping is resolved 
      by the access method. This is exactly what happens in this bug.
2012-05-07 11:02:58 +03:00
..
2012-02-20 16:23:18 +02:00
2010-02-25 23:13:11 +04:00
2010-01-15 17:27:55 +02:00
2011-04-07 14:44:26 +03:00
2011-01-25 12:14:28 +05:30
2009-08-10 15:46:20 -03:00
2011-05-02 20:58:45 +03:00
2012-04-05 10:49:38 +02:00
2010-01-15 17:27:55 +02:00
2010-12-14 12:33:03 +03:00
2011-11-24 18:48:58 +02:00
2011-11-24 18:48:58 +02:00
2010-11-25 00:57:34 +02:00
2009-06-01 16:00:38 +04:00
2012-05-03 14:49:52 +03:00
2012-03-08 22:33:01 -08:00
2010-11-25 00:57:34 +02:00
2012-05-02 22:00:31 +02:00
2011-05-03 19:10:10 +03:00
2012-05-07 11:02:58 +03:00
2011-12-12 12:36:46 +02:00
2009-05-06 15:00:14 +05:30
2010-10-19 15:58:35 +02:00
2010-09-12 21:25:57 -07:00
2012-04-05 10:49:38 +02:00
2011-03-29 10:09:05 +02:00
2010-09-06 02:15:34 +03:00
2010-12-14 12:33:03 +03:00
2009-10-28 09:52:34 +02:00
2012-04-05 12:01:52 +02:00
2010-09-06 02:15:34 +03:00
2010-12-01 12:25:31 +05:30
2012-04-05 12:01:52 +02:00
2011-05-02 20:58:45 +03:00
2011-11-24 18:48:58 +02:00
2009-11-06 17:54:19 +03:00
2010-12-31 10:39:14 +01:00
2009-09-08 00:50:10 +04: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
2010-11-23 23:39:59 +02:00
2011-12-27 13:19:13 -08:00
2009-10-27 14:09:36 +04:00
2010-11-30 23:11:03 +02:00
2012-04-05 12:01:52 +02:00
2009-06-09 17:08:46 +02:00
2011-11-23 19:32:14 +02:00
2010-06-01 21:52:20 +02:00
2011-05-02 20:58:45 +03:00
2012-04-05 12:01:52 +02:00
2009-06-10 11:58:36 +03:00
2011-02-20 18:51:43 +02:00
2012-01-20 23:54:43 -08:00
2011-12-28 18:47:01 -08:00
2010-12-31 10:39:14 +01:00
2011-11-24 18:48:58 +02:00
2011-11-23 19:32:14 +02:00
2011-09-13 18:46:47 +03:00
2011-09-29 10:56:21 +01:00