Bug #81418 MEB may print misleading error messages - my_errno is not updated
Submitted: 13 May 2016 10:00
Reporter: Andrii Nikitin Email Updates:
Status: Verified Impact on me:
Category:MySQL Enterprise Backup Severity:S3 (Non-critical)
Version:3.12.3 OS:Windows
Assigned to: CPU Architecture:Any

[13 May 2016 10:00] Andrii Nikitin
Source code shows that my_errno is not updated when global Windows functions are called, e.g. in io_file.cpp :

#ifdef __WIN__
        if(m_file < MY_FILE_MIN)
        bytes_written = ::write(m_file, (uchar*) buf, per_write);
        bytes_written = my_write(m_file, buf, per_write, MYF(MY_WME));
        LOG_WRITE(MEB_ERROR, "File_write operation failed for file %s. "
            "Error code: %d, %s\n",
            m_file_name, my_errno, strerror(my_errno));

^^ here my_errno will contain incorrect error code if ::write was called.

How to repeat:
May be difficult to repeat - source code review should be performed instead

Suggested fix:
Update my_err if global methods are called.
Additionally - GetLastError() is definitely required in error message