MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:eugene Date:July 24 2007 2:15pm
Subject:bk commit into 5.0 tree (evgen:1.2485) BUG#15130
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of evgen. When evgen does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-07-24 18:15:44+04:00, evgen@stripped +3 -0
  Bug#15130: CREATE .. SELECT was denied to use advantages of the SQL_BIG_RESULT.
  
  When the SQL_BIG_RESULT flag is specified SELECT should store items from the
  select list in the filesort data and use them when sending to a client.
  The get_addon_fields function is responsible for creating necessary structures
  for that. But this function was allowed to do so only for SELECT and
  INSERT .. SELECT queries. This makes the SQL_BIG_RESULT useless for
  the CREATE .. SELECT queries.
  
  Now the get_addon_fields allows storing select list items in the filesort
  data for the CREATE .. SELECT queries.

  mysql-test/r/create.result@stripped, 2007-07-24 18:15:16+04:00, evgen@stripped +13 -0
    Added a test case for the bug#15130: CREATE .. SELECT was denied to use
    advantages of the SQL_BIG_RESULT.

  mysql-test/t/create.test@stripped, 2007-07-24 18:14:35+04:00, evgen@stripped +10 -0
    Added a test case for the bug#15130: CREATE .. SELECT was denied to use
    advantages of the SQL_BIG_RESULT.

  sql/filesort.cc@stripped, 2007-07-24 18:15:23+04:00, evgen@stripped +2 -1
    Bug#15130: CREATE .. SELECT was denied to use advantages of the SQL_BIG_RESULT.
    Now the get_addon_fields allows storing select list items in the filesort
    data for the CREATE .. SELECT queries.

diff -Nrup a/mysql-test/r/create.result b/mysql-test/r/create.result
--- a/mysql-test/r/create.result	2007-07-12 16:12:55 +04:00
+++ b/mysql-test/r/create.result	2007-07-24 18:15:16 +04:00
@@ -1503,4 +1503,17 @@ t1	CREATE TABLE `t1` (
   `c17` int(11) default NULL
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 drop table t1;
+create table t1(f1 int,f2 int);
+insert into t1 value(1,1),(1,2),(1,3),(2,1),(2,2),(2,3);
+flush status;
+create table t2 select sql_big_result f1,count(f2) from t1 group by f1;
+show status like 'handler_read%';
+Variable_name	Value
+Handler_read_first	0
+Handler_read_key	0
+Handler_read_next	0
+Handler_read_prev	0
+Handler_read_rnd	0
+Handler_read_rnd_next	7
+drop table t1,t2;
 End of 5.0 tests
diff -Nrup a/mysql-test/t/create.test b/mysql-test/t/create.test
--- a/mysql-test/t/create.test	2007-07-12 16:12:55 +04:00
+++ b/mysql-test/t/create.test	2007-07-24 18:14:35 +04:00
@@ -1119,4 +1119,14 @@ show create table t1;
 drop table t1;
 
 
+#
+# Bug#15130:CREATE .. SELECT was denied to use advantages of the SQL_BIG_RESULT.
+#
+create table t1(f1 int,f2 int);
+insert into t1 value(1,1),(1,2),(1,3),(2,1),(2,2),(2,3);
+flush status;
+create table t2 select sql_big_result f1,count(f2) from t1 group by f1;
+show status like 'handler_read%';
+drop table t1,t2;
+
 --echo End of 5.0 tests
diff -Nrup a/sql/filesort.cc b/sql/filesort.cc
--- a/sql/filesort.cc	2007-07-02 02:33:22 +04:00
+++ b/sql/filesort.cc	2007-07-24 18:15:23 +04:00
@@ -1430,7 +1430,8 @@ get_addon_fields(THD *thd, Field **ptabf
     doesn't work for alter table
   */
   if (thd->lex->sql_command != SQLCOM_SELECT &&
-      thd->lex->sql_command != SQLCOM_INSERT_SELECT)
+      thd->lex->sql_command != SQLCOM_INSERT_SELECT &&
+      thd->lex->sql_command != SQLCOM_CREATE_TABLE)
     return 0;
   for (pfield= ptabfield; (field= *pfield) ; pfield++)
   {
Thread
bk commit into 5.0 tree (evgen:1.2485) BUG#15130eugene24 Jul