1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Allow the SQLITE_OPEN_EXCLUSIVE flag in sqlite3_open(). Return the

SQLITE_CANTOPEN_EXISTS extended code to indicate that the open failed because
the database already exists.

FossilOrigin-Name: d091150ff80709a1e50e0431aa33021f036979e4a88e9769eeec431dfad6d5f5
This commit is contained in:
drh
2021-06-24 18:23:54 +00:00
parent c06836c3b1
commit dff34ab96f
6 changed files with 22 additions and 12 deletions

View File

@@ -6185,6 +6185,8 @@ static int unixOpen(
/* If unable to create a journal because the directory is not
** writable, change the error code to indicate that. */
rc = SQLITE_READONLY_DIRECTORY;
}else if( errno==EEXIST ){
rc = SQLITE_CANTOPEN_EXISTS;
}else if( errno!=EISDIR && isReadWrite ){
/* Failed to open the file for read/write access. Try read-only. */
flags &= ~(SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE);