/ Check-in [1aaa06e3]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add extra tests to check the result of including a %00 escape in a URI when ENABLE_URI_00_ERROR is defined.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | uri-00-error
Files: files | file ages | folders
SHA1:1aaa06e37f44309c62335d8eda59ca6890d4be9d
User & Date: dan 2016-10-26 13:44:07
Context
2016-10-26
13:58
Merge the SQLITE_ENABLE_URI_00_ERROR compile-time option. check-in: 86675ae0 user: drh tags: trunk
13:44
Add extra tests to check the result of including a %00 escape in a URI when ENABLE_URI_00_ERROR is defined. Closed-Leaf check-in: 1aaa06e3 user: dan tags: uri-00-error
12:15
Add compile time option SQLITE_ENABLE_URI_00_ERROR. If defined, any "%00" escape found in a URI is treated as an error. check-in: e8a9bfec user: dan tags: uri-00-error
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/uri2.test.

    32     32     5 file:test.db?trailing=1&abc%00def
    33     33   } {
    34     34     do_test 1.$tn.1 {
    35     35       set rc [catch { sqlite3 db $uri } msg]
    36     36       list $rc $msg
    37     37     } {1 {unexpected %00 in uri}}
    38     38   
           39  +  do_test 1.$tn.2 {
           40  +    set DB2 [sqlite3_open $uri]
           41  +    sqlite3_errcode $DB2
           42  +  } {SQLITE_ERROR}
           43  +
           44  +  catch { sqlite3_close $DB2 }
           45  +
    39     46     do_test 1.$tn.2 {
    40     47       sqlite3 db ""
    41     48       catchsql { ATTACH $uri AS aux }
    42     49     } {1 {unexpected %00 in uri}}
           50  +
           51  +  do_test 1.$tn.3 {
           52  +    sqlite3_errcode db
           53  +  } {SQLITE_ERROR}
    43     54   
    44     55     catch { db close }
    45     56   }
    46     57   
    47     58   reset_db
    48     59   do_test 2.0 {
    49     60     expr {[lsearch [execsql {PRAGMA compile_options}] ENABLE_URI_00_ERROR] >= 0}
    50     61   } 1
    51     62   
    52     63   finish_test