summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2019-05-09 16:55:08 +0200
committerVladislav Vaintroub <wlad@mariadb.com>2019-05-09 16:55:55 +0200
commit3d5149b8bb4e50ef82629c381a61356429eedc46 (patch)
tree6ec0c60baa8894345be251dc19b561ed5f01e2db
parent828cc2ba7cdbe47c55fd679437e6e7f0bc714dff (diff)
downloadmariadb-git-3d5149b8bb4e50ef82629c381a61356429eedc46.tar.gz
MDEV-19427 mysql_upgrade_service throws exception upgrading from 10.0 to 10.3bb-10.0-wlad
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.
-rw-r--r--sql/mysql_upgrade_service.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/mysql_upgrade_service.cc b/sql/mysql_upgrade_service.cc
index 809161193a5..4cb5a2a3740 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);\
}
/*