List:Commits« Previous MessageNext Message »
From:Tatiana A. Nurnberg Date:April 7 2009 11:44am
Subject:bzr commit into mysql-5.1-bugteam branch (azundris:2857) Bug#43884
View as plain text  
#At file:///misc/mysql/forest/43884/51-43884/ based on revid:serge.kozlov@stripped

 2857 Tatiana A. Nurnberg	2009-04-07
      Bug#43884: SP + filename param as TEXT + LOAD_FILE inside, causes valgrind warnings in PB
      
      We were trying to \0 terminate a string literal.
      valgrind rightfully didn't like that.
      
      We now reallocate as needed before appending
      characters.
     @ mysql-test/suite/rpl/r/rpl_loadfile.result
        Revert hotfix for this test
        now that the source has been
        amended.
     @ mysql-test/suite/rpl/t/rpl_loadfile.test
        Revert hotfix for this test
        now that the source has been
        amended.
     @ sql/item_strfunc.cc
        Re-alloc as needed when appending a \0.

    modified:
      mysql-test/suite/rpl/r/rpl_loadfile.result
      mysql-test/suite/rpl/t/rpl_loadfile.test
      sql/item_strfunc.cc
=== modified file 'mysql-test/suite/rpl/r/rpl_loadfile.result'
--- a/mysql-test/suite/rpl/r/rpl_loadfile.result	2009-03-27 10:59:31 +0000
+++ b/mysql-test/suite/rpl/r/rpl_loadfile.result	2009-04-07 11:44:38 +0000
@@ -232,8 +232,8 @@ RESET MASTER;
 include/start_slave.inc
 SELECT repeat('x',20) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_39701.data';
 DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (t text);
-CREATE PROCEDURE p(file varchar(4096)) 
+CREATE TABLE t1 (t TEXT);
+CREATE PROCEDURE p(file TEXT)
 BEGIN
 INSERT INTO t1 VALUES (LOAD_FILE(file));
 END|

=== modified file 'mysql-test/suite/rpl/t/rpl_loadfile.test'
--- a/mysql-test/suite/rpl/t/rpl_loadfile.test	2009-03-27 10:59:31 +0000
+++ b/mysql-test/suite/rpl/t/rpl_loadfile.test	2009-04-07 11:44:38 +0000
@@ -71,9 +71,9 @@ disable_warnings;
 DROP TABLE IF EXISTS t1;
 enable_warnings;
 
-CREATE TABLE t1 (t text);
+CREATE TABLE t1 (t TEXT);
 DELIMITER |;
-CREATE PROCEDURE p(file varchar(4096)) 
+CREATE PROCEDURE p(file TEXT)
   BEGIN
     INSERT INTO t1 VALUES (LOAD_FILE(file));
   END|

=== modified file 'sql/item_strfunc.cc'
--- a/sql/item_strfunc.cc	2009-03-24 13:58:52 +0000
+++ b/sql/item_strfunc.cc	2009-04-07 11:44:38 +0000
@@ -2939,7 +2939,7 @@ String *Item_load_file::val_str(String *
       )
     goto err;
 
-  (void) fn_format(path, file_name->c_ptr(), mysql_real_data_home, "",
+  (void) fn_format(path, file_name->c_ptr_safe(), mysql_real_data_home, "",
 		   MY_RELATIVE_PATH | MY_UNPACK_FILENAME);
 
   /* Read only allowed from within dir specified by secure_file_priv */


Attachment: [text/bzr-bundle] bzr/azundris@mysql.com-20090407114438-xwyd8uh74sp46fli.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (azundris:2857) Bug#43884Tatiana A. Nurnberg7 Apr
  • Re: bzr commit into mysql-5.1-bugteam branch (azundris:2857) Bug#43884Davi Arnaut9 Apr