• Vladislav Vaintroub's avatar
    Bug#39750 -cannot create temp file on Windows. · 0fc3483b
    Vladislav Vaintroub authored
    The problem appears often in conjuction with temp files, when temp-pool is used, so that names of temp files are not unique.
    
    The reason is that rapid deletiion and creation of fiiles with the same name on Windows is not guaranteed to succeed. File disappears from the file system only when the last handle to it is closed. If for example  a virus scanner, a backup or indexing  application  opens the  temp file just before MySQL deletes it, the file will enter "delete pending" state. In this state,it is not possible to open the file , or create a file with the same name (CreateFile returns  ERROR_ACCESS_DENED, posix open returns EACESS)
    
    Fix (rather a cheap workarounf) is not to use temp-pool when working with temporary files- this will make filenames unique. 
    With this patch , temp- pool setting will be ignored on anything but Linux(the option only made sense for Linux since its invention anyway).
    0fc3483b
mysqld.cc 311 KB