List:Internals« Previous MessageNext Message »
From:igor Date:June 29 2005 11:40am
Subject:bk commit into 4.1 tree (igor:1.2324) BUG#11469
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 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
  1.2324 05/06/29 02:40:25 igor@stripped +3 -0
  func_str.test:
    Added test cases for bug #11469.
  item_strfunc.h:
    Fixed bug #11469: wrong implementation of the not_null_tables
    method for CONCAT_WS.

  mysql-test/r/func_str.result
    1.93 05/06/29 02:40:06 igor@stripped +50 -0

  mysql-test/t/func_str.test
    1.74 05/06/29 02:39:37 igor@stripped +56 -0
    Added test cases for bug #11469.

  sql/item_strfunc.h
    1.96 05/06/29 02:37:26 igor@stripped +1 -0
    Fixed bug #11469: wrong implementation of the not_null_tables
    method for CONCAT_WS.

# 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:	rurik.mysql.com
# Root:	/home/igor/dev/mysql-4.1-0

--- 1.95/sql/item_strfunc.h	Tue May 17 19:06:25 2005
+++ 1.96/sql/item_strfunc.h	Wed Jun 29 02:37:26 2005
@@ -95,6 +95,7 @@
   String *val_str(String *);
   void fix_length_and_dec();
   const char *func_name() const { return "concat_ws"; }
+  table_map not_null_tables() const { return 0; }
 };
 
 class Item_func_reverse :public Item_str_func

--- 1.92/mysql-test/r/func_str.result	Thu Jun 23 06:14:53 2005
+++ 1.93/mysql-test/r/func_str.result	Wed Jun 29 02:40:06 2005
@@ -800,3 +800,53 @@
 str	num
 notnumber	0
 DROP TABLE t1,t2;
+CREATE TABLE t1(
+id int(11) NOT NULL auto_increment,
+pc int(11) NOT NULL default '0',
+title varchar(20) default NULL,
+PRIMARY KEY (id)
+);
+INSERT INTO t1 VALUES
+(1, 0, 'Main'),
+(2, 1, 'Toys'),
+(3, 1, 'Games');
+SELECT t1.id, CONCAT_WS('->', t3.title, t2.title, t1.title) as col1
+FROM t1 LEFT JOIN t1 AS t2 ON t1.pc=t2.id
+LEFT JOIN t1 AS t3 ON t2.pc=t3.id;
+id	col1
+1	Main
+2	Main->Toys
+3	Main->Games
+SELECT t1.id, CONCAT_WS('->', t3.title, t2.title, t1.title) as col1
+FROM t1 LEFT JOIN t1 AS t2 ON t1.pc=t2.id
+LEFT JOIN t1 AS t3 ON t2.pc=t3.id
+WHERE CONCAT_WS('->', t3.title, t2.title, t1.title) LIKE '%Toys%';
+id	col1
+2	Main->Toys
+DROP TABLE t1;
+CREATE TABLE t1(
+trackid     int(10) unsigned NOT NULL auto_increment,
+trackname   varchar(100) NOT NULL default '',
+PRIMARY KEY (trackid)
+);
+CREATE TABLE t2(
+artistid    int(10) unsigned NOT NULL auto_increment,
+artistname  varchar(100) NOT NULL default '',
+PRIMARY KEY (artistid)
+);
+CREATE TABLE t3(
+trackid     int(10) unsigned NOT NULL,
+artistid    int(10) unsigned NOT NULL,
+PRIMARY KEY (trackid,artistid)
+);
+INSERT INTO t1 VALUES (1, 'April In Paris'), (2, 'Autumn In New York');
+INSERT INTO t2 VALUES (1, 'Vernon Duke');
+INSERT INTO t3 VALUES (1,1);
+SELECT CONCAT_WS(' ', trackname, artistname) trackname, artistname
+FROM t1 LEFT JOIN t3 ON t1.trackid=t3.trackid
+LEFT JOIN t2 ON t2.artistid=t3.artistid
+WHERE CONCAT_WS(' ', trackname, artistname) LIKE '%In%';
+trackname	artistname
+April In Paris Vernon Duke	Vernon Duke
+Autumn In New York	NULL
+DROP TABLE t1,t2,t3;

--- 1.73/mysql-test/t/func_str.test	Thu Jun 23 06:14:28 2005
+++ 1.74/mysql-test/t/func_str.test	Wed Jun 29 02:39:37 2005
@@ -541,3 +541,59 @@
 SELECT * FROM t1, t2 WHERE num=substring(str from 1 for 6);
 
 DROP TABLE t1,t2;
+
+#
+# Bug #11469: NOT NULL optimization wrongly used for arguments of CONCAT_WS  
+#
+
+CREATE TABLE t1(
+  id int(11) NOT NULL auto_increment,
+  pc int(11) NOT NULL default '0',
+  title varchar(20) default NULL,
+  PRIMARY KEY (id)
+);
+
+INSERT INTO t1 VALUES
+  (1, 0, 'Main'),
+  (2, 1, 'Toys'),
+  (3, 1, 'Games');
+
+SELECT t1.id, CONCAT_WS('->', t3.title, t2.title, t1.title) as col1
+  FROM t1 LEFT JOIN t1 AS t2 ON t1.pc=t2.id
+          LEFT JOIN t1 AS t3 ON t2.pc=t3.id;
+SELECT t1.id, CONCAT_WS('->', t3.title, t2.title, t1.title) as col1
+  FROM t1 LEFT JOIN t1 AS t2 ON t1.pc=t2.id
+          LEFT JOIN t1 AS t3 ON t2.pc=t3.id
+    WHERE CONCAT_WS('->', t3.title, t2.title, t1.title) LIKE '%Toys%';
+
+DROP TABLE t1;
+
+
+CREATE TABLE t1(
+  trackid     int(10) unsigned NOT NULL auto_increment,
+  trackname   varchar(100) NOT NULL default '',
+  PRIMARY KEY (trackid)
+);
+
+CREATE TABLE t2(
+  artistid    int(10) unsigned NOT NULL auto_increment,
+  artistname  varchar(100) NOT NULL default '',
+  PRIMARY KEY (artistid)
+);
+
+CREATE TABLE t3(
+  trackid     int(10) unsigned NOT NULL,
+  artistid    int(10) unsigned NOT NULL,
+  PRIMARY KEY (trackid,artistid)
+);
+
+INSERT INTO t1 VALUES (1, 'April In Paris'), (2, 'Autumn In New York');
+INSERT INTO t2 VALUES (1, 'Vernon Duke');
+INSERT INTO t3 VALUES (1,1);
+
+SELECT CONCAT_WS(' ', trackname, artistname) trackname, artistname
+  FROM t1 LEFT JOIN t3 ON t1.trackid=t3.trackid
+          LEFT JOIN t2 ON t2.artistid=t3.artistid
+    WHERE CONCAT_WS(' ', trackname, artistname) LIKE '%In%';
+
+DROP TABLE t1,t2,t3;
Thread
bk commit into 4.1 tree (igor:1.2324) BUG#11469igor29 Jun