List:Commits« Previous MessageNext Message »
From:Ingo Struewing Date:January 11 2010 5:02pm
Subject:bzr commit into mysql-backup-backport branch (ingo.struewing:3051)
Bug#42685 Bug#42695 WL#5101
View as plain text  
#At file:///home2/mydev/bzrroot/mysql-5.6-backup-backport-ms09-2/ based on revid:ingo.struewing@stripped

 3051 Ingo Struewing	2010-01-11
      WL#5101 - MySQL Backup back port
      Merged revid:charles.bell@stripped
        BUG#42695 : memory leak when setting backupdir
        BUG#42685 : valgrind errors setting backup_progress_log_file
        
        This patch adds code to detect when users attempt to set a path 
        longer than FN_REFLEN. 
        
        For BUG#42695, the patch also frees memory used when a successful 
        update to the backupdir variable is completed.
      
      original changeset: 2599.123.12
     @ mysql-test/suite/backup/r/backup_logs.result
        WL#5101 - MySQL Backup back port
        Updated test result for change in version string length.
     @ sql/set_var.cc
        WL#5101 - MySQL Backup back port
            Added code to ensure users do not attempt to assign a path longer
            than FN_REFLEN.

    modified:
      mysql-test/suite/backup/r/backup_logs.result
      sql/set_var.cc
=== modified file 'mysql-test/suite/backup/r/backup_logs.result'
--- a/mysql-test/suite/backup/r/backup_logs.result	2010-01-06 15:03:50 +0000
+++ b/mysql-test/suite/backup/r/backup_logs.result	2010-01-11 17:02:20 +0000
@@ -244,7 +244,7 @@ log_backup_output	FILE,TABLE
 # Note that the backup image size (total_bytes) changes
 # when the server version string length changes.
 VERSION()
-#.#.##
+#.#.#
 SELECT * FROM mysql.backup_history WHERE backup_id = 500;
 backup_id	#
 process_id	#
@@ -254,7 +254,7 @@ backup_state	complete
 operation	backup
 error_num	0
 num_objects	11
-total_bytes	4227
+total_bytes	4225
 validity_point_time	#
 start_time	#
 stop_time	#
@@ -318,7 +318,7 @@ timediff(now(),@start_restore) > 5
 # Note that the backup image size (total_bytes) changes
 # when the server version string length changes.
 VERSION()
-#.#.##
+#.#.#
 SELECT * FROM mysql.backup_history WHERE backup_id = 501;
 backup_id	#
 process_id	#
@@ -328,7 +328,7 @@ backup_state	complete
 operation	restore
 error_num	0
 num_objects	11
-total_bytes	4227
+total_bytes	4225
 validity_point_time	#
 start_time	#
 stop_time	#

=== modified file 'sql/set_var.cc'
--- a/sql/set_var.cc	2010-01-08 11:35:01 +0000
+++ b/sql/set_var.cc	2010-01-11 17:02:20 +0000
@@ -2602,6 +2602,16 @@ static int  sys_check_log_path(THD *thd,
   if (!(res= var->value->val_str(&str)))
     goto err;
 
+  /*
+    Check maximum string length and error if too long.
+    Do not set the value.
+  */
+  if (res->length() > FN_REFLEN)
+  {
+    my_error(ER_PATH_LENGTH, MYF(0), var->var->name);
+    return 1;
+  }
+
   log_file_str= res->c_ptr();
   bzero(&f_stat, sizeof(MY_STAT));
 


Attachment: [text/bzr-bundle] bzr/ingo.struewing@sun.com-20100111170220-ehaez12rl3cep88c.bundle
Thread
bzr commit into mysql-backup-backport branch (ingo.struewing:3051)Bug#42685 Bug#42695 WL#5101Ingo Struewing11 Jan