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 17:41:37 +0200
commitd0ee3b5500cdaf3382fc8f26c883f45d8f4bdf5b (patch)
tree954b02c47f415e113513831044efd28106208b1f
parent410585ca639dc6b40b56d8ec2b7857a9ca6b46f1 (diff)
downloadmariadb-git-d0ee3b5500cdaf3382fc8f26c883f45d8f4bdf5b.tar.gz
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.
-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 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);\
}
/*