Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Rename the sqlite_compile_option_*() SQL functions to sqlite_compileoption_*() for consistency with the C/C++ interface. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
dd4962aa34c4dd118d2cb15465384636 |
User & Date: | drh 2010-02-26 16:37:48.000 |
Context
2010-03-02
| ||
23:34 | When TEMP files are in memory, also put the massive TEMP file used by the VACUUM command in memory. (check-in: 9daf4e7d07 user: drh tags: trunk) | |
2010-02-26
| ||
16:37 | Rename the sqlite_compile_option_*() SQL functions to sqlite_compileoption_*() for consistency with the C/C++ interface. (check-in: dd4962aa34 user: drh tags: trunk) | |
15:39 | Remove the compile_option pragma (retaining compile_options - with an "s"). Updates to documentation. (check-in: 733778df99 user: drh tags: trunk) | |
Changes
Changes to src/func.c.
︙ | ︙ | |||
1545 1546 1547 1548 1549 1550 1551 | {2,SQLITE_UTF8,SQLITE_FUNC_COALESCE,0,0,ifnullFunc,0,0,"ifnull",0}, FUNCTION(random, 0, 0, 0, randomFunc ), FUNCTION(randomblob, 1, 0, 0, randomBlob ), FUNCTION(nullif, 2, 0, 1, nullifFunc ), FUNCTION(sqlite_version, 0, 0, 0, versionFunc ), FUNCTION(sqlite_source_id, 0, 0, 0, sourceidFunc ), #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS | | | | 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 | {2,SQLITE_UTF8,SQLITE_FUNC_COALESCE,0,0,ifnullFunc,0,0,"ifnull",0}, FUNCTION(random, 0, 0, 0, randomFunc ), FUNCTION(randomblob, 1, 0, 0, randomBlob ), FUNCTION(nullif, 2, 0, 1, nullifFunc ), FUNCTION(sqlite_version, 0, 0, 0, versionFunc ), FUNCTION(sqlite_source_id, 0, 0, 0, sourceidFunc ), #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS FUNCTION(sqlite_compileoption_used,1, 0, 0, compileoptionusedFunc ), FUNCTION(sqlite_compileoption_get, 1, 0, 0, compileoptiongetFunc ), #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */ FUNCTION(quote, 1, 0, 0, quoteFunc ), FUNCTION(last_insert_rowid, 0, 0, 0, last_insert_rowid), FUNCTION(changes, 0, 0, 0, changes ), FUNCTION(total_changes, 0, 0, 0, total_changes ), FUNCTION(replace, 3, 0, 0, replaceFunc ), FUNCTION(zeroblob, 1, 0, 0, zeroblobFunc ), |
︙ | ︙ |
Changes to test/ctime.test.
︙ | ︙ | |||
57 58 59 60 61 62 63 | do_test ctime-1.2.2 { set ans [ catchsql { PRAGMA compile_options; } ] list [ lindex $ans 0 ] [ expr { [lsort [lindex $ans 1]]==[lindex $ans 1] } ] } {0 1} | < < < < < < < < < < < < < < < < < < < < < | | | < < < < < < < < < < | | | | | | | | | | | | | | | | | | | | | | | | | | | 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | do_test ctime-1.2.2 { set ans [ catchsql { PRAGMA compile_options; } ] list [ lindex $ans 0 ] [ expr { [lsort [lindex $ans 1]]==[lindex $ans 1] } ] } {0 1} # SQLITE_THREADSAFE should pretty much always be defined # one way or the other, and it must have a value of 0 or 1. do_test ctime-1.4.1 { catchsql { SELECT sqlite_compileoption_used('SQLITE_THREADSAFE'); } } {0 1} do_test ctime-1.4.2 { catchsql { SELECT sqlite_compileoption_used('THREADSAFE'); } } {0 1} do_test ctime-1.4.3 { catchsql { SELECT sqlite_compileoption_used("THREADSAFE"); } } {0 1} do_test ctime-1.5 { set ans1 [ catchsql { SELECT sqlite_compileoption_used('THREADSAFE=0'); } ] set ans2 [ catchsql { SELECT sqlite_compileoption_used('THREADSAFE=1'); } ] lsort [ list $ans1 $ans2 ] } {{0 0} {0 1}} do_test ctime-1.6 { execsql { SELECT sqlite_compileoption_used('THREADSAFE='); } } {0} do_test ctime-1.7.1 { execsql { SELECT sqlite_compileoption_used('SQLITE_OMIT_COMPILEOPTION_DIAGS'); } } {0} do_test ctime-1.7.2 { execsql { SELECT sqlite_compileoption_used('OMIT_COMPILEOPTION_DIAGS'); } } {0} ##################### # ctime-2.*: Test function support. do_test ctime-2.1.1 { catchsql { SELECT sqlite_compileoption_used(); } } {1 {wrong number of arguments to function sqlite_compileoption_used()}} do_test ctime-2.1.2 { catchsql { SELECT sqlite_compileoption_used(NULL); } } {0 {{}}} do_test ctime-2.1.3 { catchsql { SELECT sqlite_compileoption_used(""); } } {0 0} do_test ctime-2.1.4 { catchsql { SELECT sqlite_compileoption_used(''); } } {0 0} do_test ctime-2.1.5 { catchsql { SELECT sqlite_compileoption_used(foo); } } {1 {no such column: foo}} do_test ctime-2.1.6 { catchsql { SELECT sqlite_compileoption_used('THREADSAFE', 0); } } {1 {wrong number of arguments to function sqlite_compileoption_used()}} do_test ctime-2.1.7 { catchsql { SELECT sqlite_compileoption_used(0); } } {0 0} do_test ctime-2.1.8 { catchsql { SELECT sqlite_compileoption_used('0'); } } {0 0} do_test ctime-2.1.9 { catchsql { SELECT sqlite_compileoption_used(1.0); } } {0 0} do_test ctime-2.2.1 { catchsql { SELECT sqlite_compileoption_get(); } } {1 {wrong number of arguments to function sqlite_compileoption_get()}} do_test ctime-2.2.2 { catchsql { SELECT sqlite_compileoption_get(0, 0); } } {1 {wrong number of arguments to function sqlite_compileoption_get()}} # This assumes there is at least 1 compile time option # (see SQLITE_THREADSAFE above). do_test ctime-2.3 { catchsql { SELECT sqlite_compileoption_used(sqlite_compileoption_get(0)); } } {0 1} # This assumes there is at least 1 compile time option # (see SQLITE_THREADSAFE above). do_test ctime-2.4 { set ans [ catchsql { SELECT sqlite_compileoption_get(0); } ] list [lindex $ans 0] } {0} # Get the list of defines using the pragma, # then try querying each one with the functions. set ans [ catchsql { PRAGMA compile_options; } ] set opts [ lindex $ans 1 ] set tc 1 foreach opt $opts { do_test ctime-2.5.$tc { set N [ expr {$tc-1} ] set ans1 [ catchsql { SELECT sqlite_compileoption_get($N); } ] set ans2 [ catchsql { SELECT sqlite_compileoption_used($opt); } ] list [ lindex $ans1 0 ] [ expr { [lindex $ans1 1]==$opt } ] \ [ expr { $ans2 } ] } {0 1 {0 1}} incr tc 1 } # test 1 past array bounds do_test ctime-2.5.$tc { set N [ expr {$tc-1} ] set ans [ catchsql { SELECT sqlite_compileoption_get($N); } ] } {0 {{}}} incr tc 1 # test 1 before array bounds (N=-1) do_test ctime-2.5.$tc { set N -1 set ans [ catchsql { SELECT sqlite_compileoption_get($N); } ] } {0 {{}}} finish_test |