On Windows my_rename() deletes the target file before renaming. But if the source file does not exist, it means that a target file was deleted erroneously.
It particular, this is a problem for handler::rename_table() that renames all files from handler::bas_ext(). It assumes that the table was renamed successfully if at least some files existed and were renamed. On Windows it would delete all other target files though.
Possible fixes:
verify that the source file exists in my_rename() — unnecessary overhead?
verify that the source file exists in handler::rename_table()
add a special MYF flag to my_rename() that tells to verify whether the source exists before deleting; use this flag in handler::rename_table()
On {{my_rename()}} deletes the target file before renaming. But if the source file does not exist, it means that a target file was deleted erroneously.
It particular, this is a problem for {{handler::rename_table()}} that renames all files from {{handler::bas_ext()}}}. It assumes the rename was successful if at least some files existed and were renamed. On Windows it would delete all other target files though.
Possible fixes:
* verify that the source file exists in {{my_rename()}} — unnecessary overhead?
* verify that the source file exists in {{handler::rename_table()}}
* add a special {{MYF}} flag to {{my_rename()}} that tells to verify whether the source exists before deleting; use this flag in {{handler::rename_table()}}
On Windows {{my_rename()}} deletes the target file before renaming. But if the source file does not exist, it means that a target file was deleted erroneously.
It particular, this is a problem for {{handler::rename_table()}} that renames all files from {{handler::bas_ext()}}}. It assumes the rename was successful if at least some files existed and were renamed. On Windows it would delete all other target files though.
Possible fixes:
* verify that the source file exists in {{my_rename()}} — unnecessary overhead?
* verify that the source file exists in {{handler::rename_table()}}
* add a special {{MYF}} flag to {{my_rename()}} that tells to verify whether the source exists before deleting; use this flag in {{handler::rename_table()}}
On Windows {{my_rename()}} deletes the target file before renaming. But if the source file does not exist, it means that a target file was deleted erroneously.
It particular, this is a problem for {{handler::rename_table()}} that renames all files from {{handler::bas_ext()}}}. It assumes the rename was successful if at least some files existed and were renamed. On Windows it would delete all other target files though.
Possible fixes:
* verify that the source file exists in {{my_rename()}} — unnecessary overhead?
* verify that the source file exists in {{handler::rename_table()}}
* add a special {{MYF}} flag to {{my_rename()}} that tells to verify whether the source exists before deleting; use this flag in {{handler::rename_table()}}
On Windows {{my_rename()}} deletes the target file before renaming. But if the source file does not exist, it means that a target file was deleted erroneously.
It particular, this is a problem for {{handler::rename_table()}} that renames all files from {{handler::bas_ext()}}. It assumes that the table was renamed successfully if at least some files existed and were renamed. On Windows it would delete all other target files though.
Possible fixes:
* verify that the source file exists in {{my_rename()}} — unnecessary overhead?
* verify that the source file exists in {{handler::rename_table()}}
* add a special {{MYF}} flag to {{my_rename()}} that tells to verify whether the source exists before deleting; use this flag in {{handler::rename_table()}}
What's the point for handler::rename_table() not to remove all target files? We'll get a mix of old and new files in this case, which may or may not be desired.
OTOH I agree that my_rename() should be more consistent.
Sergey Vojtovich
added a comment - What's the point for handler::rename_table() not to remove all target files? We'll get a mix of old and new files in this case, which may or may not be desired.
OTOH I agree that my_rename() should be more consistent.
What's the point for handler::rename_table() not to remove all target files? We'll get a mix of old and new files in this case, which may or may not be desired.
OTOH I agree that my_rename() should be more consistent.