Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch uri-enhancement Excluding Merge-Ins
This is equivalent to a diff from 0ad83ceb to c78b0d30
2013-08-07
| ||
23:15 | If the SQLITE_ALLOW_URI_AUTHORITY compile-time option is set, then allow non-localhost authorities on URI filenames and pass them through as a UNC to the underlying VFS. (check-in: 3adb6c1b user: drh tags: trunk) | |
18:42 | Merge latest trunk changes with this branch. (check-in: 08f74c45 user: dan tags: sqlite_stat4) | |
18:07 | Merge in the latest changes from trunk. (Closed-Leaf check-in: c78b0d30 user: drh tags: uri-enhancement) | |
14:18 | Add a guard #ifndef to test_intarray.h to prevent harm if it is #included more than once. Add a comment on the closing #endif of the guards on sqlite3.h and test_multiplex.h. (check-in: 0ad83ceb user: drh tags: trunk) | |
01:18 | Fix typos and add clarification to comments in where.c. No code changes. (check-in: f8d8790e user: drh tags: trunk) | |
2013-07-24
| ||
14:54 | Another attempt at generalizing the URI parsing so that it works with a wider variety of file URIs and yet remains backwards compatible. (check-in: de05eb75 user: drh tags: uri-enhancement) | |
Changes to src/main.c.
︙ | ︙ | |||
2174 2175 2176 2177 2178 2179 2180 | ** method that there may be extra parameters following the file-name. */ flags |= SQLITE_OPEN_URI; for(iIn=0; iIn<nUri; iIn++) nByte += (zUri[iIn]=='&'); zFile = sqlite3_malloc(nByte); if( !zFile ) return SQLITE_NOMEM; | | > > > > > > > > > > > > | < | < < > > > > | < < < | | | 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 | ** method that there may be extra parameters following the file-name. */ flags |= SQLITE_OPEN_URI; for(iIn=0; iIn<nUri; iIn++) nByte += (zUri[iIn]=='&'); zFile = sqlite3_malloc(nByte); if( !zFile ) return SQLITE_NOMEM; /* Mappings: ** URI FILENAME ** --------------------------- ---------------------- ** file:abc/xyz abc/xyz ** file:/abc/xyz /abc/xyz ** file://abc/xyz //abc/xyz ** file:///abc/xyz /abc/xyz ** file:////abc/xyz //abc/xyz ** file://///abc/xyz //abc/xyz ** file://localhost/xyz /xyz ** file:///c:/abc/xyz /c:/abc/xyz (winOpen() removes leading /) */ iIn = 5; if( strncmp(zUri+5, "///", 3)==0 ){ iIn = 7; /* The following condition causes URIs with five leading / characters ** like file://///host/path to be converted into UNCs like //host/path. ** The correct URI for that UNC has only two or four leading / characters ** file://host/path or file:////host/path. But 5 leading slashes is a ** common error, we are told, so we handle it as a special case. */ if( strncmp(zUri+7, "///", 3)==0 ){ iIn++; } }else if( strncmp(zUri+5, "//localhost/", 12)==0 ){ iIn = 16; } /* Copy the filename and any query parameters into the zFile buffer. ** Decode %HH escape codes along the way. ** ** Within this loop, variable eState may be set to 0, 1 or 2, depending ** on the parsing context. As follows: |
︙ | ︙ |
Changes to test/e_uri.test.
︙ | ︙ | |||
129 130 131 132 133 134 135 | # "localhost", an error is returned to the caller. # if {$tcl_platform(platform) == "unix"} { set flags [list SQLITE_OPEN_READWRITE SQLITE_OPEN_CREATE SQLITE_OPEN_URI] foreach {tn uri error} " 1 {file://localhost[test_pwd /]test.db} {not an error} 2 {file://[test_pwd /]test.db} {not an error} | < < | 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | # "localhost", an error is returned to the caller. # if {$tcl_platform(platform) == "unix"} { set flags [list SQLITE_OPEN_READWRITE SQLITE_OPEN_CREATE SQLITE_OPEN_URI] foreach {tn uri error} " 1 {file://localhost[test_pwd /]test.db} {not an error} 2 {file://[test_pwd /]test.db} {not an error} " { do_test 2.$tn { set DB [sqlite3_open_v2 $uri $flags ""] set e [sqlite3_errmsg $DB] sqlite3_close $DB set e } $error |
︙ | ︙ |
Changes to test/uri.test.
︙ | ︙ | |||
277 278 279 280 281 282 283 | # Check that only "" and "localhost" are acceptable as authorities. # catch {db close} foreach {tn uri res} { 1 "file://localhost/PWD/test.db" {not an error} 2 "file:///PWD/test.db" {not an error} 3 "file:/PWD/test.db" {not an error} | < < < | 277 278 279 280 281 282 283 284 285 286 287 288 289 290 | # Check that only "" and "localhost" are acceptable as authorities. # catch {db close} foreach {tn uri res} { 1 "file://localhost/PWD/test.db" {not an error} 2 "file:///PWD/test.db" {not an error} 3 "file:/PWD/test.db" {not an error} } { if {$tcl_platform(platform)=="windows"} { set uri [string map [list PWD [string range [get_pwd] 3 end]] $uri] } else { set uri [string map [list PWD [string range [get_pwd] 1 end]] $uri] } |
︙ | ︙ |