diff options
author | stephan <stephan@noemail.net> | 2022-09-06 09:59:06 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2022-09-06 09:59:06 +0000 |
commit | ae1ed83831d9cb6026a15d30d43a309bf3fd758f (patch) | |
tree | a8a255cd018524d40505172732ae7f0a8a92f930 /src/pragma.c | |
parent | 49cb8d7314f201bcc264ab3c38c01ae48822a7a4 (diff) | |
parent | 2e440a0801ad366d48532890b506853c0e34030e (diff) | |
download | sqlite-ae1ed83831d9cb6026a15d30d43a309bf3fd758f.tar.gz sqlite-ae1ed83831d9cb6026a15d30d43a309bf3fd758f.zip |
Merge trunk into fiddle-opfs branch.
FossilOrigin-Name: 7f76eaec793720db87415a476ddf539bc4dea3e74c8e5406d6739206aebdacc2
Diffstat (limited to 'src/pragma.c')
-rw-r--r-- | src/pragma.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pragma.c b/src/pragma.c index 2dd792f27..9d46a10dc 100644 --- a/src/pragma.c +++ b/src/pragma.c @@ -965,6 +965,7 @@ void sqlite3Pragma( ** */ case PragTyp_TEMP_STORE_DIRECTORY: { + sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); if( !zRight ){ returnSingleText(v, sqlite3_temp_directory); }else{ @@ -974,6 +975,7 @@ void sqlite3Pragma( rc = sqlite3OsAccess(db->pVfs, zRight, SQLITE_ACCESS_READWRITE, &res); if( rc!=SQLITE_OK || res==0 ){ sqlite3ErrorMsg(pParse, "not a writable directory"); + sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); goto pragma_out; } } @@ -991,6 +993,7 @@ void sqlite3Pragma( } #endif /* SQLITE_OMIT_WSD */ } + sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); break; } @@ -1009,6 +1012,7 @@ void sqlite3Pragma( ** */ case PragTyp_DATA_STORE_DIRECTORY: { + sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); if( !zRight ){ returnSingleText(v, sqlite3_data_directory); }else{ @@ -1018,6 +1022,7 @@ void sqlite3Pragma( rc = sqlite3OsAccess(db->pVfs, zRight, SQLITE_ACCESS_READWRITE, &res); if( rc!=SQLITE_OK || res==0 ){ sqlite3ErrorMsg(pParse, "not a writable directory"); + sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); goto pragma_out; } } @@ -1029,6 +1034,7 @@ void sqlite3Pragma( } #endif /* SQLITE_OMIT_WSD */ } + sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_TEMPDIR)); break; } #endif |