Skip to content

Commit

Permalink
MDEV-19427 mysql_upgrade_service throws exception upgrading from 10.0…
Browse files Browse the repository at this point in the history
… 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 141bc58, null pointer was passed
instead of valid pointer.

The fix is to provide a valid lpNumberOfBytesWritten parameter.
  • Loading branch information
vaintroub committed May 9, 2019
1 parent 410585c commit d0ee3b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sql/mysql_upgrade_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);\
}

/*
Expand Down

0 comments on commit d0ee3b5

Please sign in to comment.