]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix a problem in the URI code preventing the amalgamation from building. Add comments...
authordan <dan@noemail.net>
Thu, 5 May 2011 12:35:33 +0000 (12:35 +0000)
committerdan <dan@noemail.net>
Thu, 5 May 2011 12:35:33 +0000 (12:35 +0000)
FossilOrigin-Name: ea562d6d67c2f2ef8baca02a77634c21b945196f

manifest
manifest.uuid
src/sqlite.h.in
src/sqliteInt.h

index 0ff82c27c9e99185b9bd8a9b336c6719644852e9..32e0f8fc68f4c060a9ef380513a36c1d5c1483a1 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Merge\slatest\strunk\schanges\swith\suri\sbranch.
-D 2011-05-04T17:35:12.663
+C Fix\sa\sproblem\sin\sthe\sURI\scode\spreventing\sthe\samalgamation\sfrom\sbuilding.\sAdd\scomments\sdescribing\sSQLITE_CONFIG_URI\sand\sSQLITE_OPEN_URI\sto\ssqlite.h.in.
+D 2011-05-05T12:35:33.316
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 7a4d9524721d40ef9ee26f93f9bd6a51dba106f2
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -179,9 +179,9 @@ F src/resolve.c 1c0f32b64f8e3f555fe1f732f9d6f501a7f05706
 F src/rowset.c 69afa95a97c524ba6faf3805e717b5b7ae85a697
 F src/select.c d9d440809025a58547e39f4f268c2a296bfb56ff
 F src/shell.c 72e7e176bf46d5c6518d15ac4ad6847c4bb5df79
-F src/sqlite.h.in 90b126a4e8515126799e6e2b7f5ba962283e38bd
+F src/sqlite.h.in f865bde9a0af4cd77b85265df71a9d760e5def18
 F src/sqlite3ext.h c90bd5507099f62043832d73f6425d8d5c5da754
-F src/sqliteInt.h d1794da98180a15974a5539eec5410187371adda
+F src/sqliteInt.h 5a7bf51f767fb67b484f09d73cccff683731af22
 F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d
 F src/status.c 7ac64842c86cec2fc1a1d0e5c16d3beb8ad332bf
 F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e
@@ -934,7 +934,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 008cd0ef6b504cf4549468f795aa46f8472f0130 8f9666af5f9459cbd0305a86281d745ea6163acf
-R 07deaa464fe0e27da6566a9a8b8c931b
+P af279f367e01732560b8b2b6aeb5ede4f04415dd
+R b650932bbc0e364498f81d36888b653d
 U dan
