From: Jon Olav Hauglid Date: November 11 2011 8:44am Subject: bzr push into mysql-trunk branch (jon.hauglid:3595 to 3596) Bug#11761014 List-Archive: http://lists.mysql.com/commits/141900 X-Bug: 11761014 Message-Id: <201111110844.pAB8iEON013652@acsmt358.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3596 Jon Olav Hauglid 2011-11-11 BUG#11761014 - 53466: END_CONNECTION() SHOULD REFERENCE GLOBAL_SYSTEM_VARIABLES.LOG_WARNINGS Post-push fix: Update result file for 32 bit version og log_warnings test. modified: mysql-test/suite/sys_vars/r/log_warnings_basic_32.result 3595 Jorgen Loland 2011-11-11 Bug#12578908: SELECT SQL_BUFFER_RESULT OUTPUTS TOO MANY ROWS WHEN GROUP IS CONSTANT 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 not done when inserting rows into 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. At the same time, make_simple_join() assumes that since a temporary table is used, grouping will be taken care of and sets JOIN::group to false. The fix is in make_simple_join(), and is to not set JOIN::group to false in the unlikely event that a temporary table is used for a query where the group clause was optimized away. With this change, end_{send|write}_group() is used when reading from the temporary table. This is the same function as is used when a temporary table is not explicitly requested. @ mysql-test/r/group_by.result Add test for BUG#12578908 @ mysql-test/t/group_by.test Add test for BUG#12578908 @ sql/sql_select.cc Don't set JOIN::group=false in make_simple_join() if the group clause was optimized away. modified: mysql-test/r/group_by.result mysql-test/t/group_by.test sql/sql_select.cc === modified file 'mysql-test/suite/sys_vars/r/log_warnings_basic_32.result' --- a/mysql-test/suite/sys_vars/r/log_warnings_basic_32.result 2011-11-10 06:53:27 +0000 +++ b/mysql-test/suite/sys_vars/r/log_warnings_basic_32.result 2011-11-11 08:43:43 +0000 @@ -76,7 +76,7 @@ SELECT @@global.log_warnings; SET @@global.log_warnings = 10; SELECT @@log_warnings = @@global.log_warnings; @@log_warnings = @@global.log_warnings -0 +1 SET @@global.log_warnings = @start_global_value; SELECT @@global.log_warnings; @@global.log_warnings No bundle (reason: useless for push emails).