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:
None 
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
Description:
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);
        else
#endif
        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

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.047 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.