List:Commits« Previous MessageNext Message »
From:eugene Date:June 20 2006 6:22pm
Subject:bk commit into 5.0 tree (evgen:1.2193)
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
  1.2193 06/06/20 22:22:14 evgen@stripped +3 -0
  Manually merged

  sql/sql_select.cc
    1.423 06/06/20 22:22:12 evgen@stripped +2 -0
    Manually merged

  mysql-test/t/insert_select.test
    1.29 06/06/20 22:17:42 evgen@stripped +0 -0
    Auto merged

  mysql-test/r/insert_select.result
    1.36 06/06/20 22:17:42 evgen@stripped +0 -0
    Auto merged

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	evgen
# Host:	moonbone.local
# Root:	/work/tmp_merge-5.0-opt-mysql/RESYNC

--- 1.422/sql/sql_select.cc	2006-06-03 03:55:50 +04:00
+++ 1.423/sql/sql_select.cc	2006-06-20 22:22:12 +04:00
@@ -1068,8 +1068,9 @@
 			   group_list ? 0 : select_distinct,
 			   group_list && simple_group,
 			   select_options,
-			   (order == 0 || skip_sort_order) ? select_limit :
-			   HA_POS_ERROR,
+			   (order == 0 || skip_sort_order || 
+                            test(select_options & OPTION_BUFFER_RESULT)) ? 
+                             select_limit : HA_POS_ERROR,
 			   (char *) "")))
       DBUG_RETURN(1);
 
@@ -8813,6 +8814,11 @@
       }
       keyinfo->key_length+=  key_part_info->length;
     }
+  }
+  else
+  {
+    set_if_smaller(table->max_rows, rows_limit);
+    param->end_write_records= rows_limit;
   }
 
   if (distinct && field_count != param->hidden_field_count)

--- 1.35/mysql-test/r/insert_select.result	2005-10-28 03:35:57 +04:00
+++ 1.36/mysql-test/r/insert_select.result	2006-06-20 22:17:42 +04:00
@@ -686,3 +686,7 @@
 insert into t1(x,y) select x,z from t2 on duplicate key update x=values(t2.x);
 ERROR 42S22: Unknown column 't2.x' in 'field list'
 drop table t1,t2;
+CREATE TABLE t1 (a int PRIMARY KEY);
+INSERT INTO t1 values (1), (2);
+INSERT INTO t1 SELECT a + 2 FROM t1 LIMIT 1;
+DROP TABLE t1;

--- 1.28/mysql-test/t/insert_select.test	2005-10-28 03:35:58 +04:00
+++ 1.29/mysql-test/t/insert_select.test	2006-06-20 22:17:42 +04:00
@@ -224,4 +224,17 @@
 insert into t1(x,y) select x,z from t2 on duplicate key update x=values(t2.x);
 drop table t1,t2; 
 
+#
+# Bug #9676: INSERT INTO x SELECT .. FROM x LIMIT 1; slows down with big 
+#             tables
+#
+
+#Note: not an exsaustive test : just a check of the code path.
+CREATE TABLE t1 (a int PRIMARY KEY);
+INSERT INTO t1 values (1), (2);
+
+INSERT INTO t1 SELECT a + 2 FROM t1 LIMIT 1;
+
+DROP TABLE t1;
+
 # End of 4.1 tests
Thread
bk commit into 5.0 tree (evgen:1.2193)eugene20 Jun