sqlite
[Ported from github.com/sqlite/sqlite] Fix bugs in and improve the interface to the ".check" command of the CLI.
Brought by drakestapleton
| 1 | /* |
| 2 | ** 2007 May 7 |
| 3 | ** |
| 4 | ** The author disclaims copyright to this source code. In place of |
| 5 | ** a legal notice, here is a blessing: |
| 6 | ** |
| 7 | ** May you do good and not evil. |
| 8 | ** May you find forgiveness for yourself and forgive others. |
| 9 | ** May you share freely, never taking more than you give. |
| 10 | ** |
| 11 | ************************************************************************* |
| 12 | ** |
| 13 | ** This file contains code used for testing the SQLite system. |
| 14 | ** None of the code in this file goes into a deliverable build. |
| 15 | ** |
| 16 | ** The focus of this file is providing the TCL testing layer |
| 17 | ** access to compile-time constants. |
| 18 | */ |
| 19 | |
| 20 | #include "sqliteLimit.h" |
| 21 | |
| 22 | #include "sqliteInt.h" |
| 23 | #if SQLITE_OS_WIN |
| 24 | # include "os_win.h" |
| 25 | #endif |
| 26 | |
| 27 | #include "tclsqlite.h" |
| 28 | #include <stdlib.h> |
| 29 | #include <string.h> |
| 30 | |
| 31 | /* |
| 32 | ** Macro to stringify the results of the evaluation a pre-processor |
| 33 | ** macro. i.e. so that STRINGVALUE(SQLITE_NOMEM) -> "7". |
| 34 | */ |
| 35 | #define STRINGVALUE2(x) #x |
| 36 | #define STRINGVALUE(x) STRINGVALUE2(x) |
| 37 | |
| 38 | /* |
| 39 | ** This routine sets entries in the global ::sqlite_options() array variable |
| 40 | ** according to the compile-time configuration of the database. Test |
| 41 | ** procedures use this to determine when tests should be omitted. |
| 42 | */ |
| 43 | static void set_options(Tcl_Interp *interp){ |
| 44 | #if HAVE_MALLOC_USABLE_SIZE |
| 45 | Tcl_SetVar2(interp, "sqlite_options", "malloc_usable_size", "1", |
| 46 | TCL_GLOBAL_ONLY); |
| 47 | #else |
| 48 | Tcl_SetVar2(interp, "sqlite_options", "malloc_usable_size", "0", |
| 49 | TCL_GLOBAL_ONLY); |
| 50 | #endif |
| 51 | |
| 52 | #ifdef SQLITE_32BIT_ROWID |
| 53 | Tcl_SetVar2(interp, "sqlite_options", "rowid32", "1", TCL_GLOBAL_ONLY); |
| 54 | #else |
| 55 | Tcl_SetVar2(interp, "sqlite_options", "rowid32", "0", TCL_GLOBAL_ONLY); |
| 56 | #endif |
| 57 | |
| 58 | #ifdef SQLITE_ALLOW_ROWID_IN_VIEW |
| 59 | Tcl_SetVar2( |
| 60 | interp, "sqlite_options", "allow_rowid_in_view", "1", TCL_GLOBAL_ONLY); |
| 61 | #else |
| 62 | Tcl_SetVar2( |
| 63 | interp, "sqlite_options", "allow_rowid_in_view", "0", TCL_GLOBAL_ONLY); |
| 64 | #endif |
| 65 | |
| 66 | #if defined(SQLITE_ENABLE_CARRAY) |
| 67 | Tcl_SetVar2(interp, "sqlite_options","carray","1",TCL_GLOBAL_ONLY); |
| 68 | #else |
| 69 | Tcl_SetVar2(interp, "sqlite_options","carray","0",TCL_GLOBAL_ONLY); |
| 70 | #endif |
| 71 | |
| 72 | #ifdef SQLITE_CASE_SENSITIVE_LIKE |
| 73 | Tcl_SetVar2(interp, "sqlite_options","casesensitivelike","1",TCL_GLOBAL_ONLY); |
| 74 | #else |
| 75 | Tcl_SetVar2(interp, "sqlite_options","casesensitivelike","0",TCL_GLOBAL_ONLY); |
| 76 | #endif |
| 77 | |
| 78 | #ifdef CONFIG_SLOWDOWN_FACTOR |
| 79 | Tcl_SetVar2(interp, "sqlite_options","configslower", |
| 80 | STRINGVALUE(CONFIG_SLOWDOWN_FACTOR),TCL_GLOBAL_ONLY); |
| 81 | #else |
| 82 | Tcl_SetVar2(interp, "sqlite_options","configslower","1.0",TCL_GLOBAL_ONLY); |
| 83 | #endif |
| 84 | |
| 85 | #if !SQLITE_OS_WINCE |
| 86 | Tcl_SetVar2(interp, "sqlite_options", "curdir", "1", TCL_GLOBAL_ONLY); |
| 87 | #else |
| 88 | Tcl_SetVar2(interp, "sqlite_options", "curdir", "0", TCL_GLOBAL_ONLY); |
| 89 | #endif |
| 90 | |
| 91 | #ifdef SQLITE_WIN32_MALLOC |
| 92 | Tcl_SetVar2(interp, "sqlite_options", "win32malloc", "1", TCL_GLOBAL_ONLY); |
| 93 | #else |
| 94 | Tcl_SetVar2(interp, "sqlite_options", "win32malloc", "0", TCL_GLOBAL_ONLY); |
| 95 | #endif |
| 96 | |
| 97 | #ifdef SQLITE_DEBUG |
| 98 | Tcl_SetVar2(interp, "sqlite_options", "debug", "1", TCL_GLOBAL_ONLY); |
| 99 | #else |
| 100 | Tcl_SetVar2(interp, "sqlite_options", "debug", "0", TCL_GLOBAL_ONLY); |
| 101 | #endif |
| 102 | |
| 103 | #ifdef SQLITE_DEFAULT_CKPTFULLFSYNC |
| 104 | Tcl_SetVar2(interp, "sqlite_options", "default_ckptfullfsync", |
| 105 | SQLITE_DEFAULT_CKPTFULLFSYNC ? "1" : "0", TCL_GLOBAL_ONLY); |
| 106 | #else |
| 107 | Tcl_SetVar2(interp, "sqlite_options", "default_ckptfullfsync", "0", TCL_GLOBAL_ONLY); |
| 108 | #endif |
| 109 | |
| 110 | #ifdef SQLITE_DIRECT_OVERFLOW_READ |
| 111 | Tcl_SetVar2(interp, "sqlite_options", "direct_read", "1", TCL_GLOBAL_ONLY); |
| 112 | #else |
| 113 | Tcl_SetVar2(interp, "sqlite_options", "direct_read", "0", TCL_GLOBAL_ONLY); |
| 114 | #endif |
| 115 | |
| 116 | #ifdef SQLITE_DISABLE_DIRSYNC |
| 117 | Tcl_SetVar2(interp, "sqlite_options", "dirsync", "0", TCL_GLOBAL_ONLY); |
| 118 | #else |
| 119 | Tcl_SetVar2(interp, "sqlite_options", "dirsync", "1", TCL_GLOBAL_ONLY); |
| 120 | #endif |
| 121 | |
| 122 | #ifdef SQLITE_DISABLE_LFS |
| 123 | Tcl_SetVar2(interp, "sqlite_options", "lfs", "0", TCL_GLOBAL_ONLY); |
| 124 | #else |
| 125 | Tcl_SetVar2(interp, "sqlite_options", "lfs", "1", TCL_GLOBAL_ONLY); |
| 126 | #endif |
| 127 | |
| 128 | #ifdef SQLITE_DISABLE_PAGECACHE_OVERFLOW_STATS |
| 129 | Tcl_SetVar2(interp, "sqlite_options", "pagecache_overflow_stats","0",TCL_GLOBAL_ONLY); |
| 130 | #else |
| 131 | Tcl_SetVar2(interp, "sqlite_options", "pagecache_overflow_stats","1",TCL_GLOBAL_ONLY); |
| 132 | #endif |
| 133 | |
| 134 | #if SQLITE_MAX_MMAP_SIZE>0 |
| 135 | Tcl_SetVar2(interp, "sqlite_options", "mmap", "1", TCL_GLOBAL_ONLY); |
| 136 | #else |
| 137 | Tcl_SetVar2(interp, "sqlite_options", "mmap", "0", TCL_GLOBAL_ONLY); |
| 138 | #endif |
| 139 | |
| 140 | Tcl_SetVar2(interp, "sqlite_options", "worker_threads", |
| 141 | STRINGVALUE(SQLITE_MAX_WORKER_THREADS), TCL_GLOBAL_ONLY |
| 142 | ); |
| 143 | |
| 144 | #ifdef SQLITE_MEMDEBUG |
| 145 | Tcl_SetVar2(interp, "sqlite_options", "memdebug", "1", TCL_GLOBAL_ONLY); |
| 146 | #else |
| 147 | Tcl_SetVar2(interp, "sqlite_options", "memdebug", "0", TCL_GLOBAL_ONLY); |
| 148 | #endif |
| 149 | |
| 150 | #ifdef SQLITE_ENABLE_8_3_NAMES |
| 151 | Tcl_SetVar2(interp, "sqlite_options", "8_3_names", "1", TCL_GLOBAL_ONLY); |
| 152 | #else |
| 153 | Tcl_SetVar2(interp, "sqlite_options", "8_3_names", "0", TCL_GLOBAL_ONLY); |
| 154 | #endif |
| 155 | |
| 156 | #ifdef SQLITE_ENABLE_CURSOR_HINTS |
| 157 | Tcl_SetVar2(interp, "sqlite_options", "cursorhints", "1", TCL_GLOBAL_ONLY); |
| 158 | #else |
| 159 | Tcl_SetVar2(interp, "sqlite_options", "cursorhints", "0", TCL_GLOBAL_ONLY); |
| 160 | #endif |
| 161 | |
| 162 | #ifdef SQLITE_ENABLE_HIDDEN_COLUMNS |
| 163 | Tcl_SetVar2(interp, "sqlite_options", "hiddencolumns", "1", TCL_GLOBAL_ONLY); |
| 164 | #else |
| 165 | Tcl_SetVar2(interp, "sqlite_options", "hiddencolumns", "0", TCL_GLOBAL_ONLY); |
| 166 | #endif |
| 167 | |
| 168 | #ifndef SQLITE_OMIT_DESERIALIZE |
| 169 | Tcl_SetVar2(interp, "sqlite_options", "deserialize", "1", TCL_GLOBAL_ONLY); |
| 170 | #else |
| 171 | Tcl_SetVar2(interp, "sqlite_options", "deserialize", "0", TCL_GLOBAL_ONLY); |
| 172 | #endif |
| 173 | |
| 174 | #ifdef SQLITE_ENABLE_MATH_FUNCTIONS |
| 175 | Tcl_SetVar2(interp, "sqlite_options", "mathlib", "1", TCL_GLOBAL_ONLY); |
| 176 | #else |
| 177 | Tcl_SetVar2(interp, "sqlite_options", "mathlib", "0", TCL_GLOBAL_ONLY); |
| 178 | #endif |
| 179 | |
| 180 | #ifdef SQLITE_ENABLE_MEMSYS3 |
| 181 | Tcl_SetVar2(interp, "sqlite_options", "mem3", "1", TCL_GLOBAL_ONLY); |
| 182 | #else |
| 183 | Tcl_SetVar2(interp, "sqlite_options", "mem3", "0", TCL_GLOBAL_ONLY); |
| 184 | #endif |
| 185 | |
| 186 | #ifdef SQLITE_ENABLE_MEMSYS5 |
| 187 | Tcl_SetVar2(interp, "sqlite_options", "mem5", "1", TCL_GLOBAL_ONLY); |
| 188 | #else |
| 189 | Tcl_SetVar2(interp, "sqlite_options", "mem5", "0", TCL_GLOBAL_ONLY); |
| 190 | #endif |
| 191 | |
| 192 | #ifdef SQLITE_ENABLE_OFFSET_SQL_FUNC |
| 193 | Tcl_SetVar2(interp, "sqlite_options", "offset_sql_func","1",TCL_GLOBAL_ONLY); |
| 194 | #else |
| 195 | Tcl_SetVar2(interp, "sqlite_options", "offset_sql_func","0",TCL_GLOBAL_ONLY); |
| 196 | #endif |
| 197 | |
| 198 | #ifdef SQLITE_ENABLE_ORDERED_SET_AGGREGATES |
| 199 | Tcl_SetVar2(interp, "sqlite_options", |
| 200 | "ordered_set_aggregates","1",TCL_GLOBAL_ONLY); |
| 201 | #else |
| 202 | Tcl_SetVar2(interp, "sqlite_options", |
| 203 | "ordered_set_aggregates","0",TCL_GLOBAL_ONLY); |
| 204 | #endif |
| 205 | |
| 206 | #ifdef SQLITE_ENABLE_PREUPDATE_HOOK |
| 207 | Tcl_SetVar2(interp, "sqlite_options", "preupdate", "1", TCL_GLOBAL_ONLY); |
| 208 | #else |
| 209 | Tcl_SetVar2(interp, "sqlite_options", "preupdate", "0", TCL_GLOBAL_ONLY); |
| 210 | #endif |
| 211 | |
| 212 | #ifdef SQLITE_ENABLE_SNAPSHOT |
| 213 | Tcl_SetVar2(interp, "sqlite_options", "snapshot", "1", TCL_GLOBAL_ONLY); |
| 214 | #else |
| 215 | Tcl_SetVar2(interp, "sqlite_options", "snapshot", "0", TCL_GLOBAL_ONLY); |
| 216 | #endif |
| 217 | |
| 218 | #ifdef SQLITE_MUTEX_OMIT |
| 219 | Tcl_SetVar2(interp, "sqlite_options", "mutex", "0", TCL_GLOBAL_ONLY); |
| 220 | #else |
| 221 | Tcl_SetVar2(interp, "sqlite_options", "mutex", "1", TCL_GLOBAL_ONLY); |
| 222 | #endif |
| 223 | |
| 224 | #ifdef SQLITE_MUTEX_NOOP |
| 225 | Tcl_SetVar2(interp, "sqlite_options", "mutex_noop", "1", TCL_GLOBAL_ONLY); |
| 226 | #else |
| 227 | Tcl_SetVar2(interp, "sqlite_options", "mutex_noop", "0", TCL_GLOBAL_ONLY); |
| 228 | #endif |
| 229 | |
| 230 | #ifdef SQLITE_OMIT_ALTERTABLE |
| 231 | Tcl_SetVar2(interp, "sqlite_options", "altertable", "0", TCL_GLOBAL_ONLY); |
| 232 | #else |
| 233 | Tcl_SetVar2(interp, "sqlite_options", "altertable", "1", TCL_GLOBAL_ONLY); |
| 234 | #endif |
| 235 | |
| 236 | #ifdef SQLITE_OMIT_ANALYZE |
| 237 | Tcl_SetVar2(interp, "sqlite_options", "analyze", "0", TCL_GLOBAL_ONLY); |
| 238 | #else |
| 239 | Tcl_SetVar2(interp, "sqlite_options", "analyze", "1", TCL_GLOBAL_ONLY); |
| 240 | #endif |
| 241 | |
| 242 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 243 | Tcl_SetVar2(interp, "sqlite_options", "api_armor", "1", TCL_GLOBAL_ONLY); |
| 244 | #else |
| 245 | Tcl_SetVar2(interp, "sqlite_options", "api_armor", "0", TCL_GLOBAL_ONLY); |
| 246 | #endif |
| 247 | |
| 248 | #ifdef SQLITE_ENABLE_ATOMIC_WRITE |
| 249 | Tcl_SetVar2(interp, "sqlite_options", "atomicwrite", "1", TCL_GLOBAL_ONLY); |
| 250 | #else |
| 251 | Tcl_SetVar2(interp, "sqlite_options", "atomicwrite", "0", TCL_GLOBAL_ONLY); |
| 252 | #endif |
| 253 | |
| 254 | #ifdef SQLITE_ENABLE_BATCH_ATOMIC_WRITE |
| 255 | Tcl_SetVar2(interp, "sqlite_options", "batchatomicwrite","1",TCL_GLOBAL_ONLY); |
| 256 | #else |
| 257 | Tcl_SetVar2(interp, "sqlite_options", "batchatomicwrite","0",TCL_GLOBAL_ONLY); |
| 258 | #endif |
| 259 | |
| 260 | #ifdef SQLITE_ENABLE_GEOPOLY |
| 261 | Tcl_SetVar2(interp, "sqlite_options", "geopoly", "1", TCL_GLOBAL_ONLY); |
| 262 | #else |
| 263 | Tcl_SetVar2(interp, "sqlite_options", "geopoly", "0", TCL_GLOBAL_ONLY); |
| 264 | #endif |
| 265 | |
| 266 | #ifndef SQLITE_OMIT_JSON |
| 267 | Tcl_SetVar2(interp, "sqlite_options", "json1", "1", TCL_GLOBAL_ONLY); |
| 268 | #else |
| 269 | Tcl_SetVar2(interp, "sqlite_options", "json1", "0", TCL_GLOBAL_ONLY); |
| 270 | #endif |
| 271 | |
| 272 | Tcl_SetVar2(interp, "sqlite_options", "has_codec", "0", TCL_GLOBAL_ONLY); |
| 273 | |
| 274 | #ifdef SQLITE_LIKE_DOESNT_MATCH_BLOBS |
| 275 | Tcl_SetVar2(interp, "sqlite_options", "like_match_blobs", "0", TCL_GLOBAL_ONLY); |
| 276 | #else |
| 277 | Tcl_SetVar2(interp, "sqlite_options", "like_match_blobs", "1", TCL_GLOBAL_ONLY); |
| 278 | #endif |
| 279 | |
| 280 | #ifdef SQLITE_OMIT_ATTACH |
| 281 | Tcl_SetVar2(interp, "sqlite_options", "attach", "0", TCL_GLOBAL_ONLY); |
| 282 | #else |
| 283 | Tcl_SetVar2(interp, "sqlite_options", "attach", "1", TCL_GLOBAL_ONLY); |
| 284 | #endif |
| 285 | |
| 286 | #ifdef SQLITE_OMIT_AUTHORIZATION |
| 287 | Tcl_SetVar2(interp, "sqlite_options", "auth", "0", TCL_GLOBAL_ONLY); |
| 288 | #else |
| 289 | Tcl_SetVar2(interp, "sqlite_options", "auth", "1", TCL_GLOBAL_ONLY); |
| 290 | #endif |
| 291 | |
| 292 | #ifdef SQLITE_OMIT_AUTOINCREMENT |
| 293 | Tcl_SetVar2(interp, "sqlite_options", "autoinc", "0", TCL_GLOBAL_ONLY); |
| 294 | #else |
| 295 | Tcl_SetVar2(interp, "sqlite_options", "autoinc", "1", TCL_GLOBAL_ONLY); |
| 296 | #endif |
| 297 | |
| 298 | #ifdef SQLITE_OMIT_AUTOMATIC_INDEX |
| 299 | Tcl_SetVar2(interp, "sqlite_options", "autoindex", "0", TCL_GLOBAL_ONLY); |
| 300 | #else |
| 301 | Tcl_SetVar2(interp, "sqlite_options", "autoindex", "1", TCL_GLOBAL_ONLY); |
| 302 | #endif |
| 303 | |
| 304 | #ifdef SQLITE_OMIT_AUTORESET |
| 305 | Tcl_SetVar2(interp, "sqlite_options", "autoreset", "0", TCL_GLOBAL_ONLY); |
| 306 | #else |
| 307 | Tcl_SetVar2(interp, "sqlite_options", "autoreset", "1", TCL_GLOBAL_ONLY); |
| 308 | #endif |
| 309 | |
| 310 | #ifdef SQLITE_OMIT_AUTOVACUUM |
| 311 | Tcl_SetVar2(interp, "sqlite_options", "autovacuum", "0", TCL_GLOBAL_ONLY); |
| 312 | #else |
| 313 | Tcl_SetVar2(interp, "sqlite_options", "autovacuum", "1", TCL_GLOBAL_ONLY); |
| 314 | #endif /* SQLITE_OMIT_AUTOVACUUM */ |
| 315 | #if !defined(SQLITE_DEFAULT_AUTOVACUUM) |
| 316 | Tcl_SetVar2(interp,"sqlite_options","default_autovacuum","0",TCL_GLOBAL_ONLY); |
| 317 | #else |
| 318 | Tcl_SetVar2(interp, "sqlite_options", "default_autovacuum", |
| 319 | STRINGVALUE(SQLITE_DEFAULT_AUTOVACUUM), TCL_GLOBAL_ONLY); |
| 320 | #endif |
| 321 | |
| 322 | #ifdef SQLITE_OMIT_BETWEEN_OPTIMIZATION |
| 323 | Tcl_SetVar2(interp, "sqlite_options", "between_opt", "0", TCL_GLOBAL_ONLY); |
| 324 | #else |
| 325 | Tcl_SetVar2(interp, "sqlite_options", "between_opt", "1", TCL_GLOBAL_ONLY); |
| 326 | #endif |
| 327 | |
| 328 | #ifdef SQLITE_UNTESTABLE |
| 329 | Tcl_SetVar2(interp, "sqlite_options", "builtin_test", "0", TCL_GLOBAL_ONLY); |
| 330 | #else |
| 331 | Tcl_SetVar2(interp, "sqlite_options", "builtin_test", "1", TCL_GLOBAL_ONLY); |
| 332 | #endif |
| 333 | |
| 334 | #ifdef SQLITE_OMIT_BLOB_LITERAL |
| 335 | Tcl_SetVar2(interp, "sqlite_options", "bloblit", "0", TCL_GLOBAL_ONLY); |
| 336 | #else |
| 337 | Tcl_SetVar2(interp, "sqlite_options", "bloblit", "1", TCL_GLOBAL_ONLY); |
| 338 | #endif |
| 339 | |
| 340 | #ifdef SQLITE_OMIT_CAST |
| 341 | Tcl_SetVar2(interp, "sqlite_options", "cast", "0", TCL_GLOBAL_ONLY); |
| 342 | #else |
| 343 | Tcl_SetVar2(interp, "sqlite_options", "cast", "1", TCL_GLOBAL_ONLY); |
| 344 | #endif |
| 345 | |
| 346 | #ifdef SQLITE_OMIT_CHECK |
| 347 | Tcl_SetVar2(interp, "sqlite_options", "check", "0", TCL_GLOBAL_ONLY); |
| 348 | #else |
| 349 | Tcl_SetVar2(interp, "sqlite_options", "check", "1", TCL_GLOBAL_ONLY); |
| 350 | #endif |
| 351 | |
| 352 | #ifdef SQLITE_OMIT_CTE |
| 353 | Tcl_SetVar2(interp, "sqlite_options", "cte", "0", TCL_GLOBAL_ONLY); |
| 354 | #else |
| 355 | Tcl_SetVar2(interp, "sqlite_options", "cte", "1", TCL_GLOBAL_ONLY); |
| 356 | #endif |
| 357 | |
| 358 | #ifdef SQLITE_ENABLE_COLUMN_METADATA |
| 359 | Tcl_SetVar2(interp, "sqlite_options", "columnmetadata", "1", TCL_GLOBAL_ONLY); |
| 360 | #else |
| 361 | Tcl_SetVar2(interp, "sqlite_options", "columnmetadata", "0", TCL_GLOBAL_ONLY); |
| 362 | #endif |
| 363 | |
| 364 | #ifdef SQLITE_ENABLE_ORDEREDSETFUNC |
| 365 | Tcl_SetVar2(interp, "sqlite_options", "ordered_set_funcs", "1", |
| 366 | TCL_GLOBAL_ONLY); |
| 367 | #else |
| 368 | Tcl_SetVar2(interp, "sqlite_options", "ordered_set_funcs", "0", |
| 369 | TCL_GLOBAL_ONLY); |
| 370 | #endif |
| 371 | |
| 372 | #ifdef SQLITE_ENABLE_OVERSIZE_CELL_CHECK |
| 373 | Tcl_SetVar2(interp, "sqlite_options", "oversize_cell_check", "1", |
| 374 | TCL_GLOBAL_ONLY); |
| 375 | #else |
| 376 | Tcl_SetVar2(interp, "sqlite_options", "oversize_cell_check", "0", |
| 377 | TCL_GLOBAL_ONLY); |
| 378 | #endif |
| 379 | |
| 380 | #ifdef SQLITE_OMIT_COMPILEOPTION_DIAGS |
| 381 | Tcl_SetVar2(interp, "sqlite_options", "compileoption_diags", "0", TCL_GLOBAL_ONLY); |
| 382 | #else |
| 383 | Tcl_SetVar2(interp, "sqlite_options", "compileoption_diags", "1", TCL_GLOBAL_ONLY); |
| 384 | #endif |
| 385 | |
| 386 | #ifdef SQLITE_OMIT_COMPLETE |
| 387 | Tcl_SetVar2(interp, "sqlite_options", "complete", "0", TCL_GLOBAL_ONLY); |
| 388 | #else |
| 389 | Tcl_SetVar2(interp, "sqlite_options", "complete", "1", TCL_GLOBAL_ONLY); |
| 390 | #endif |
| 391 | |
| 392 | #ifdef SQLITE_OMIT_COMPOUND_SELECT |
| 393 | Tcl_SetVar2(interp, "sqlite_options", "compound", "0", TCL_GLOBAL_ONLY); |
| 394 | #else |
| 395 | Tcl_SetVar2(interp, "sqlite_options", "compound", "1", TCL_GLOBAL_ONLY); |
| 396 | #endif |
| 397 | |
| 398 | Tcl_SetVar2(interp, "sqlite_options", "conflict", "1", TCL_GLOBAL_ONLY); |
| 399 | Tcl_SetVar2(interp, "sqlite_options", "crashtest", "1", TCL_GLOBAL_ONLY); |
| 400 | |
| 401 | #ifdef SQLITE_OMIT_DATETIME_FUNCS |
| 402 | Tcl_SetVar2(interp, "sqlite_options", "datetime", "0", TCL_GLOBAL_ONLY); |
| 403 | #else |
| 404 | Tcl_SetVar2(interp, "sqlite_options", "datetime", "1", TCL_GLOBAL_ONLY); |
| 405 | #endif |
| 406 | |
| 407 | #ifdef SQLITE_OMIT_DECLTYPE |
| 408 | Tcl_SetVar2(interp, "sqlite_options", "decltype", "0", TCL_GLOBAL_ONLY); |
| 409 | #else |
| 410 | Tcl_SetVar2(interp, "sqlite_options", "decltype", "1", TCL_GLOBAL_ONLY); |
| 411 | #endif |
| 412 | |
| 413 | #ifdef SQLITE_OMIT_DEPRECATED |
| 414 | Tcl_SetVar2(interp, "sqlite_options", "deprecated", "0", TCL_GLOBAL_ONLY); |
| 415 | #else |
| 416 | Tcl_SetVar2(interp, "sqlite_options", "deprecated", "1", TCL_GLOBAL_ONLY); |
| 417 | #endif |
| 418 | |
| 419 | #ifdef SQLITE_OMIT_DISKIO |
| 420 | Tcl_SetVar2(interp, "sqlite_options", "diskio", "0", TCL_GLOBAL_ONLY); |
| 421 | #else |
| 422 | Tcl_SetVar2(interp, "sqlite_options", "diskio", "1", TCL_GLOBAL_ONLY); |
| 423 | #endif |
| 424 | |
| 425 | #ifdef SQLITE_OMIT_EXPLAIN |
| 426 | Tcl_SetVar2(interp, "sqlite_options", "explain", "0", TCL_GLOBAL_ONLY); |
| 427 | #else |
| 428 | Tcl_SetVar2(interp, "sqlite_options", "explain", "1", TCL_GLOBAL_ONLY); |
| 429 | #endif |
| 430 | |
| 431 | #ifdef SQLITE_OMIT_FLOATING_POINT |
| 432 | Tcl_SetVar2(interp, "sqlite_options", "floatingpoint", "0", TCL_GLOBAL_ONLY); |
| 433 | #else |
| 434 | Tcl_SetVar2(interp, "sqlite_options", "floatingpoint", "1", TCL_GLOBAL_ONLY); |
| 435 | #endif |
| 436 | |
| 437 | #ifdef SQLITE_OMIT_FOREIGN_KEY |
| 438 | Tcl_SetVar2(interp, "sqlite_options", "foreignkey", "0", TCL_GLOBAL_ONLY); |
| 439 | #else |
| 440 | Tcl_SetVar2(interp, "sqlite_options", "foreignkey", "1", TCL_GLOBAL_ONLY); |
| 441 | #endif |
| 442 | |
| 443 | #ifdef SQLITE_ENABLE_FTS3 |
| 444 | Tcl_SetVar2(interp, "sqlite_options", "fts3", "1", TCL_GLOBAL_ONLY); |
| 445 | #else |
| 446 | Tcl_SetVar2(interp, "sqlite_options", "fts3", "0", TCL_GLOBAL_ONLY); |
| 447 | #endif |
| 448 | |
| 449 | #ifdef SQLITE_ENABLE_FTS5 |
| 450 | Tcl_SetVar2(interp, "sqlite_options", "fts5", "1", TCL_GLOBAL_ONLY); |
| 451 | #else |
| 452 | Tcl_SetVar2(interp, "sqlite_options", "fts5", "0", TCL_GLOBAL_ONLY); |
| 453 | #endif |
| 454 | |
| 455 | #if defined(SQLITE_ENABLE_FTS3) && !defined(SQLITE_DISABLE_FTS3_UNICODE) |
| 456 | Tcl_SetVar2(interp, "sqlite_options", "fts3_unicode", "1", TCL_GLOBAL_ONLY); |
| 457 | #else |
| 458 | Tcl_SetVar2(interp, "sqlite_options", "fts3_unicode", "0", TCL_GLOBAL_ONLY); |
| 459 | #endif |
| 460 | |
| 461 | #ifdef SQLITE_DISABLE_FTS4_DEFERRED |
| 462 | Tcl_SetVar2(interp, "sqlite_options", "fts4_deferred", "0", TCL_GLOBAL_ONLY); |
| 463 | #else |
| 464 | Tcl_SetVar2(interp, "sqlite_options", "fts4_deferred", "1", TCL_GLOBAL_ONLY); |
| 465 | #endif |
| 466 | |
| 467 | #ifdef SQLITE_OMIT_GET_TABLE |
| 468 | Tcl_SetVar2(interp, "sqlite_options", "gettable", "0", TCL_GLOBAL_ONLY); |
| 469 | #else |
| 470 | Tcl_SetVar2(interp, "sqlite_options", "gettable", "1", TCL_GLOBAL_ONLY); |
| 471 | #endif |
| 472 | |
| 473 | #ifdef SQLITE_ENABLE_ICU |
| 474 | Tcl_SetVar2(interp, "sqlite_options", "icu", "1", TCL_GLOBAL_ONLY); |
| 475 | #else |
| 476 | Tcl_SetVar2(interp, "sqlite_options", "icu", "0", TCL_GLOBAL_ONLY); |
| 477 | #endif |
| 478 | |
| 479 | #ifdef SQLITE_ENABLE_ICU_COLLATIONS |
| 480 | Tcl_SetVar2(interp, "sqlite_options", "icu_collations", "1", TCL_GLOBAL_ONLY); |
| 481 | #else |
| 482 | Tcl_SetVar2(interp, "sqlite_options", "icu_collations", "0", TCL_GLOBAL_ONLY); |
| 483 | #endif |
| 484 | |
| 485 | #ifdef SQLITE_OMIT_INCRBLOB |
| 486 | Tcl_SetVar2(interp, "sqlite_options", "incrblob", "0", TCL_GLOBAL_ONLY); |
| 487 | #else |
| 488 | Tcl_SetVar2(interp, "sqlite_options", "incrblob", "1", TCL_GLOBAL_ONLY); |
| 489 | #endif /* SQLITE_OMIT_AUTOVACUUM */ |
| 490 | |
| 491 | #ifdef SQLITE_OMIT_INTEGRITY_CHECK |
| 492 | Tcl_SetVar2(interp, "sqlite_options", "integrityck", "0", TCL_GLOBAL_ONLY); |
| 493 | #else |
| 494 | Tcl_SetVar2(interp, "sqlite_options", "integrityck", "1", TCL_GLOBAL_ONLY); |
| 495 | #endif |
| 496 | |
| 497 | #if defined(SQLITE_DEFAULT_FILE_FORMAT) && SQLITE_DEFAULT_FILE_FORMAT==1 |
| 498 | Tcl_SetVar2(interp, "sqlite_options", "legacyformat", "1", TCL_GLOBAL_ONLY); |
| 499 | #else |
| 500 | Tcl_SetVar2(interp, "sqlite_options", "legacyformat", "0", TCL_GLOBAL_ONLY); |
| 501 | #endif |
| 502 | |
| 503 | #ifdef SQLITE_OMIT_LIKE_OPTIMIZATION |
| 504 | Tcl_SetVar2(interp, "sqlite_options", "like_opt", "0", TCL_GLOBAL_ONLY); |
| 505 | #else |
| 506 | Tcl_SetVar2(interp, "sqlite_options", "like_opt", "1", TCL_GLOBAL_ONLY); |
| 507 | #endif |
| 508 | |
| 509 | #ifdef SQLITE_OMIT_LOAD_EXTENSION |
| 510 | Tcl_SetVar2(interp, "sqlite_options", "load_ext", "0", TCL_GLOBAL_ONLY); |
| 511 | #else |
| 512 | Tcl_SetVar2(interp, "sqlite_options", "load_ext", "1", TCL_GLOBAL_ONLY); |
| 513 | #endif |
| 514 | |
| 515 | #ifdef SQLITE_OMIT_LOCALTIME |
| 516 | Tcl_SetVar2(interp, "sqlite_options", "localtime", "0", TCL_GLOBAL_ONLY); |
| 517 | #else |
| 518 | Tcl_SetVar2(interp, "sqlite_options", "localtime", "1", TCL_GLOBAL_ONLY); |
| 519 | #endif |
| 520 | |
| 521 | #ifdef SQLITE_OMIT_LOOKASIDE |
| 522 | Tcl_SetVar2(interp, "sqlite_options", "lookaside", "0", TCL_GLOBAL_ONLY); |
| 523 | #else |
| 524 | Tcl_SetVar2(interp, "sqlite_options", "lookaside", "1", TCL_GLOBAL_ONLY); |
| 525 | #endif |
| 526 | |
| 527 | #ifdef SQLITE_OMIT_MEMORYDB |
| 528 | Tcl_SetVar2(interp, "sqlite_options", "memorydb", "0", TCL_GLOBAL_ONLY); |
| 529 | #else |
| 530 | Tcl_SetVar2(interp, "sqlite_options", "memorydb", "1", TCL_GLOBAL_ONLY); |
| 531 | #endif |
| 532 | |
| 533 | #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT |
| 534 | Tcl_SetVar2(interp, "sqlite_options", "memorymanage", "1", TCL_GLOBAL_ONLY); |
| 535 | #else |
| 536 | Tcl_SetVar2(interp, "sqlite_options", "memorymanage", "0", TCL_GLOBAL_ONLY); |
| 537 | #endif |
| 538 | |
| 539 | Tcl_SetVar2(interp, "sqlite_options", "mergesort", "1", TCL_GLOBAL_ONLY); |
| 540 | |
| 541 | #ifdef SQLITE_ENABLE_NULL_TRIM |
| 542 | Tcl_SetVar2(interp, "sqlite_options", "null_trim", "1", TCL_GLOBAL_ONLY); |
| 543 | #else |
| 544 | Tcl_SetVar2(interp, "sqlite_options", "null_trim", "0", TCL_GLOBAL_ONLY); |
| 545 | #endif |
| 546 | |
| 547 | #ifdef SQLITE_OMIT_OR_OPTIMIZATION |
| 548 | Tcl_SetVar2(interp, "sqlite_options", "or_opt", "0", TCL_GLOBAL_ONLY); |
| 549 | #else |
| 550 | Tcl_SetVar2(interp, "sqlite_options", "or_opt", "1", TCL_GLOBAL_ONLY); |
| 551 | #endif |
| 552 | |
| 553 | #ifdef SQLITE_ENABLE_RBU |
| 554 | Tcl_SetVar2(interp, "sqlite_options", "rbu", "1", TCL_GLOBAL_ONLY); |
| 555 | #else |
| 556 | Tcl_SetVar2(interp, "sqlite_options", "rbu", "0", TCL_GLOBAL_ONLY); |
| 557 | #endif |
| 558 | |
| 559 | #ifdef SQLITE_OMIT_PAGER_PRAGMAS |
| 560 | Tcl_SetVar2(interp, "sqlite_options", "pager_pragmas", "0", TCL_GLOBAL_ONLY); |
| 561 | #else |
| 562 | Tcl_SetVar2(interp, "sqlite_options", "pager_pragmas", "1", TCL_GLOBAL_ONLY); |
| 563 | #endif |
| 564 | |
| 565 | #if defined(SQLITE_OMIT_PRAGMA) || defined(SQLITE_OMIT_FLAG_PRAGMAS) |
| 566 | Tcl_SetVar2(interp, "sqlite_options", "pragma", "0", TCL_GLOBAL_ONLY); |
| 567 | Tcl_SetVar2(interp, "sqlite_options", "integrityck", "0", TCL_GLOBAL_ONLY); |
| 568 | #else |
| 569 | Tcl_SetVar2(interp, "sqlite_options", "pragma", "1", TCL_GLOBAL_ONLY); |
| 570 | #endif |
| 571 | |
| 572 | #ifdef SQLITE_OMIT_PROGRESS_CALLBACK |
| 573 | Tcl_SetVar2(interp, "sqlite_options", "progress", "0", TCL_GLOBAL_ONLY); |
| 574 | #else |
| 575 | Tcl_SetVar2(interp, "sqlite_options", "progress", "1", TCL_GLOBAL_ONLY); |
| 576 | #endif |
| 577 | |
| 578 | #ifdef SQLITE_OMIT_REINDEX |
| 579 | Tcl_SetVar2(interp, "sqlite_options", "reindex", "0", TCL_GLOBAL_ONLY); |
| 580 | #else |
| 581 | Tcl_SetVar2(interp, "sqlite_options", "reindex", "1", TCL_GLOBAL_ONLY); |
| 582 | #endif |
| 583 | |
| 584 | #ifdef SQLITE_ENABLE_RTREE |
| 585 | Tcl_SetVar2(interp, "sqlite_options", "rtree", "1", TCL_GLOBAL_ONLY); |
| 586 | #else |
| 587 | Tcl_SetVar2(interp, "sqlite_options", "rtree", "0", TCL_GLOBAL_ONLY); |
| 588 | #endif |
| 589 | |
| 590 | #ifdef SQLITE_RTREE_INT_ONLY |
| 591 | Tcl_SetVar2(interp, "sqlite_options", "rtree_int_only", "1", TCL_GLOBAL_ONLY); |
| 592 | #else |
| 593 | Tcl_SetVar2(interp, "sqlite_options", "rtree_int_only", "0", TCL_GLOBAL_ONLY); |
| 594 | #endif |
| 595 | |
| 596 | #ifdef SQLITE_OMIT_SCHEMA_PRAGMAS |
| 597 | Tcl_SetVar2(interp, "sqlite_options", "schema_pragmas", "0", TCL_GLOBAL_ONLY); |
| 598 | #else |
| 599 | Tcl_SetVar2(interp, "sqlite_options", "schema_pragmas", "1", TCL_GLOBAL_ONLY); |
| 600 | #endif |
| 601 | |
| 602 | #ifdef SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS |
| 603 | Tcl_SetVar2(interp, "sqlite_options", "schema_version", "0", TCL_GLOBAL_ONLY); |
| 604 | #else |
| 605 | Tcl_SetVar2(interp, "sqlite_options", "schema_version", "1", TCL_GLOBAL_ONLY); |
| 606 | #endif |
| 607 | |
| 608 | #if defined(SQLITE_ENABLE_SESSION) && defined(SQLITE_ENABLE_PREUPDATE_HOOK) |
| 609 | Tcl_SetVar2(interp, "sqlite_options", "session", "1", TCL_GLOBAL_ONLY); |
| 610 | #else |
| 611 | Tcl_SetVar2(interp, "sqlite_options", "session", "0", TCL_GLOBAL_ONLY); |
| 612 | #endif |
| 613 | |
| 614 | #ifdef SQLITE_ENABLE_STAT4 |
| 615 | Tcl_SetVar2(interp, "sqlite_options", "stat4", "1", TCL_GLOBAL_ONLY); |
| 616 | #else |
| 617 | Tcl_SetVar2(interp, "sqlite_options", "stat4", "0", TCL_GLOBAL_ONLY); |
| 618 | #endif |
| 619 | #if defined(SQLITE_ENABLE_STMTVTAB) && !defined(SQLITE_OMIT_VIRTUALTABLE) |
| 620 | Tcl_SetVar2(interp, "sqlite_options", "stmtvtab", "1", TCL_GLOBAL_ONLY); |
| 621 | #else |
| 622 | Tcl_SetVar2(interp, "sqlite_options", "stmtvtab", "0", TCL_GLOBAL_ONLY); |
| 623 | #endif |
| 624 | |
| 625 | #ifdef SQLITE_ENABLE_STMT_SCANSTATUS |
| 626 | Tcl_SetVar2(interp, "sqlite_options", "scanstatus", "1", TCL_GLOBAL_ONLY); |
| 627 | #else |
| 628 | Tcl_SetVar2(interp, "sqlite_options", "scanstatus", "0", TCL_GLOBAL_ONLY); |
| 629 | #endif |
| 630 | |
| 631 | #if !defined(SQLITE_ENABLE_LOCKING_STYLE) |
| 632 | # if defined(__APPLE__) |
| 633 | # define SQLITE_ENABLE_LOCKING_STYLE 1 |
| 634 | # else |
| 635 | # define SQLITE_ENABLE_LOCKING_STYLE 0 |
| 636 | # endif |
| 637 | #endif |
| 638 | #if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) |
| 639 | Tcl_SetVar2(interp,"sqlite_options","lock_proxy_pragmas","1",TCL_GLOBAL_ONLY); |
| 640 | #else |
| 641 | Tcl_SetVar2(interp,"sqlite_options","lock_proxy_pragmas","0",TCL_GLOBAL_ONLY); |
| 642 | #endif |
| 643 | #if defined(SQLITE_PREFER_PROXY_LOCKING) && defined(__APPLE__) |
| 644 | Tcl_SetVar2(interp,"sqlite_options","prefer_proxy_locking","1",TCL_GLOBAL_ONLY); |
| 645 | #else |
| 646 | Tcl_SetVar2(interp,"sqlite_options","prefer_proxy_locking","0",TCL_GLOBAL_ONLY); |
| 647 | #endif |
| 648 | |
| 649 | |
| 650 | #ifdef SQLITE_OMIT_SHARED_CACHE |
| 651 | Tcl_SetVar2(interp, "sqlite_options", "shared_cache", "0", TCL_GLOBAL_ONLY); |
| 652 | #else |
| 653 | Tcl_SetVar2(interp, "sqlite_options", "shared_cache", "1", TCL_GLOBAL_ONLY); |
| 654 | #endif |
| 655 | |
| 656 | #ifdef SQLITE_OMIT_SUBQUERY |
| 657 | Tcl_SetVar2(interp, "sqlite_options", "subquery", "0", TCL_GLOBAL_ONLY); |
| 658 | #else |
| 659 | Tcl_SetVar2(interp, "sqlite_options", "subquery", "1", TCL_GLOBAL_ONLY); |
| 660 | #endif |
| 661 | |
| 662 | #ifdef SQLITE_OMIT_TCL_VARIABLE |
| 663 | Tcl_SetVar2(interp, "sqlite_options", "tclvar", "0", TCL_GLOBAL_ONLY); |
| 664 | #else |
| 665 | Tcl_SetVar2(interp, "sqlite_options", "tclvar", "1", TCL_GLOBAL_ONLY); |
| 666 | #endif |
| 667 | |
| 668 | Tcl_SetVar2(interp, "sqlite_options", "threadsafe", |
| 669 | SQLITE_THREADSAFE ? "1" : "0", TCL_GLOBAL_ONLY); |
| 670 | Tcl_SetVar2(interp, "sqlite_options", "threadsafe1", |
| 671 | SQLITE_THREADSAFE==1 ? "1" : "0", TCL_GLOBAL_ONLY); |
| 672 | Tcl_SetVar2(interp, "sqlite_options", "threadsafe2", |
| 673 | SQLITE_THREADSAFE==2 ? "1" : "0", TCL_GLOBAL_ONLY); |
| 674 | assert( sqlite3_threadsafe()==SQLITE_THREADSAFE ); |
| 675 | |
| 676 | #ifdef SQLITE_OMIT_TEMPDB |
| 677 | Tcl_SetVar2(interp, "sqlite_options", "tempdb", "0", TCL_GLOBAL_ONLY); |
| 678 | #else |
| 679 | Tcl_SetVar2(interp, "sqlite_options", "tempdb", "1", TCL_GLOBAL_ONLY); |
| 680 | #endif |
| 681 | |
| 682 | #ifdef SQLITE_OMIT_TRACE |
| 683 | Tcl_SetVar2(interp, "sqlite_options", "trace", "0", TCL_GLOBAL_ONLY); |
| 684 | #else |
| 685 | Tcl_SetVar2(interp, "sqlite_options", "trace", "1", TCL_GLOBAL_ONLY); |
| 686 | #endif |
| 687 | |
| 688 | #ifdef SQLITE_THREAD_MISUSE_WARNINGS |
| 689 | Tcl_SetVar2(interp, "sqlite_options", "thread_misuse_warnings", |
| 690 | "1", TCL_GLOBAL_ONLY); |
| 691 | #else |
| 692 | Tcl_SetVar2(interp, "sqlite_options", "thread_misuse_warnings", |
| 693 | "0", TCL_GLOBAL_ONLY); |
| 694 | #endif |
| 695 | |
| 696 | #ifdef SQLITE_OMIT_TRIGGER |
| 697 | Tcl_SetVar2(interp, "sqlite_options", "trigger", "0", TCL_GLOBAL_ONLY); |
| 698 | #else |
| 699 | Tcl_SetVar2(interp, "sqlite_options", "trigger", "1", TCL_GLOBAL_ONLY); |
| 700 | #endif |
| 701 | |
| 702 | #ifdef SQLITE_OMIT_TRUNCATE_OPTIMIZATION |
| 703 | Tcl_SetVar2(interp, "sqlite_options", "truncate_opt", "0", TCL_GLOBAL_ONLY); |
| 704 | #else |
| 705 | Tcl_SetVar2(interp, "sqlite_options", "truncate_opt", "1", TCL_GLOBAL_ONLY); |
| 706 | #endif |
| 707 | |
| 708 | #ifdef SQLITE_OMIT_UTF16 |
| 709 | Tcl_SetVar2(interp, "sqlite_options", "utf16", "0", TCL_GLOBAL_ONLY); |
| 710 | #else |
| 711 | Tcl_SetVar2(interp, "sqlite_options", "utf16", "1", TCL_GLOBAL_ONLY); |
| 712 | #endif |
| 713 | |
| 714 | #if defined(SQLITE_OMIT_VACUUM) || defined(SQLITE_OMIT_ATTACH) |
| 715 | Tcl_SetVar2(interp, "sqlite_options", "vacuum", "0", TCL_GLOBAL_ONLY); |
| 716 | #else |
| 717 | Tcl_SetVar2(interp, "sqlite_options", "vacuum", "1", TCL_GLOBAL_ONLY); |
| 718 | #endif |
| 719 | |
| 720 | #ifdef SQLITE_OMIT_VIEW |
| 721 | Tcl_SetVar2(interp, "sqlite_options", "view", "0", TCL_GLOBAL_ONLY); |
| 722 | #else |
| 723 | Tcl_SetVar2(interp, "sqlite_options", "view", "1", TCL_GLOBAL_ONLY); |
| 724 | #endif |
| 725 | |
| 726 | #ifdef SQLITE_OMIT_VIRTUALTABLE |
| 727 | Tcl_SetVar2(interp, "sqlite_options", "vtab", "0", TCL_GLOBAL_ONLY); |
| 728 | #else |
| 729 | Tcl_SetVar2(interp, "sqlite_options", "vtab", "1", TCL_GLOBAL_ONLY); |
| 730 | #endif |
| 731 | |
| 732 | #ifdef SQLITE_OMIT_WAL |
| 733 | Tcl_SetVar2(interp, "sqlite_options", "wal", "0", TCL_GLOBAL_ONLY); |
| 734 | #else |
| 735 | Tcl_SetVar2(interp, "sqlite_options", "wal", "1", TCL_GLOBAL_ONLY); |
| 736 | #endif |
| 737 | |
| 738 | #ifdef SQLITE_OMIT_WSD |
| 739 | Tcl_SetVar2(interp, "sqlite_options", "wsd", "0", TCL_GLOBAL_ONLY); |
| 740 | #else |
| 741 | Tcl_SetVar2(interp, "sqlite_options", "wsd", "1", TCL_GLOBAL_ONLY); |
| 742 | #endif |
| 743 | |
| 744 | #if defined(SQLITE_ENABLE_UPDATE_DELETE_LIMIT) && !defined(SQLITE_OMIT_SUBQUERY) |
| 745 | Tcl_SetVar2(interp, "sqlite_options", "update_delete_limit", "1", TCL_GLOBAL_ONLY); |
| 746 | #else |
| 747 | Tcl_SetVar2(interp, "sqlite_options", "update_delete_limit", "0", TCL_GLOBAL_ONLY); |
| 748 | #endif |
| 749 | |
| 750 | #if defined(SQLITE_ENABLE_UNLOCK_NOTIFY) |
| 751 | Tcl_SetVar2(interp, "sqlite_options", "unlock_notify", "1", TCL_GLOBAL_ONLY); |
| 752 | #else |
| 753 | Tcl_SetVar2(interp, "sqlite_options", "unlock_notify", "0", TCL_GLOBAL_ONLY); |
| 754 | #endif |
| 755 | |
| 756 | #ifdef SQLITE_FAST_SECURE_DELETE |
| 757 | Tcl_SetVar2(interp, "sqlite_options", "fast_secure_delete", "1", TCL_GLOBAL_ONLY); |
| 758 | #else |
| 759 | Tcl_SetVar2(interp, "sqlite_options", "fast_secure_delete", "0", TCL_GLOBAL_ONLY); |
| 760 | #endif |
| 761 | |
| 762 | #ifdef SQLITE_SECURE_DELETE |
| 763 | Tcl_SetVar2(interp, "sqlite_options", "secure_delete", "1", TCL_GLOBAL_ONLY); |
| 764 | #else |
| 765 | Tcl_SetVar2(interp, "sqlite_options", "secure_delete", "0", TCL_GLOBAL_ONLY); |
| 766 | #endif |
| 767 | |
| 768 | #ifdef SQLITE_MULTIPLEX_EXT_OVWR |
| 769 | Tcl_SetVar2(interp, "sqlite_options", "multiplex_ext_overwrite", "1", TCL_GLOBAL_ONLY); |
| 770 | #else |
| 771 | Tcl_SetVar2(interp, "sqlite_options", "multiplex_ext_overwrite", "0", TCL_GLOBAL_ONLY); |
| 772 | #endif |
| 773 | |
| 774 | #ifdef YYTRACKMAXSTACKDEPTH |
| 775 | Tcl_SetVar2(interp, "sqlite_options", "yytrackmaxstackdepth", "1", TCL_GLOBAL_ONLY); |
| 776 | #else |
| 777 | Tcl_SetVar2(interp, "sqlite_options", "yytrackmaxstackdepth", "0", TCL_GLOBAL_ONLY); |
| 778 | #endif |
| 779 | |
| 780 | #ifdef SQLITE_ENABLE_SQLLOG |
| 781 | Tcl_SetVar2(interp, "sqlite_options", "sqllog", "1", TCL_GLOBAL_ONLY); |
| 782 | #else |
| 783 | Tcl_SetVar2(interp, "sqlite_options", "sqllog", "0", TCL_GLOBAL_ONLY); |
| 784 | #endif |
| 785 | |
| 786 | #ifdef SQLITE_ENABLE_URI_00_ERROR |
| 787 | Tcl_SetVar2(interp, "sqlite_options", "uri_00_error", "1", TCL_GLOBAL_ONLY); |
| 788 | #else |
| 789 | Tcl_SetVar2(interp, "sqlite_options", "uri_00_error", "0", TCL_GLOBAL_ONLY); |
| 790 | #endif |
| 791 | |
| 792 | #if defined(SQLITE_ENABLE_NORMALIZE) |
| 793 | Tcl_SetVar2(interp, "sqlite_options", "normalize", "1", TCL_GLOBAL_ONLY); |
| 794 | #else |
| 795 | Tcl_SetVar2(interp, "sqlite_options", "normalize", "0", TCL_GLOBAL_ONLY); |
| 796 | #endif |
| 797 | |
| 798 | #ifdef SQLITE_OMIT_WINDOWFUNC |
| 799 | Tcl_SetVar2(interp, "sqlite_options", "windowfunc", "0", TCL_GLOBAL_ONLY); |
| 800 | #else |
| 801 | Tcl_SetVar2(interp, "sqlite_options", "windowfunc", "1", TCL_GLOBAL_ONLY); |
| 802 | #endif |
| 803 | |
| 804 | #if !defined(SQLITE_ENABLE_SETLK_TIMEOUT) |
| 805 | Tcl_SetVar2(interp, "sqlite_options", "setlk_timeout", "0", TCL_GLOBAL_ONLY); |
| 806 | #else |
| 807 | Tcl_SetVar2(interp, "sqlite_options", "setlk_timeout", |
| 808 | STRINGVALUE(SQLITE_ENABLE_SETLK_TIMEOUT), TCL_GLOBAL_ONLY); |
| 809 | #endif |
| 810 | |
| 811 | #define LINKVAR(x) { \ |
| 812 | static const int cv_ ## x = SQLITE_ ## x; \ |
| 813 | Tcl_LinkVar(interp, "SQLITE_" #x, (char *)&(cv_ ## x), \ |
| 814 | TCL_LINK_INT | TCL_LINK_READ_ONLY); } |
| 815 | |
| 816 | LINKVAR( MAX_LENGTH ); |
| 817 | LINKVAR( MAX_COLUMN ); |
| 818 | LINKVAR( MAX_SQL_LENGTH ); |
| 819 | LINKVAR( MAX_EXPR_DEPTH ); |
| 820 | LINKVAR( MAX_COMPOUND_SELECT ); |
| 821 | LINKVAR( MAX_VDBE_OP ); |
| 822 | LINKVAR( MAX_FUNCTION_ARG ); |
| 823 | LINKVAR( MAX_VARIABLE_NUMBER ); |
| 824 | LINKVAR( MAX_PAGE_SIZE ); |
| 825 | LINKVAR( MAX_PAGE_COUNT ); |
| 826 | LINKVAR( MAX_LIKE_PATTERN_LENGTH ); |
| 827 | LINKVAR( MAX_TRIGGER_DEPTH ); |
| 828 | LINKVAR( DEFAULT_CACHE_SIZE ); |
| 829 | LINKVAR( DEFAULT_PAGE_SIZE ); |
| 830 | LINKVAR( DEFAULT_FILE_FORMAT ); |
| 831 | LINKVAR( DEFAULT_SYNCHRONOUS ); |
| 832 | LINKVAR( DEFAULT_WAL_SYNCHRONOUS ); |
| 833 | LINKVAR( MAX_ATTACHED ); |
| 834 | LINKVAR( MAX_DEFAULT_PAGE_SIZE ); |
| 835 | LINKVAR( MAX_WORKER_THREADS ); |
| 836 | LINKVAR( MAX_SCHEMA ); |
| 837 | LINKVAR( MAX_TRIGGER_STEPS ); |
| 838 | |
| 839 | { |
| 840 | static const int cv_TEMP_STORE = SQLITE_TEMP_STORE; |
| 841 | Tcl_LinkVar(interp, "TEMP_STORE", (char *)&(cv_TEMP_STORE), |
| 842 | TCL_LINK_INT | TCL_LINK_READ_ONLY); |
| 843 | } |
| 844 | |
| 845 | #ifdef _MSC_VER |
| 846 | { |
| 847 | static const int cv__MSC_VER = 1; |
| 848 | Tcl_LinkVar(interp, "_MSC_VER", (char *)&(cv__MSC_VER), |
| 849 | TCL_LINK_INT | TCL_LINK_READ_ONLY); |
| 850 | } |
| 851 | #endif |
| 852 | #ifdef __GNUC__ |
| 853 | { |
| 854 | static const int cv___GNUC__ = 1; |
| 855 | Tcl_LinkVar(interp, "__GNUC__", (char *)&(cv___GNUC__), |
| 856 | TCL_LINK_INT | TCL_LINK_READ_ONLY); |
| 857 | } |
| 858 | #endif |
| 859 | } |
| 860 | |
| 861 | |
| 862 | /* |
| 863 | ** Register commands with the TCL interpreter. |
| 864 | */ |
| 865 | int Sqliteconfig_Init(Tcl_Interp *interp){ |
| 866 | set_options(interp); |
| 867 | return TCL_OK; |
| 868 | } |