List:Internals« Previous MessageNext Message »
From:sinisa Date:December 23 2004 7:08pm
Subject:bk commit into 4.0 tree (Sinisa:1.2025)
View as plain text  
Below is the list of changes that have just been committed into a local
4.0 repository of Sinisa. When Sinisa 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://www.mysql.com/doc/I/n/Installing_source_tree.html

ChangeSet
  1.2025 04/12/23 21:08:54 Sinisa@stripped +3 -0
  Fix for a bug #7495

  sql/item_strfunc.cc
    1.82 04/12/23 21:08:49 Sinisa@stripped +7 -7
    a better fix for a QUOTE() bug (Bug #7495)

  mysql-test/t/func_str.test
    1.31 04/12/23 21:08:49 Sinisa@stripped +2 -6
    test case for a bug in QUOTE() (Bug #7495)

  mysql-test/r/func_str.result
    1.31 04/12/23 21:08:49 Sinisa@stripped +6 -12
    result for test case for a bug in QUOTE() (Bug #7495)

# 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:	Sinisa
# Host:	sinisa.nasamreza.org
# Root:	/mnt/work/mysql-4.0

--- 1.81/sql/item_strfunc.cc	Wed Dec 22 21:31:13 2004
+++ 1.82/sql/item_strfunc.cc	Thu Dec 23 21:08:49 2004
@@ -1141,7 +1141,7 @@
   }
   if (ptr == res->ptr())
     return res;
-  tmp_value.copy(res->ptr() + (ptr - res->ptr()), (uint32) (end - ptr));
+  tmp_value.set(*res,(uint) (ptr - res->ptr()),(uint) (end-ptr));
   return &tmp_value;
 }
 
@@ -1266,7 +1266,7 @@
   }
   if (ptr == res->ptr() && end == ptr+res->length())
     return res;
-  tmp_value.copy(res->ptr() + (ptr - res->ptr()), (uint32) (end - ptr));
+  tmp_value.set(*res,(uint) (ptr - res->ptr()),(uint) (end-ptr));
   return &tmp_value;
 }
 
@@ -2185,16 +2185,16 @@
 
   /*
     We have to use realloc() instead of alloc() as we want to keep the
-    old result in str
+    old result in arg
   */
-  if (str->realloc(new_length))
+  if (arg->realloc(new_length))
     goto null;
 
   /*
     As 'arg' and 'str' may be the same string, we must replace characters
     from the end to the beginning
   */
-  to= (char*) str->ptr() + new_length - 1;
+  to= (char*) arg->ptr() + new_length - 1;
   *to--= '\'';
   for (start= (char*) arg->ptr(),end= start + arg_length; end-- != start; to--)
   {
@@ -2222,9 +2222,9 @@
     }
   }
   *to= '\'';
-  str->length(new_length);
+  arg->length(new_length);
   null_value= 0;
-  return str;
+  return arg;
 
 null:
   null_value= 1;

--- 1.30/mysql-test/r/func_str.result	Wed Dec 22 21:31:12 2004
+++ 1.31/mysql-test/r/func_str.result	Thu Dec 23 21:08:49 2004
@@ -291,15 +291,9 @@
 select trim(leading 'foo' from 'foo');
 trim(leading 'foo' from 'foo')
 
-create table t1 (a varchar(80), b varchar(80));
-insert into t1 values(NULL,"12345");
-insert into t1 values(NULL,"chm");
-select quote(ltrim(concat('  ',t1.b))) from t1;
-quote(ltrim(concat('  ',t1.b)))
-'12345'
-'chm'
-select quote(trim(concat('  ',t1.b))) from t1;
-quote(trim(concat('  ',t1.b)))
-'12345'
-'chm'
-drop table t1;
+select quote(ltrim(concat('    ', 'a')));
+quote(ltrim(concat('    ', 'a')))
+'a'
+select quote(trim(concat('    ', 'a')));
+quote(trim(concat('    ', 'a')))
+'a'

--- 1.30/mysql-test/t/func_str.test	Wed Dec 22 21:31:13 2004
+++ 1.31/mysql-test/t/func_str.test	Thu Dec 23 21:08:49 2004
@@ -191,9 +191,5 @@
 # Bug #7495
 #
 
-create table t1 (a varchar(80), b varchar(80));
-insert into t1 values(NULL,"12345");
-insert into t1 values(NULL,"chm");
-select quote(ltrim(concat('  ',t1.b))) from t1;
-select quote(trim(concat('  ',t1.b))) from t1;
-drop table t1;
+select quote(ltrim(concat('    ', 'a')));
+select quote(trim(concat('    ', 'a')));
Thread
bk commit into 4.0 tree (Sinisa:1.2025)sinisa23 Dec