mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into zippy.cornsilk.net:/home/cmiller/work/mysql/m50-maint-b21224 client/mysql_upgrade.c: Auto merged
This commit is contained in:
@@ -157,17 +157,29 @@ static int create_defaults_file(const char *path, const char *our_defaults_path)
|
|||||||
File our_defaults_file, defaults_file;
|
File our_defaults_file, defaults_file;
|
||||||
char buffer[512];
|
char buffer[512];
|
||||||
char *buffer_end;
|
char *buffer_end;
|
||||||
|
int failed_to_open_count= 0;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
/* check if the defaults file is needed at all */
|
/* check if the defaults file is needed at all */
|
||||||
if (!opt_password)
|
if (!opt_password)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
defaults_file= my_open(path, O_BINARY | O_CREAT | O_WRONLY,
|
retry_open:
|
||||||
|
defaults_file= my_open(path, O_BINARY | O_CREAT | O_WRONLY | O_EXCL,
|
||||||
MYF(MY_FAE | MY_WME));
|
MYF(MY_FAE | MY_WME));
|
||||||
|
|
||||||
if (defaults_file < 0)
|
if (defaults_file < 0)
|
||||||
|
{
|
||||||
|
if (failed_to_open_count == 0)
|
||||||
|
{
|
||||||
|
remove(path);
|
||||||
|
failed_to_open_count+= 1;
|
||||||
|
goto retry_open;
|
||||||
|
}
|
||||||
|
else
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
upgrade_defaults_created= 1;
|
upgrade_defaults_created= 1;
|
||||||
if (our_defaults_path)
|
if (our_defaults_path)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user