diff options
author | dan <Dan Kennedy> | 2023-04-27 13:55:29 +0000 |
---|---|---|
committer | dan <Dan Kennedy> | 2023-04-27 13:55:29 +0000 |
commit | 2e225a35b4242c36626a88973ee31704992b234e (patch) | |
tree | c4e6c79a79f735afb628e6d4d93edac021f5d858 /src | |
parent | 6a9ba9a8c2fae4c999fd152fb510537b93345df6 (diff) | |
download | sqlite-2e225a35b4242c36626a88973ee31704992b234e.tar.gz sqlite-2e225a35b4242c36626a88973ee31704992b234e.zip |
Fix a problem on windows sometimes causing SQLITE_NOMEM to be returned if an error occurred while opening a temp file.
FossilOrigin-Name: c22a39a6b28e3039fe453c0c0db98744b8a63ef9063cc3f6e0ed67d2506d34be
Diffstat (limited to 'src')
-rw-r--r-- | src/os_win.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/os_win.c b/src/os_win.c index abecf1b93..33275113a 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -5197,7 +5197,7 @@ static int winOpen( if( isReadWrite ){ int rc2, isRO = 0; sqlite3BeginBenignMalloc(); - rc2 = winAccess(pVfs, zName, SQLITE_ACCESS_READ, &isRO); + rc2 = winAccess(pVfs, zUtf8Name, SQLITE_ACCESS_READ, &isRO); sqlite3EndBenignMalloc(); if( rc2==SQLITE_OK && isRO ) break; } @@ -5214,7 +5214,7 @@ static int winOpen( if( isReadWrite ){ int rc2, isRO = 0; sqlite3BeginBenignMalloc(); - rc2 = winAccess(pVfs, zName, SQLITE_ACCESS_READ, &isRO); + rc2 = winAccess(pVfs, zUtf8Name, SQLITE_ACCESS_READ, &isRO); sqlite3EndBenignMalloc(); if( rc2==SQLITE_OK && isRO ) break; } @@ -5234,7 +5234,7 @@ static int winOpen( if( isReadWrite ){ int rc2, isRO = 0; sqlite3BeginBenignMalloc(); - rc2 = winAccess(pVfs, zName, SQLITE_ACCESS_READ, &isRO); + rc2 = winAccess(pVfs, zUtf8Name, SQLITE_ACCESS_READ, &isRO); sqlite3EndBenignMalloc(); if( rc2==SQLITE_OK && isRO ) break; } @@ -5453,6 +5453,11 @@ static int winAccess( void *zConverted; UNUSED_PARAMETER(pVfs); + if( zFilename==0 ){ + *pResOut = 0; + return SQLITE_OK; + } + SimulateIOError( return SQLITE_IOERR_ACCESS; ); OSTRACE(("ACCESS name=%s, flags=%x, pResOut=%p\n", zFilename, flags, pResOut)); |