-Z 357fb32ea4341029d4a78088d4acc043
+Z 505d1fe8270a91e9ebfb3524cd8d9a43
index 4ff58741bcc1505920b8d566bd4fc29612a5bb6f..9a80005ad084a9b9005b0f4b0fed3ef7fd43b8c3 100644 (file)
@@ -1 +1 @@
-af279f367e01732560b8b2b6aeb5ede4f04415dd
\ No newline at end of file
+ea562d6d67c2f2ef8baca02a77634c21b945196f
\ No newline at end of file
index 50c9e1f5942d4ab7ef14f8fd8b5375d4302ccab2..d394d6c819339960ebbbf9f8acc8fb924ead6cc5 100644 (file)
@@ -1427,6 +1427,18 @@ struct sqlite3_mem_methods {
 ** In a multi-threaded application, the application-defined logger
 ** function must be threadsafe. </dd>
 **
+** <dt>SQLITE_CONFIG_URI
+** <dd> This option takes a single argument of type int. If non-zero, then
+** URI handling is globally enabled. If the parameter is zero, then URI handling
+** is globally disabled. If URI handling is globally enabled, all filenames
+** passed to [sqlite3_open()], [sqlite3_open_v2()], [sqlite3_open16()] or
+** specified as part of [ATTACH] commands are interpreted as URIs, regardless
+** of whether or not the [SQLITE_OPEN_URI] flag is set when the database
+** connection is opened. If it is globally disabled, filenames are
+** only interpreted as URIs if the SQLITE_OPEN_URI flag is set when the
+** database connection is opened. By default, URI handling is globally
+** disabled. The default value may be changed by compiling with the
+** [SQLITE_USE_URI] symbol defined.
 ** </dl>
 */
 #define SQLITE_CONFIG_SINGLETHREAD  1  /* nil */
@@ -2322,7 +2334,7 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
 /*
 ** CAPI3REF: Opening A New Database Connection
 **
-** ^These routines open an SQLite database file whose name is given by the
+** ^These routines open an SQLite database file as specified by the 
 ** filename argument. ^The filename argument is interpreted as UTF-8 for
 ** sqlite3_open() and sqlite3_open_v2() and as UTF-16 in the native byte
 ** order for sqlite3_open16(). ^(A [database connection] handle is usually
@@ -2385,6 +2397,11 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
 ** [SQLITE_OPEN_PRIVATECACHE] flag causes the database connection to not
 ** participate in [shared cache mode] even if it is enabled.
 **
+** ^The fourth parameter to sqlite3_open_v2() is the name of the
+** [sqlite3_vfs] object that defines the operating system interface that
+** the new database connection should use.  ^If the fourth parameter is
+** a NULL pointer then the default [sqlite3_vfs] object is used.
+**
 ** ^If the filename is ":memory:", then a private, temporary in-memory database
 ** is created for the connection.  ^This in-memory database will vanish when
 ** the database connection is closed.  Future versions of SQLite might
@@ -2397,10 +2414,102 @@ void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
 ** on-disk database will be created.  ^This private database will be
 ** automatically deleted as soon as the database connection is closed.
 **
-** ^The fourth parameter to sqlite3_open_v2() is the name of the
-** [sqlite3_vfs] object that defines the operating system interface that
-** the new database connection should use.  ^If the fourth parameter is
-** a NULL pointer then the default [sqlite3_vfs] object is used.
+** ^If URI filename interpretation is enabled, and the filename argument
+** begins with "file:", then the filename is interpreted as a URI. ^URI
+** filename interpretation is enabled if the [SQLITE_OPEN_URI] flag is
+** is set in the fourth argument to sqlite3_open_v2(), or if it has
+** been enabled globally using the [SQLITE_CONFIG_URI] option with the
+** [sqlite3_config()] method. 
+**
+** URI filenames are parsed according to RFC 1738. If the URI contains an
+** 'authority', then it must be either an empty string or the string 
+** "localhost". ^If the authority is not an empty string or "localhost", an 
+** error is returned to the caller. ^The 'fragment' component of a URI, if 
+** present, is always ignored.
+**
+** ^SQLite uses the 'path' component of the URI as the path to the database file
+** to open. ^If the path begins with a '/' character, then it is interpreted as
+** an absolute path. ^If it does not begin with a '/', it is interpreted as a 
+** relative path. ^On windows, if the first component of an absolute path is 
+** of the form "X:", where "X" is any alphabetic character, it is interpreted 
+** as a drive specification. ^Otherwise, the absolute path is interpreted as
+** the full pathname of a file on the current drive.
+**
+** The query component of a URI may contain parameters that are interpreted
+** either by SQLite itself, or by a [sqlite3_vfs | custom VFS implementation].
+** SQLite interprets the following three query parameters:
+**
+** <ul>
+**   <li> <b>vfs</b>: ^The "vfs" parameter may be used to specify the name of
+**     a VFS object that provides the operating system interface that should
+**     be used to access the database file on disk. ^If this option is set to
+**     an empty string the default VFS object is used. ^Specifying an unknown
+**     VFS is an error.
+**
+**   <li> <b>mode</b>: ^(This option may be set to either "ro", "rw" or "rwc".
+**     Attempting to set it to any other value is an error)^. ^If "ro" is
+**     specified, then the database is opened for read-only access, just as if
+**     the [SQLITE_OPEN_READONLY] flag had been set in the third argument to
+**     sqlite3_prepare_v2(). ^If the mode option is set to "rw", then the
+**     database is opened for read-write (but not create) access, as if
+**     SQLITE_OPEN_READWRITE (but not SQLITE_OPEN_CREATE) had been set.
+**     ^Value "rwc" is equivalent to setting both SQLITE_OPEN_READWRITE and
+**     SQLITE_OPEN_CREATE.
+**     ^If sqlite3_open_v2() is used, it is an error to specify a value for
+**     the mode parameter that is less restrictive than that specified by the
+**     flags passed as the third parameter.
+**
+**   <li> <b>cache</b>: ^The cache parameter may be set to either "shared" or
+**     "private". ^Setting it to "shared" is equivalent to setting the
+**     SQLITE_OPEN_SHAREDCACHE bit in the flags argument passed to
+**     sqlite3_open_v2(). ^Setting the cache parameter to "private" is 
+**     equivalent to setting the SQLITE_OPEN_PRIVATECACHE bit.
+**     ^If sqlite3_open_v2() is used and the "cache" parameter is present in
+**     a URI filename, its value overrides any behaviour requested by setting
+**     SQLITE_OPEN_PRIVATECACHE or SQLITE_OPEN_SHAREDCACHE flag.
+** </ul>
+**
+** ^Specifying an unknown parameter in the query component of a URI is not an
+** error.
+**
+** URI filename examples:
+**
+** <table border="1" align=center cellpadding=5>
+** <tr><th> URI filenames <th> Results
+** <tr><td> file:data.db <td> 
+**          Open the file "data.db" in the current directory.
+** <tr><td> file:/home/fred/data.db<br>
+**          file:///home/fred/data.db <br> 
+**          file://localhost/home/fred/data.db <br> <td> 
+**          Open the database file "/home/fred/data.db".
+** <tr><td> file://darkstar/home/fred/data.db <td> 
+**          An error. "darkstar" is not a recognized authority.
+** <tr><td style="white-space:nowrap"> 
+**          file:///C:/Documents%20and%20Settings/fred/Desktop/data.db
+**     <td> Windows only: Open the file "data.db" on fred's desktop on drive
+**          C:. If the "C:/" component were omitted from this URI, then the
+**          file "\Documents and Settings\fred\Desktop\data.db" would be opened
+**          on the current drive. Note that the %20 escaping in this example
+**          is not strictly necessary - space characters can be used literally
+**          in URI filenames.
+** <tr><td> file:data.db?mode=ro&cache=private <td> 
+**          Open file "data.db" in the current directory for read-only access.
+**          Regardless of whether or not shared-cache mode is enabled by
+**          default, use a private cache.
+** <tr><td> file:/home/fred/data.db?vfs=unix-nolock <td>
+**          Open file "/home/fred/data.db". Use the special VFS "unix-nolock".
+** <tr><td> file:data.db?mode=readonly <td> 
+**          An error. "readonly" is not a valid option for the "mode" parameter.
+** </table>
+**
+** ^URI hexadecimal escape sequences (%HH) are supported within the path and
+** query components of a URI. A hexadecimal escape sequence consists of a
+** percent sign - "%" - followed by exactly two hexadecimal digits 
+** specifying an octet value. ^Before the path or query components of a
+** URI filename are interpreted, they are encoded using UTF-8 and all 
+** hexadecimal escape sequences replaced by a single byte containing the
+** corresponding octet. If this process generates an invalid UTF-8 encoding,
+** the results are undefined.
 **
 ** <b>Note to Windows users:</b>  The encoding used for the filename argument
 ** of sqlite3_open() and sqlite3_open_v2() must be UTF-8, not whatever
index f5608c9ef16745c77ebd077b1e3468a64f84235d..8e18b0f39932558c15580a5a65e5942c312dba5f 100644 (file)
@@ -2674,6 +2674,7 @@ void sqlite3AddColumnType(Parse*,Token*);
 void sqlite3AddDefaultValue(Parse*,ExprSpan*);
 void sqlite3AddCollateType(Parse*, Token*);
 void sqlite3EndTable(Parse*,Token*,Token*,Select*);
+int sqlite3ParseUri(const char*,const char*,int*,sqlite3_vfs**,char**,char **);
 
 Bitvec *sqlite3BitvecCreate(u32);
 int sqlite3BitvecTest(Bitvec*, u32);