List:Commits« Previous MessageNext Message »
From:igor Date:July 19 2006 8:44pm
Subject:bk commit into 5.0 tree (igor:1.2206)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of igor. When igor 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, 2006-07-19 13:44:37-07:00, igor@stripped +4 -0
  Merge olga.mysql.com:/home/igor/mysql-4.1-opt
  into  olga.mysql.com:/home/igor/mysql-5.0-opt
  MERGE: 1.1616.2658.6

  mysql-test/r/func_str.result@stripped, 2006-07-19 13:44:34-07:00, igor@stripped +0 -0
    Auto merged
    MERGE: 1.70.1.33

  mysql-test/t/func_str.test@stripped, 2006-07-19 13:44:34-07:00, igor@stripped +0 -0
    Auto merged
    MERGE: 1.64.1.21

  sql/item_strfunc.cc@stripped, 2006-07-19 13:44:34-07:00, igor@stripped +0 -0
    Auto merged
    MERGE: 1.196.6.14

  sql/item_strfunc.h@stripped, 2006-07-19 13:44:34-07:00, igor@stripped +0 -0
    Auto merged
    MERGE: 1.73.2.18

# 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:	igor
# Host:	olga.mysql.com
# Root:	/home/igor/mysql-5.0-opt/RESYNC

--- 1.274/sql/item_strfunc.cc	2006-07-19 13:44:43 -07:00
+++ 1.275/sql/item_strfunc.cc	2006-07-19 13:44:43 -07:00
@@ -1503,6 +1503,23 @@
   }
 }
 
+void Item_func_trim::print(String *str)
+{
+  if (arg_count == 1)
+  {
+    Item_func::print(str);
+    return;
+  }
+  str->append(Item_func_trim::func_name());
+  str->append('(');
+  str->append(mode_name());
+  str->append(' ');
+  args[1]->print(str);
+  str->append(" from ",6);
+  args[0]->print(str);
+  str->append(')');
+}
+
 
 /* Item_func_password */
 

--- 1.110/sql/item_strfunc.h	2006-07-19 13:44:43 -07:00
+++ 1.111/sql/item_strfunc.h	2006-07-19 13:44:43 -07:00
@@ -233,6 +233,8 @@
   String *val_str(String *);
   void fix_length_and_dec();
   const char *func_name() const { return "trim"; }
+  void print(String *str);
+  virtual const char *mode_name() const { return "both"; }
 };
 
 
@@ -243,6 +245,7 @@
   Item_func_ltrim(Item *a) :Item_func_trim(a) {}
   String *val_str(String *);
   const char *func_name() const { return "ltrim"; }
+  const char *mode_name() const { return "leading"; }
 };
 
 
@@ -253,6 +256,7 @@
   Item_func_rtrim(Item *a) :Item_func_trim(a) {}
   String *val_str(String *);
   const char *func_name() const { return "rtrim"; }
+  const char *mode_name() const { return "trailing"; }
 };
 
 

--- 1.116/mysql-test/r/func_str.result	2006-07-19 13:44:43 -07:00
+++ 1.117/mysql-test/r/func_str.result	2006-07-19 13:44:43 -07:00
@@ -1053,6 +1053,34 @@
 abc	abc abc
 xyz	xyz xyz
 DROP TABLE t1;
+CREATE TABLE t1 (s varchar(10));
+INSERT INTO t1 VALUES ('yadda'), ('yaddy');
+EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(s) > 'ab';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	Using where
+Warnings:
+Note	1003	select test.t1.s AS `s` from test.t1 where (trim(test.t1.s) > _latin1'ab')
+EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM('y' FROM s) > 'ab';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	Using where
+Warnings:
+Note	1003	select test.t1.s AS `s` from test.t1 where (trim(both _latin1'y' from test.t1.s) > _latin1'ab')
+EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(LEADING 'y' FROM s) > 'ab';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	Using where
+Warnings:
+Note	1003	select test.t1.s AS `s` from test.t1 where (trim(leading _latin1'y' from test.t1.s) > _latin1'ab')
+EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(TRAILING 'y' FROM s) > 'ab';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	Using where
+Warnings:
+Note	1003	select test.t1.s AS `s` from test.t1 where (trim(trailing _latin1'y' from test.t1.s) > _latin1'ab')
+EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(BOTH 'y' FROM s) > 'ab';
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	2	Using where
+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;
 End of 4.1 tests
 create table t1 (d decimal default null);
 insert into t1 values (null);

--- 1.90/mysql-test/t/func_str.test	2006-07-19 13:44:43 -07:00
+++ 1.91/mysql-test/t/func_str.test	2006-07-19 13:44:43 -07:00
@@ -701,6 +701,21 @@
                      INSTR(REVERSE(CONCAT(a,' ',a))," ")) = a;
 
 DROP TABLE t1;
+
+#
+# Bug#17526: WRONG PRINT for TRIM FUNCTION with two arguments
+#
+
+CREATE TABLE t1 (s varchar(10));
+INSERT INTO t1 VALUES ('yadda'), ('yaddy');
+
+EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(s) > 'ab';
+EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM('y' FROM s) > 'ab';
+EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(LEADING 'y' FROM s) > 'ab';
+EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(TRAILING 'y' FROM s) > 'ab';
+EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(BOTH 'y' FROM s) > 'ab';
+
+DROP TABLE t1;
  
 --echo End of 4.1 tests
 
Thread
bk commit into 5.0 tree (igor:1.2206)igor19 Jul