List:Commits« Previous MessageNext Message »
From:igor Date:March 12 2007 8:40am
Subject:bk commit into 5.0 tree (igor:1.2474) BUG#26738
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, 2007-03-12 01:39:57-07:00, igor@stripped +3 -0
  Fixed bug #26738: incomplete string values in a result set column 
  when the column is to be read from a derived table column which 
  was specified as a concatenation of string literals.
  The bug happened because the Item_string::append did not adjust the
  value of Item_string::max_length. As a result of it the temporary 
  table column  defined to store the concatenation of literals was 
  not wide enough to hold the whole value.
  

  mysql-test/r/subselect.result@stripped, 2007-03-12 01:39:55-07:00, igor@stripped +13 -0
    Added a test case for bug #26738.

  mysql-test/t/subselect.test@stripped, 2007-03-12 01:39:55-07:00, igor@stripped +13 -0
    Added a test case for bug #26738.

  sql/item.h@stripped, 2007-03-12 01:39:55-07:00, igor@stripped +5 -1
    Fixed bug #26738: incomplete string values in a result set column 
    when the column is to be read from a derived table column which 
    was specified as a concatenation of string literals.
    The bug happened because the Item_string::append did not adjust the
    value of Item_string::max_length. As a result of it the temporary 
    table column  defined to store the concatenation of literals was 
    not wide enough to hold the whole value.
    

# 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/dev-opt/mysql-5.0-opt-bug26738

--- 1.221/sql/item.h	2007-03-12 01:40:05 -07:00
+++ 1.222/sql/item.h	2007-03-12 01:40:05 -07:00
@@ -1713,7 +1713,11 @@
     			   str_value.length(), collation.collation);
   }
   Item *safe_charset_converter(CHARSET_INFO *tocs);
-  inline void append(char *str, uint length) { str_value.append(str, length); }
+  inline void append(char *str, uint length)
+  {
+    str_value.append(str, length);
+    max_length= str_value.numchars() * collation.collation->mbmaxlen;
+  }
   void print(String *str);
   // to prevent drop fixed flag (no need parent cleanup call)
   void cleanup() {}

--- 1.178/mysql-test/r/subselect.result	2007-03-12 01:40:05 -07:00
+++ 1.179/mysql-test/r/subselect.result	2007-03-12 01:40:05 -07:00
@@ -3867,3 +3867,16 @@
 DROP TABLE t1;
 DROP TABLE t2;
 DROP TABLE t1xt2;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (3), (1), (2);
+SELECT 'this is ' 'a test.' AS col1, a AS col2 FROM t1;
+col1	col2
+this is a test.	3
+this is a test.	1
+this is a test.	2
+SELECT * FROM (SELECT 'this is ' 'a test.' AS col1, a AS t2 FROM t1) t;
+col1	t2
+this is a test.	3
+this is a test.	1
+this is a test.	2
+DROP table t1;

--- 1.143/mysql-test/t/subselect.test	2007-03-12 01:40:05 -07:00
+++ 1.144/mysql-test/t/subselect.test	2007-03-12 01:40:05 -07:00
@@ -2729,3 +2729,16 @@
 DROP TABLE t2;
 DROP TABLE t1xt2;
 
+#
+# Bug #26728: derived table with concatanation of literals in select list
+#  
+
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (3), (1), (2);           
+
+SELECT 'this is ' 'a test.' AS col1, a AS col2 FROM t1;
+SELECT * FROM (SELECT 'this is ' 'a test.' AS col1, a AS t2 FROM t1) t;
+
+DROP table t1;
+
+
Thread
bk commit into 5.0 tree (igor:1.2474) BUG#26738igor12 Mar