List:Commits« Previous MessageNext Message »
From:eugene Date:January 12 2007 1:43pm
Subject:bk commit into 5.0 tree (evgen:1.2378)
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-01-12 16:43:52+03:00, evgen@stripped +7 -0
  Merge moonbone.local:/work/latest-4.1-opt-mysql
  into  moonbone.local:/work/latest-5.0-opt-mysql
  MERGE: 1.1616.2873.40

  mysql-test/r/delete.result@stripped, 2007-01-12 16:43:51+03:00, evgen@stripped +1 -0
    Manual merge
    MERGE: 1.21.1.3

  mysql-test/r/func_str.result@stripped, 2007-01-12 16:43:51+03:00, evgen@stripped +0 -1
    Manual merge
    MERGE: 1.70.1.34

  mysql-test/t/delete.test@stripped, 2007-01-12 16:43:51+03:00, evgen@stripped +1 -0
    Manual merge
    MERGE: 1.19.1.4

  mysql-test/t/func_str.test@stripped, 2007-01-12 16:40:31+03:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.64.1.22

  sql/item_strfunc.cc@stripped, 2007-01-12 16:40:31+03:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.196.6.20

  sql/item_strfunc.h@stripped, 2007-01-12 16:40:31+03:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.73.2.20

  sql/sql_delete.cc@stripped, 2007-01-12 16:40:31+03:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.99.2.44

# 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/latest-5.0-opt-mysql/RESYNC

--- 1.292/sql/item_strfunc.cc	2006-12-31 11:39:17 +03:00
+++ 1.293/sql/item_strfunc.cc	2007-01-12 16:40:31 +03:00
@@ -1694,6 +1694,19 @@
   return res;
 }
 
+void Item_func_encode::print(String *str)
+{
+  str->append(func_name());
+  str->append('(');
+  args[0]->print(str);
+  str->append(',');
+  str->append('\'');
+  str->append(seed);
+  str->append('\'');
+  str->append(')');
+}
+
+
 String *Item_func_decode::val_str(String *str)
 {
   DBUG_ASSERT(fixed == 1);

--- 1.119/sql/item_strfunc.h	2006-12-23 22:04:24 +03:00
+++ 1.120/sql/item_strfunc.h	2007-01-12 16:40:31 +03:00
@@ -358,19 +358,24 @@
 {
  protected:
   SQL_CRYPT sql_crypt;
+  String seed;
 public:
-  Item_func_encode(Item *a, char *seed):
-    Item_str_func(a),sql_crypt(seed) {}
+  Item_func_encode(Item *a, char *seed_arg):
+    Item_str_func(a), sql_crypt(seed_arg)
+    {
+      seed.copy(seed_arg, strlen(seed_arg), default_charset_info);
+    }
   String *val_str(String *);
   void fix_length_and_dec();
   const char *func_name() const { return "encode"; }
+  void print(String *str);
 };
 
 
 class Item_func_decode :public Item_func_encode
 {
 public:
-  Item_func_decode(Item *a, char *seed): Item_func_encode(a,seed) {}
+  Item_func_decode(Item *a, char *seed_arg): Item_func_encode(a, seed_arg) {}
   String *val_str(String *);
   const char *func_name() const { return "decode"; }
 };

--- 1.188/sql/sql_delete.cc	2006-12-23 22:04:27 +03:00
+++ 1.189/sql/sql_delete.cc	2007-01-12 16:40:31 +03:00
@@ -162,7 +162,7 @@
       DBUG_RETURN(TRUE);
     }
     
-    if (!select && limit != HA_POS_ERROR)
+    if ((!select || table->quick_keys.is_clear_all()) && limit != HA_POS_ERROR)
       usable_index= get_index_for_order(table, (ORDER*)(order->first), limit);
 
     if (usable_index == MAX_KEY)

--- 1.24/mysql-test/t/delete.test	2006-10-31 07:53:21 +03:00
+++ 1.25/mysql-test/t/delete.test	2007-01-12 16:43:51 +03:00
@@ -163,6 +163,17 @@
 delete FROM `4.t1` USING t1 as `4.t1` where `4.t1`.a = 5;
 drop table t1;
 
+#
+# Bug#17711: DELETE doesn't use index when ORDER BY, LIMIT and
+#            non-restricting WHERE is present.
+#
+create table t1(f1 int primary key);
+insert into t1 values (4),(3),(1),(2);
+delete from t1 where (@a:= f1) order by f1 limit 1;
+select @a;
+drop table t1;
+
+--echo End of 4.1 tests
 # End of 4.1 tests
 
 #

--- 1.124/mysql-test/r/func_str.result	2006-12-20 01:54:09 +03:00
+++ 1.125/mysql-test/r/func_str.result	2007-01-12 16:43:51 +03:00
@@ -1084,6 +1084,18 @@
 Warnings:
 Note	1003	select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(both _latin1'y' from `test`.`t1`.`s`) > _latin1'ab')
 DROP TABLE t1;
+create table t1(f1 varchar(4));
+explain extended select encode(f1,'zxcv') as 'enc' from t1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	system	NULL	NULL	NULL	NULL	0	const row not found
+Warnings:
+Note	1003	select encode(test.t1.f1,'zxcv') AS `enc` from test.t1
+explain extended select decode(f1,'zxcv') as 'enc' from t1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	system	NULL	NULL	NULL	NULL	0	const row not found
+Warnings:
+Note	1003	select decode(test.t1.f1,'zxcv') AS `enc` from test.t1
+drop table t1;
 End of 4.1 tests
 create table t1 (d decimal default null);
 insert into t1 values (null);

--- 1.98/mysql-test/t/func_str.test	2006-12-20 01:54:09 +03:00
+++ 1.99/mysql-test/t/func_str.test	2007-01-12 16:40:31 +03:00
@@ -730,6 +730,14 @@
 
 DROP TABLE t1;
  
+#
+# Bug#23409: ENCODE() and DECODE() functions aren't printed correctly
+#
+create table t1(f1 varchar(4));
+explain extended select encode(f1,'zxcv') as 'enc' from t1;
+explain extended select decode(f1,'zxcv') as 'enc' from t1;
+drop table t1;
+
 --echo End of 4.1 tests
 
 #

--- 1.26/mysql-test/r/delete.result	2006-10-31 07:52:32 +03:00
+++ 1.27/mysql-test/r/delete.result	2007-01-12 16:43:51 +03:00
@@ -176,6 +176,14 @@
 delete `4.t1` from t1 as `4.t1` where `4.t1`.a = 5;
 delete FROM `4.t1` USING t1 as `4.t1` where `4.t1`.a = 5;
 drop table t1;
+create table t1(f1 int primary key);
+insert into t1 values (4),(3),(1),(2);
+delete from t1 where (@a:= f1) order by f1 limit 1;
+select @a;
+@a
+1
+drop table t1;
+End of 4.1 tests
 CREATE TABLE t1 (a int not null,b int not null);
 CREATE TABLE t2 (a int not null, b int not null, primary key (a,b));
 CREATE TABLE t3 (a int not null, b int not null, primary key (a,b));
Thread
bk commit into 5.0 tree (evgen:1.2378)eugene18 Jan