1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-12-04 20:02:48 +03:00

Rearchitect the way in which filenames are stored in the Pager object so that

the sqlite3_uri_parameter() interface will work from journal and WAL filenames
too.  This check-in implements the central idea, and compile and runs somewhat,
but crashes on an extended test.

FossilOrigin-Name: 2ae77bd2335708343bce4541b4d2cf16edfe3fd5bc2dfb93757238c926aa960b
This commit is contained in:
drh
2020-01-10 18:05:55 +00:00
parent b2fe5a7c35
commit 8875b9e7b5
7 changed files with 179 additions and 55 deletions

View File

@@ -3536,6 +3536,33 @@ const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam);
int sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
sqlite3_int64 sqlite3_uri_int64(const char*, const char*, sqlite3_int64);
/*
** CAPI3REF: Translate filenames
**
** These routines are available to VFS implementations for translating
** filenames between the main database file, the journal file, and the
** WAL file.
**
** If F is the name of an sqlite database file, journal file, or WAL file
** then sqlite3_filename_database(F) returns the name of the corresponding
** database file.
**
** If F is the name of an sqlite database file, journal file, or WAL file
** then sqlite3_filename_journal(F) returns the name of the corresponding
** rollback journal file.
**
** If F is the name of an sqlite database file, journal file, or WAL file
** then sqlite3_filename_wal(F) returns the name of the corresponding
** WAL file.
**
** In all of the above, if F is not the name of a database, journal or WAL
** filename passed into the VFS from the SQLite core, then the result is
** undefined and is likely a memory access violation.
*/
const char *sqlite3_filename_database(const char*);
const char *sqlite3_filename_journal(const char*);
const char *sqlite3_filename_wal(const char*);
/*
** CAPI3REF: Error Codes And Messages