#At file:///localhome/jl208045/mysql/mysql-6.0-backup-39224/
2692 Jorgen Loland 2008-09-05
Bug#39189 - Backup: backup_backupdir.test fails in pushbuild
Old behavior: When giving hard path to backup command, a '/' was
appended at the end of the path (i.e., after the filename).
This was because the whole path was converted to fit the system.
In addition, convert_dirname crashed on some but not all
platforms when length was not specified.
New behavior: Only the directory name is converted to system. The
filename is then appended without conversion. Conversion is
done with explicit path length
modified:
sql/backup/stream.cc
per-file comments:
sql/backup/stream.cc
In Stream::prepare_path - Do not convert filename when converting a full path to fit system, and use explicit path length when calling convert_dirname
=== modified file 'sql/backup/stream.cc'
--- a/sql/backup/stream.cc 2008-09-02 09:04:39 +0000
+++ b/sql/backup/stream.cc 2008-09-05 12:51:08 +0000
@@ -371,11 +371,17 @@ int Stream::prepare_path(::String *backu
'/dev/dec.bak'
*/
path_len= orig_loc.length + 1;
+ int dn_length= dirname_length(orig_loc.str);
+
m_path.alloc(path_len);
m_path.length(0);
- m_path.append(orig_loc.str);
+ m_path.append(orig_loc.str, dn_length); // Append directory-part only
+
// Convert directory name to fit this system
- convert_dirname(m_path.c_ptr(), orig_loc.str, NullS);
+ convert_dirname(m_path.c_ptr(), m_path.c_ptr(), m_path.c_ptr() + dn_length);
+
+ // Append filename now that directory name has been converted
+ m_path.append(orig_loc.str + dn_length);
}
m_path.length(path_len);
return 0;