From d0ee3b5500cdaf3382fc8f26c883f45d8f4bdf5b Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Thu, 9 May 2019 16:55:08 +0200 Subject: MDEV-19427 mysql_upgrade_service throws exception upgrading from 10.0 to 10.3 The crash happens when writing into log file. The reason is likely that the call to WriteFile() was missing a valid parameter for lpNumberOfBytesWritten. This seems only to happen on ancient version of Windows. Since the fix to MDEV-16430 in 141bc58ac992, null pointer was passed instead of valid pointer. The fix is to provide a valid lpNumberOfBytesWritten parameter. --- sql/mysql_upgrade_service.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql/mysql_upgrade_service.cc') diff --git a/sql/mysql_upgrade_service.cc b/sql/mysql_upgrade_service.cc index 9bb60809205..ef01afe899d 100644 --- a/sql/mysql_upgrade_service.cc +++ b/sql/mysql_upgrade_service.cc @@ -148,8 +148,9 @@ static void die(const char *fmt, ...) #define WRITE_LOG(fmt,...) {\ char log_buf[1024]; \ + DWORD nbytes; \ snprintf(log_buf,sizeof(log_buf), fmt, __VA_ARGS__);\ - WriteFile(logfile_handle,log_buf, strlen(log_buf), 0 , 0);\ + WriteFile(logfile_handle,log_buf, strlen(log_buf), &nbytes , 0);\ } /* -- cgit v1.2.1