/ Check-in [76a0294a]
Login

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

Overview
Comment:Refactored compile time option diagnostic support to use strings identifiers instead of bitmask.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | compile_opts
Files: files | file ages | folders
SHA1: 76a0294ab4208a0858a13bab0858e1bc1448b651
User & Date: shaneh 2010-02-23 20:08:36
Context
2010-02-23
20:32
Merge the compile-time option introspection interfaces into the trunk. check-in: 9f429434 user: drh tags: trunk
20:08
Refactored compile time option diagnostic support to use strings identifiers instead of bitmask. Closed-Leaf check-in: 76a0294a user: shaneh tags: compile_opts
10:56
Fix a segfault that can occur if a malloc fails in ATTACH in shared-cache mode. check-in: 875f8fa3 user: dan tags: compile_opts
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Makefile.in.

200
201
202
203
204
205
206

207
208
209
210
211
212
213
...
335
336
337
338
339
340
341

342
343
344
345
346
347
348
...
538
539
540
541
542
543
544



545
546
547
548
549
550
551
  $(TOP)/src/btmutex.c \
  $(TOP)/src/btree.c \
  $(TOP)/src/btree.h \
  $(TOP)/src/btreeInt.h \
  $(TOP)/src/build.c \
  $(TOP)/src/callback.c \
  $(TOP)/src/complete.c \

  $(TOP)/src/date.c \
  $(TOP)/src/delete.c \
  $(TOP)/src/expr.c \
  $(TOP)/src/fault.c \
  $(TOP)/src/fkey.c \
  $(TOP)/src/func.c \
  $(TOP)/src/global.c \
................................................................................
TESTSRC2 = \
  $(TOP)/src/attach.c \
  $(TOP)/src/backup.c \
  $(TOP)/src/bitvec.c \
  $(TOP)/src/btree.c \
  $(TOP)/src/build.c \
  $(TOP)/src/date.c \

  $(TOP)/src/expr.c \
  $(TOP)/src/func.c \
  $(TOP)/src/insert.c \
  $(TOP)/src/mem5.c \
  $(TOP)/src/os.c \
  $(TOP)/src/os_os2.c \
  $(TOP)/src/os_unix.c \
................................................................................

callback.lo:	$(TOP)/src/callback.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/callback.c

complete.lo:	$(TOP)/src/complete.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/complete.c




date.lo:	$(TOP)/src/date.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/date.c

delete.lo:	$(TOP)/src/delete.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/delete.c

expr.lo:	$(TOP)/src/expr.c $(HDR)







>







 







>







 







>
>
>







200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
...
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
...
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
  $(TOP)/src/btmutex.c \
  $(TOP)/src/btree.c \
  $(TOP)/src/btree.h \
  $(TOP)/src/btreeInt.h \
  $(TOP)/src/build.c \
  $(TOP)/src/callback.c \
  $(TOP)/src/complete.c \
  $(TOP)/src/ctime.c \
  $(TOP)/src/date.c \
  $(TOP)/src/delete.c \
  $(TOP)/src/expr.c \
  $(TOP)/src/fault.c \
  $(TOP)/src/fkey.c \
  $(TOP)/src/func.c \
  $(TOP)/src/global.c \
................................................................................
TESTSRC2 = \
  $(TOP)/src/attach.c \
  $(TOP)/src/backup.c \
  $(TOP)/src/bitvec.c \
  $(TOP)/src/btree.c \
  $(TOP)/src/build.c \
  $(TOP)/src/date.c \
  $(TOP)/src/ctime.c \
  $(TOP)/src/expr.c \
  $(TOP)/src/func.c \
  $(TOP)/src/insert.c \
  $(TOP)/src/mem5.c \
  $(TOP)/src/os.c \
  $(TOP)/src/os_os2.c \
  $(TOP)/src/os_unix.c \
................................................................................

callback.lo:	$(TOP)/src/callback.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/callback.c

complete.lo:	$(TOP)/src/complete.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/complete.c

ctime.lo:	$(TOP)/src/ctime.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/ctime.c

date.lo:	$(TOP)/src/date.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/date.c

delete.lo:	$(TOP)/src/delete.c $(HDR)
	$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/delete.c

expr.lo:	$(TOP)/src/expr.c $(HDR)

Changes to Makefile.vxworks.

227
228
229
230
231
232
233

234
235
236
237
238
239
240
...
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
  $(TOP)/src/btmutex.c \
  $(TOP)/src/btree.c \
  $(TOP)/src/btree.h \
  $(TOP)/src/btreeInt.h \
  $(TOP)/src/build.c \
  $(TOP)/src/callback.c \
  $(TOP)/src/complete.c \

  $(TOP)/src/date.c \
  $(TOP)/src/delete.c \
  $(TOP)/src/expr.c \
  $(TOP)/src/fault.c \
  $(TOP)/src/func.c \
  $(TOP)/src/global.c \
  $(TOP)/src/hash.c \
................................................................................
  $(TOP)/src/test_wsd.c \

#TESTSRC += $(TOP)/ext/fts2/fts2_tokenizer.c
#TESTSRC += $(TOP)/ext/fts3/fts3_tokenizer.c

TESTSRC2 = \
  $(TOP)/src/attach.c $(TOP)/src/backup.c $(TOP)/src/btree.c                   \
  $(TOP)/src/build.c $(TOP)/src/date.c                                         \
  $(TOP)/src/expr.c $(TOP)/src/func.c $(TOP)/src/insert.c $(TOP)/src/os.c      \
  $(TOP)/src/os_os2.c $(TOP)/src/os_unix.c $(TOP)/src/os_win.c                 \
  $(TOP)/src/pager.c $(TOP)/src/pragma.c $(TOP)/src/prepare.c                  \
  $(TOP)/src/printf.c $(TOP)/src/random.c $(TOP)/src/pcache.c                  \
  $(TOP)/src/pcache1.c $(TOP)/src/select.c $(TOP)/src/tokenize.c               \
  $(TOP)/src/utf.c $(TOP)/src/util.c $(TOP)/src/vdbeapi.c $(TOP)/src/vdbeaux.c \
  $(TOP)/src/vdbe.c $(TOP)/src/vdbemem.c $(TOP)/src/where.c parse.c            \







>







 







|







227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
...
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
  $(TOP)/src/btmutex.c \
  $(TOP)/src/btree.c \
  $(TOP)/src/btree.h \
  $(TOP)/src/btreeInt.h \
  $(TOP)/src/build.c \
  $(TOP)/src/callback.c \
  $(TOP)/src/complete.c \
  $(TOP)/src/ctime.c \
  $(TOP)/src/date.c \
  $(TOP)/src/delete.c \
  $(TOP)/src/expr.c \
  $(TOP)/src/fault.c \
  $(TOP)/src/func.c \
  $(TOP)/src/global.c \
  $(TOP)/src/hash.c \
................................................................................
  $(TOP)/src/test_wsd.c \

#TESTSRC += $(TOP)/ext/fts2/fts2_tokenizer.c
#TESTSRC += $(TOP)/ext/fts3/fts3_tokenizer.c

TESTSRC2 = \
  $(TOP)/src/attach.c $(TOP)/src/backup.c $(TOP)/src/btree.c                   \
  $(TOP)/src/build.c $(TOP)/src/ctime.c $(TOP)/src/date.c                      \
  $(TOP)/src/expr.c $(TOP)/src/func.c $(TOP)/src/insert.c $(TOP)/src/os.c      \
  $(TOP)/src/os_os2.c $(TOP)/src/os_unix.c $(TOP)/src/os_win.c                 \
  $(TOP)/src/pager.c $(TOP)/src/pragma.c $(TOP)/src/prepare.c                  \
  $(TOP)/src/printf.c $(TOP)/src/random.c $(TOP)/src/pcache.c                  \
  $(TOP)/src/pcache1.c $(TOP)/src/select.c $(TOP)/src/tokenize.c               \
  $(TOP)/src/utf.c $(TOP)/src/util.c $(TOP)/src/vdbeapi.c $(TOP)/src/vdbeaux.c \
  $(TOP)/src/vdbe.c $(TOP)/src/vdbemem.c $(TOP)/src/where.c parse.c            \

Changes to main.mk.

82
83
84
85
86
87
88

89
90
91
92
93
94
95
  $(TOP)/src/btmutex.c \
  $(TOP)/src/btree.c \
  $(TOP)/src/btree.h \
  $(TOP)/src/btreeInt.h \
  $(TOP)/src/build.c \
  $(TOP)/src/callback.c \
  $(TOP)/src/complete.c \

  $(TOP)/src/date.c \
  $(TOP)/src/delete.c \
  $(TOP)/src/expr.c \
  $(TOP)/src/fault.c \
  $(TOP)/src/fkey.c \
  $(TOP)/src/func.c \
  $(TOP)/src/global.c \







>







82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
  $(TOP)/src/btmutex.c \
  $(TOP)/src/btree.c \
  $(TOP)/src/btree.h \
  $(TOP)/src/btreeInt.h \
  $(TOP)/src/build.c \
  $(TOP)/src/callback.c \
  $(TOP)/src/complete.c \
  $(TOP)/src/ctime.c \
  $(TOP)/src/date.c \
  $(TOP)/src/delete.c \
  $(TOP)/src/expr.c \
  $(TOP)/src/fault.c \
  $(TOP)/src/fkey.c \
  $(TOP)/src/func.c \
  $(TOP)/src/global.c \

Added src/ctime.c.

































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
/*
** 2010 February 23
**
** The author disclaims copyright to this source code.  In place of
** a legal notice, here is a blessing:
**
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
**
** This file implements routines used to report what compile-time options
** SQLite was built with.
*/

#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS

#include "sqliteInt.h"

/*
** An array of names of all compile-time options.
**
** This array looks large, but in a typical installation actually uses
** only a handful of compile-time options, so most this array is usually
** rather short and uses little memory space.
*/
static const char * const azCompileOpt[] = {
#ifdef SQLITE_32BIT_ROWID
  "32BIT_ROWID",
#endif
#ifdef SQLITE_4_BYTE_ALIGNED_MALLOC
  "4_BYTE_ALIGNED_MALLOC",
#endif
#ifdef SQLITE_CASE_SENSITIVE_LIKE
  "CASE_SENSITIVE_LIKE",
#endif
#ifdef SQLITE_CHECK_PAGES
  "CHECK_PAGES",
#endif
#ifdef SQLITE_COVERAGE_TEST
  "COVERAGE_TEST",
#endif
#ifdef SQLITE_DEBUG
  "DEBUG",
#endif
#ifdef SQLITE_DISABLE_DIRSYNC
  "DISABLE_DIRSYNC",
#endif
#ifdef SQLITE_DISABLE_LFS
  "DISABLE_LFS",
#endif
#ifdef SQLITE_ENABLE_ATOMIC_WRITE
  "ENABLE_ATOMIC_WRITE",
#endif
#ifdef SQLITE_ENABLE_CEROD
  "ENABLE_CEROD",
#endif
#ifdef SQLITE_ENABLE_COLUMN_METADATA
  "ENABLE_COLUMN_METADATA",
#endif
#ifdef SQLITE_ENABLE_EXPENSIVE_ASSERT
  "ENABLE_EXPENSIVE_ASSERT",
#endif
#ifdef SQLITE_ENABLE_FTS1
  "ENABLE_FTS1",
#endif
#ifdef SQLITE_ENABLE_FTS2
  "ENABLE_FTS2",
#endif
#ifdef SQLITE_ENABLE_FTS3
  "ENABLE_FTS3",
#endif
#ifdef SQLITE_ENABLE_FTS3_PARENTHESIS
  "ENABLE_FTS3_PARENTHESIS",
#endif
#ifdef SQLITE_ENABLE_FTS4
  "ENABLE_FTS4",
#endif
#ifdef SQLITE_ENABLE_ICU
  "ENABLE_ICU",
#endif
#ifdef SQLITE_ENABLE_IOTRACE
  "ENABLE_IOTRACE",
#endif
#ifdef SQLITE_ENABLE_LOAD_EXTENSION
  "ENABLE_LOAD_EXTENSION",
#endif
#ifdef SQLITE_ENABLE_LOCKING_STYLE
  "ENABLE_LOCKING_STYLE",
#endif
#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
  "ENABLE_MEMORY_MANAGEMENT",
#endif
#ifdef SQLITE_ENABLE_MEMSYS3
  "ENABLE_MEMSYS3",
#endif
#ifdef SQLITE_ENABLE_MEMSYS5
  "ENABLE_MEMSYS5",
#endif
#ifdef SQLITE_ENABLE_OVERSIZE_CELL_CHECK
  "ENABLE_OVERSIZE_CELL_CHECK",
#endif
#ifdef SQLITE_ENABLE_RTREE
  "ENABLE_RTREE",
#endif
#ifdef SQLITE_ENABLE_STAT2
  "ENABLE_STAT2",
#endif
#ifdef SQLITE_ENABLE_UNLOCK_NOTIFY
  "ENABLE_UNLOCK_NOTIFY",
#endif
#ifdef SQLITE_ENABLE_UPDATE_DELETE_LIMIT
  "ENABLE_UPDATE_DELETE_LIMIT",
#endif
#ifdef SQLITE_HAS_CODEC
  "HAS_CODEC",
#endif
#ifdef SQLITE_HAVE_ISNAN
  "HAVE_ISNAN",
#endif
#ifdef SQLITE_HOMEGROWN_RECURSIVE_MUTEX
  "HOMEGROWN_RECURSIVE_MUTEX",
#endif
#ifdef SQLITE_IGNORE_AFP_LOCK_ERRORS
  "IGNORE_AFP_LOCK_ERRORS",
#endif
#ifdef SQLITE_IGNORE_FLOCK_LOCK_ERRORS
  "IGNORE_FLOCK_LOCK_ERRORS",
#endif
#ifdef SQLITE_INT64_TYPE
  "INT64_TYPE",
#endif
#ifdef SQLITE_LOCK_TRACE
  "LOCK_TRACE",
#endif
#ifdef SQLITE_MEMDEBUG
  "MEMDEBUG",
#endif
#ifdef SQLITE_MIXED_ENDIAN_64BIT_FLOAT
  "MIXED_ENDIAN_64BIT_FLOAT",
#endif
#ifdef SQLITE_NO_SYNC
  "NO_SYNC",
#endif
#ifdef SQLITE_OMIT_ALTERTABLE
  "OMIT_ALTERTABLE",
#endif
#ifdef SQLITE_OMIT_ANALYZE
  "OMIT_ANALYZE",
#endif
#ifdef SQLITE_OMIT_ATTACH
  "OMIT_ATTACH",
#endif
#ifdef SQLITE_OMIT_AUTHORIZATION
  "OMIT_AUTHORIZATION",
#endif
#ifdef SQLITE_OMIT_AUTOINCREMENT
  "OMIT_AUTOINCREMENT",
#endif
#ifdef SQLITE_OMIT_AUTOINIT
  "OMIT_AUTOINIT",
#endif
#ifdef SQLITE_OMIT_AUTOVACUUM
  "OMIT_AUTOVACUUM",
#endif
#ifdef SQLITE_OMIT_BETWEEN_OPTIMIZATION
  "OMIT_BETWEEN_OPTIMIZATION",
#endif
#ifdef SQLITE_OMIT_BLOB_LITERAL
  "OMIT_BLOB_LITERAL",
#endif
#ifdef SQLITE_OMIT_BTREECOUNT
  "OMIT_BTREECOUNT",
#endif
#ifdef SQLITE_OMIT_BUILTIN_TEST
  "OMIT_BUILTIN_TEST",
#endif
#ifdef SQLITE_OMIT_CAST
  "OMIT_CAST",
#endif
#ifdef SQLITE_OMIT_CHECK
  "OMIT_CHECK",
#endif
#ifdef SQLITE_OMIT_COMPILEOPTION_DIAGS
  "OMIT_COMPILEOPTION_DIAGS",
#endif
#ifdef SQLITE_OMIT_COMPLETE
  "OMIT_COMPLETE",
#endif
#ifdef SQLITE_OMIT_COMPOUND_SELECT
  "OMIT_COMPOUND_SELECT",
#endif
#ifdef SQLITE_OMIT_DATETIME_FUNCS
  "OMIT_DATETIME_FUNCS",
#endif
#ifdef SQLITE_OMIT_DECLTYPE
  "OMIT_DECLTYPE",
#endif
#ifdef SQLITE_OMIT_DEPRECATED
  "OMIT_DEPRECATED",
#endif
#ifdef SQLITE_OMIT_DISKIO
  "OMIT_DISKIO",
#endif
#ifdef SQLITE_OMIT_EXPLAIN
  "OMIT_EXPLAIN",
#endif
#ifdef SQLITE_OMIT_FLAG_PRAGMAS
  "OMIT_FLAG_PRAGMAS",
#endif
#ifdef SQLITE_OMIT_FLOATING_POINT
  "OMIT_FLOATING_POINT",
#endif
#ifdef SQLITE_OMIT_FOREIGN_KEY
  "OMIT_FOREIGN_KEY",
#endif
#ifdef SQLITE_OMIT_GET_TABLE
  "OMIT_GET_TABLE",
#endif
#ifdef SQLITE_OMIT_GLOBALRECOVER
  "OMIT_GLOBALRECOVER",
#endif
#ifdef SQLITE_OMIT_INCRBLOB
  "OMIT_INCRBLOB",
#endif
#ifdef SQLITE_OMIT_INTEGRITY_CHECK
  "OMIT_INTEGRITY_CHECK",
#endif
#ifdef SQLITE_OMIT_LIKE_OPTIMIZATION
  "OMIT_LIKE_OPTIMIZATION",
#endif
#ifdef SQLITE_OMIT_LOAD_EXTENSION
  "OMIT_LOAD_EXTENSION",
#endif
#ifdef SQLITE_OMIT_LOCALTIME
  "OMIT_LOCALTIME",
#endif
#ifdef SQLITE_OMIT_LOOKASIDE
  "OMIT_LOOKASIDE",
#endif
#ifdef SQLITE_OMIT_MEMORYDB
  "OMIT_MEMORYDB",
#endif
#ifdef SQLITE_OMIT_OR_OPTIMIZATION
  "OMIT_OR_OPTIMIZATION",
#endif
#ifdef SQLITE_OMIT_PAGER_PRAGMAS
  "OMIT_PAGER_PRAGMAS",
#endif
#ifdef SQLITE_OMIT_PRAGMA
  "OMIT_PRAGMA",
#endif
#ifdef SQLITE_OMIT_PROGRESS_CALLBACK
  "OMIT_PROGRESS_CALLBACK",
#endif
#ifdef SQLITE_OMIT_QUICKBALANCE
  "OMIT_QUICKBALANCE",
#endif
#ifdef SQLITE_OMIT_REINDEX
  "OMIT_REINDEX",
#endif
#ifdef SQLITE_OMIT_SCHEMA_PRAGMAS
  "OMIT_SCHEMA_PRAGMAS",
#endif
#ifdef SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS
  "OMIT_SCHEMA_VERSION_PRAGMAS",
#endif
#ifdef SQLITE_OMIT_SHARED_CACHE
  "OMIT_SHARED_CACHE",
#endif
#ifdef SQLITE_OMIT_SUBQUERY
  "OMIT_SUBQUERY",
#endif
#ifdef SQLITE_OMIT_TCL_VARIABLE
  "OMIT_TCL_VARIABLE",
#endif
#ifdef SQLITE_OMIT_TEMPDB
  "OMIT_TEMPDB",
#endif
#ifdef SQLITE_OMIT_TRACE
  "OMIT_TRACE",
#endif
#ifdef SQLITE_OMIT_TRIGGER
  "OMIT_TRIGGER",
#endif
#ifdef SQLITE_OMIT_TRUNCATE_OPTIMIZATION
  "OMIT_TRUNCATE_OPTIMIZATION",
#endif
#ifdef SQLITE_OMIT_UTF16
  "OMIT_UTF16",
#endif
#ifdef SQLITE_OMIT_VACUUM
  "OMIT_VACUUM",
#endif
#ifdef SQLITE_OMIT_VIEW
  "OMIT_VIEW",
#endif
#ifdef SQLITE_OMIT_VIRTUALTABLE
  "OMIT_VIRTUALTABLE",
#endif
#ifdef SQLITE_OMIT_WSD
  "OMIT_WSD",
#endif
#ifdef SQLITE_OMIT_XFER_OPT
  "OMIT_XFER_OPT",
#endif
#ifdef SQLITE_PERFORMANCE_TRACE
  "PERFORMANCE_TRACE",
#endif
#ifdef SQLITE_PROXY_DEBUG
  "PROXY_DEBUG",
#endif
#ifdef SQLITE_SECURE_DELETE
  "SECURE_DELETE",
#endif
#ifdef SQLITE_SMALL_STACK
  "SMALL_STACK",
#endif
#ifdef SQLITE_SOUNDEX
  "SOUNDEX",
#endif
#ifdef SQLITE_TCL
  "TCL",
#endif
#ifdef SQLITE_TEST
  "TEST",
#endif
#ifdef SQLITE_USE_ALLOCA
  "USE_ALLOCA",
#endif
#ifdef SQLITE_ZERO_MALLOC
  "ZERO_MALLOC",
#endif
};

/*
** Given the name of a compile-time option, return true if that option
** was used and false if not.
**
** The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix
** is not required for a match.
*/
int sqlite3_compileoption_used(const char *zOptName){
  int i, n;
  if( sqlite3StrNICmp(zOptName, "SQLITE_", 7)==0 ) zOptName += 7;
  n = sqlite3Strlen30(zOptName);

  /* Since ArraySize(azCompileOpt) is normally in single digits, a
  ** linear search is adequate.  No need for a binary search. */
  for(i=0; i<ArraySize(azCompileOpt); i++){
    if( sqlite3StrNICmp(zOptName, azCompileOpt[i], n+1)==0 ) return 1;
  }
  return 0;
}

/*
** Return the N-th compile-time option string.  If N is out of range,
** return a NULL pointer.
*/
const char * const sqlite3_compileoption_get(int N){
  if( N>=0 && N<ArraySize(azCompileOpt) ){
    return azCompileOpt[N];
  }
  return 0;
}

#endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */

Changes to src/func.c.

771
772
773
774
775
776
777
778

779
780


























781
782
783
784
785


786
787
788

789
790

791
792
793
794
795
796
797
....
1516
1517
1518
1519
1520
1521
1522

1523


1524
1525
1526
1527
1528
1529
1530
  UNUSED_PARAMETER2(NotUsed, NotUsed2);
  /* IMP: R-24470-31136 This function is an SQL wrapper around the
  ** sqlite3_sourceid() C interface. */
  sqlite3_result_text(context, sqlite3_sourceid(), -1, SQLITE_STATIC);
}

/*
** Implementation of the sqlite_compile_opts() function. The result is a string

** that identifies the compiler options used to build SQLite.
*/


























static void compileoptsFunc(
  sqlite3_context *context,
  int NotUsed,
  sqlite3_value **NotUsed2
){


  UNUSED_PARAMETER2(NotUsed, NotUsed2);
  /* IMP: R-xxxx This function is an SQL wrapper around the
  ** sqlite3_compileopts() C interface. */

  sqlite3_result_text(context, sqlite3_compileopts(), -1, SQLITE_STATIC);
}


/* Array for converting from half-bytes (nybbles) into ASCII hex
** digits. */
static const char hexdigits[] = {
  '0', '1', '2', '3', '4', '5', '6', '7',
  '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' 
};
................................................................................
/*  FUNCTION(ifnull,             2, 0, 0, ifnullFunc       ), */
    {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     ),

    FUNCTION(sqlite_compile_opts,0, 0, 0, compileoptsFunc  ),


    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     ),
  #ifdef SQLITE_SOUNDEX







|
>
|

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|

|
|

>
>
|

|
>
|

>







 







>
|
>
>







771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
....
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
  UNUSED_PARAMETER2(NotUsed, NotUsed2);
  /* IMP: R-24470-31136 This function is an SQL wrapper around the
  ** sqlite3_sourceid() C interface. */
  sqlite3_result_text(context, sqlite3_sourceid(), -1, SQLITE_STATIC);
}

/*
** Implementation of the sqlite_compileoption_used() function.
** The result is an integer that identifies if the compiler option
** was used to build SQLite.
*/
#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
static void compileoptionusedFunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  const char *zOptName;
  assert( argc==1 );
  UNUSED_PARAMETER(argc);
  /* IMP: R-xxxx This function is an SQL wrapper around the
  ** sqlite3_compileoption_used() C interface. */
  if (   ( sqlite3_value_type(argv[0])==SQLITE_TEXT )
      && ( (zOptName = sqlite3_value_text(argv[0]))!=0 )){
    sqlite3_result_int(context, sqlite3_compileoption_used(zOptName));
  }else{
    sqlite3_result_null(context);
  }
}
#endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */

/*
** Implementation of the sqlite_compileoption_get() function. 
** The result is a string that identifies the compiler options 
** used to build SQLite.
*/
#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
static void compileoptiongetFunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  int n;
  assert( argc==1 );
  UNUSED_PARAMETER(argc);
  /* IMP: R-xxxx This function is an SQL wrapper around the
  ** sqlite3_compileoption_get() C interface. */
  n = sqlite3_value_int(argv[0]);
  sqlite3_result_text(context, sqlite3_compileoption_get(n), -1, SQLITE_STATIC);
}
#endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */

/* Array for converting from half-bytes (nybbles) into ASCII hex
** digits. */
static const char hexdigits[] = {
  '0', '1', '2', '3', '4', '5', '6', '7',
  '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' 
};
................................................................................
/*  FUNCTION(ifnull,             2, 0, 0, ifnullFunc       ), */
    {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_compile_option_used,1, 0, 0, compileoptionusedFunc  ),
    FUNCTION(sqlite_compile_option_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     ),
  #ifdef SQLITE_SOUNDEX

Changes to src/main.c.

32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
...
713
714
715
716
717
718
719


720



721
722
723
724
725
726
727
#ifndef SQLITE_AMALGAMATION
const char sqlite3_version[] = SQLITE_VERSION;
#endif
const char *sqlite3_libversion(void){ return sqlite3_version; }
const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
int sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
int sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }
const char *sqlite3_compileopts(void){
  static char zOpts[32] = "";
  sqlite_int64 iEnable = 0; /* bitmask of all the SQLITE_ENABLE* defines */
  sqlite_int64 iOmit = 0;   /* bitmask of all the SQLITE_OMIT* defines */
  sqlite_int64 iOther = 0;  /* bitmask of all the SQLITE_* defines except */
                            /*   SQLITE_MAX* and SQLITE_DEF* */

#ifdef SQLITE_32BIT_ROWID
  iOther |= ((sqlite_int64)1<<0);
#endif
#ifdef SQLITE_4_BYTE_ALIGNED_MALLOC
  iOther |= ((sqlite_int64)1<<1);
#endif
#ifdef SQLITE_API
  iOther |= ((sqlite_int64)1<<2);
#endif
#ifdef SQLITE_CASE_SENSITIVE_LIKE
  iOther |= ((sqlite_int64)1<<3);
#endif
#ifdef SQLITE_CHECK_PAGES
  iOther |= ((sqlite_int64)1<<4);
#endif
#ifdef SQLITE_COVERAGE_TEST
  iOther |= ((sqlite_int64)1<<5);
#endif
#ifdef SQLITE_DEBUG
  iOther |= ((sqlite_int64)1<<6);
#endif
#ifdef SQLITE_DISABLE_DIRSYNC
  iOther |= ((sqlite_int64)1<<7);
#endif
#ifdef SQLITE_DISABLE_LFS
  iOther |= ((sqlite_int64)1<<8);
#endif
#ifdef SQLITE_ENABLE_ATOMIC_WRITE
  iEnable |= ((sqlite_int64)1<<0);
#endif
#ifdef SQLITE_ENABLE_CEROD
  iEnable |= ((sqlite_int64)1<<1);
#endif
#ifdef SQLITE_ENABLE_COLUMN_METADATA
  iEnable |= ((sqlite_int64)1<<2);
#endif
#ifdef SQLITE_ENABLE_EXPENSIVE_ASSERT
  iEnable |= ((sqlite_int64)1<<3);
#endif
#ifdef SQLITE_ENABLE_FTS1
  iEnable |= ((sqlite_int64)1<<4);
#endif
#ifdef SQLITE_ENABLE_FTS2
  iEnable |= ((sqlite_int64)1<<5);
#endif
#ifdef SQLITE_ENABLE_FTS3
  iEnable |= ((sqlite_int64)1<<6);
#endif
#ifdef SQLITE_ENABLE_FTS3_PARENTHESIS
  iEnable |= ((sqlite_int64)1<<7);
#endif
#ifdef SQLITE_ENABLE_FTS4
  iEnable |= ((sqlite_int64)1<<8);
#endif
#ifdef SQLITE_ENABLE_ICU
  iEnable |= ((sqlite_int64)1<<9);
#endif
#ifdef SQLITE_ENABLE_IOTRACE
  iEnable |= ((sqlite_int64)1<<10);
#endif
#ifdef SQLITE_ENABLE_LOAD_EXTENSION
  iEnable |= ((sqlite_int64)1<<11);
#endif
#ifdef SQLITE_ENABLE_LOCKING_STYLE
  iEnable |= ((sqlite_int64)1<<12);
#endif
#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
  iEnable |= ((sqlite_int64)1<<13);
#endif
#ifdef SQLITE_ENABLE_MEMSYS3
  iEnable |= ((sqlite_int64)1<<14);
#endif
#ifdef SQLITE_ENABLE_MEMSYS5
  iEnable |= ((sqlite_int64)1<<15);
#endif
#ifdef SQLITE_ENABLE_OVERSIZE_CELL_CHECK
  iEnable |= ((sqlite_int64)1<<16);
#endif
#ifdef SQLITE_ENABLE_RTREE
  iEnable |= ((sqlite_int64)1<<17);
#endif
#ifdef SQLITE_ENABLE_STAT2
  iEnable |= ((sqlite_int64)1<<18);
#endif
#ifdef SQLITE_ENABLE_UNLOCK_NOTIFY
  iEnable |= ((sqlite_int64)1<<19);
#endif
#ifdef SQLITE_ENABLE_UPDATE_DELETE_LIMIT
  iEnable |= ((sqlite_int64)1<<20);
#endif
#ifdef SQLITE_HAS_CODEC
  iOther |= ((sqlite_int64)1<<9);
#endif
#ifdef SQLITE_HAVE_ISNAN
  iOther |= ((sqlite_int64)1<<10);
#endif
#ifdef SQLITE_HOMEGROWN_RECURSIVE_MUTEX
  iOther |= ((sqlite_int64)1<<11);
#endif
#ifdef SQLITE_IGNORE_AFP_LOCK_ERRORS
  iOther |= ((sqlite_int64)1<<12);
#endif
#ifdef SQLITE_IGNORE_FLOCK_LOCK_ERRORS
  iOther |= ((sqlite_int64)1<<13);
#endif
#ifdef SQLITE_INT64_TYPE
  iOther |= ((sqlite_int64)1<<14);
#endif
#ifdef SQLITE_LOCK_TRACE
  iOther |= ((sqlite_int64)1<<15);
#endif
#ifdef SQLITE_MEMDEBUG
  iOther |= ((sqlite_int64)1<<16);
#endif
#ifdef SQLITE_MIXED_ENDIAN_64BIT_FLOAT
  iOther |= ((sqlite_int64)1<<17);
#endif
#ifdef SQLITE_MUTEX_NOOP
  iOther |= ((sqlite_int64)1<<18);
#endif
#ifdef SQLITE_MUTEX_OMIT
  iOther |= ((sqlite_int64)1<<19);
#endif
#ifdef SQLITE_MUTEX_OS2
  iOther |= ((sqlite_int64)1<<20);
#endif
#ifdef SQLITE_MUTEX_PTHREADS
  iOther |= ((sqlite_int64)1<<21);
#endif
#ifdef SQLITE_MUTEX_W32
  iOther |= ((sqlite_int64)1<<22);
#endif
#ifdef SQLITE_NO_SYNC
  iOther |= ((sqlite_int64)1<<23);
#endif
#ifdef SQLITE_OMIT_ALTERTABLE
  iOmit |= ((sqlite_int64)1<<0);
#endif
#ifdef SQLITE_OMIT_ANALYZE
  iOmit |= ((sqlite_int64)1<<1);
#endif
#ifdef SQLITE_OMIT_ATTACH
  iOmit |= ((sqlite_int64)1<<2);
#endif
#ifdef SQLITE_OMIT_AUTHORIZATION
  iOmit |= ((sqlite_int64)1<<3);
#endif
#ifdef SQLITE_OMIT_AUTOINCREMENT
  iOmit |= ((sqlite_int64)1<<4);
#endif
#ifdef SQLITE_OMIT_AUTOINIT
  iOmit |= ((sqlite_int64)1<<5);
#endif
#ifdef SQLITE_OMIT_AUTOVACUUM
  iOmit |= ((sqlite_int64)1<<6);
#endif
#ifdef SQLITE_OMIT_BETWEEN_OPTIMIZATION
  iOmit |= ((sqlite_int64)1<<7);
#endif
#ifdef SQLITE_OMIT_BLOB_LITERAL
  iOmit |= ((sqlite_int64)1<<8);
#endif
#ifdef SQLITE_OMIT_BTREECOUNT
  iOmit |= ((sqlite_int64)1<<9);
#endif
#ifdef SQLITE_OMIT_BUILTIN_TEST
  iOmit |= ((sqlite_int64)1<<10);
#endif
#ifdef SQLITE_OMIT_CAST
  iOmit |= ((sqlite_int64)1<<11);
#endif
#ifdef SQLITE_OMIT_CHECK
  iOmit |= ((sqlite_int64)1<<12);
#endif
#ifdef SQLITE_OMIT_COMPLETE
  iOmit |= ((sqlite_int64)1<<13);
#endif
#ifdef SQLITE_OMIT_COMPOUND_SELECT
  iOmit |= ((sqlite_int64)1<<14);
#endif
#ifdef SQLITE_OMIT_DATETIME_FUNCS
  iOmit |= ((sqlite_int64)1<<15);
#endif
#ifdef SQLITE_OMIT_DECLTYPE
  iOmit |= ((sqlite_int64)1<<16);
#endif
#ifdef SQLITE_OMIT_DEPRECATED
  iOmit |= ((sqlite_int64)1<<17);
#endif
#ifdef SQLITE_OMIT_DISKIO
  iOmit |= ((sqlite_int64)1<<18);
#endif
#ifdef SQLITE_OMIT_EXPLAIN
  iOmit |= ((sqlite_int64)1<<19);
#endif
#ifdef SQLITE_OMIT_FLAG_PRAGMAS
  iOmit |= ((sqlite_int64)1<<20);
#endif
#ifdef SQLITE_OMIT_FLOATING_POINT
  iOmit |= ((sqlite_int64)1<<21);
#endif
#ifdef SQLITE_OMIT_FOREIGN_KEY
  iOmit |= ((sqlite_int64)1<<22);
#endif
#ifdef SQLITE_OMIT_GET_TABLE
  iOmit |= ((sqlite_int64)1<<23);
#endif
#ifdef SQLITE_OMIT_GLOBALRECOVER
  iOmit |= ((sqlite_int64)1<<24);
#endif
#ifdef SQLITE_OMIT_INCRBLOB
  iOmit |= ((sqlite_int64)1<<25);
#endif
#ifdef SQLITE_OMIT_INTEGRITY_CHECK
  iOmit |= ((sqlite_int64)1<<26);
#endif
#ifdef SQLITE_OMIT_LIKE_OPTIMIZATION
  iOmit |= ((sqlite_int64)1<<27);
#endif
#ifdef SQLITE_OMIT_LOAD_EXTENSION
  iOmit |= ((sqlite_int64)1<<28);
#endif
#ifdef SQLITE_OMIT_LOCALTIME
  iOmit |= ((sqlite_int64)1<<29);
#endif
#ifdef SQLITE_OMIT_LOOKASIDE
  iOmit |= ((sqlite_int64)1<<30);
#endif
#ifdef SQLITE_OMIT_MEMORYDB
  iOmit |= ((sqlite_int64)1<<31);
#endif
#ifdef SQLITE_OMIT_OR_OPTIMIZATION
  iOmit |= ((sqlite_int64)1<<32);
#endif
#ifdef SQLITE_OMIT_PAGER_PRAGMAS
  iOmit |= ((sqlite_int64)1<<33);
#endif
#ifdef SQLITE_OMIT_PRAGMA
  iOmit |= ((sqlite_int64)1<<34);
#endif
#ifdef SQLITE_OMIT_PROGRESS_CALLBACK
  iOmit |= ((sqlite_int64)1<<35);
#endif
#ifdef SQLITE_OMIT_QUICKBALANCE
  iOmit |= ((sqlite_int64)1<<36);
#endif
#ifdef SQLITE_OMIT_REINDEX
  iOmit |= ((sqlite_int64)1<<37);
#endif
#ifdef SQLITE_OMIT_SCHEMA_PRAGMAS
  iOmit |= ((sqlite_int64)1<<38);
#endif
#ifdef SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS
  iOmit |= ((sqlite_int64)1<<39);
#endif
#ifdef SQLITE_OMIT_SHARED_CACHE
  iOmit |= ((sqlite_int64)1<<40);
#endif
#ifdef SQLITE_OMIT_SUBQUERY
  iOmit |= ((sqlite_int64)1<<41);
#endif
#ifdef SQLITE_OMIT_TCL_VARIABLE
  iOmit |= ((sqlite_int64)1<<42);
#endif
#ifdef SQLITE_OMIT_TEMPDB
  iOmit |= ((sqlite_int64)1<<43);
#endif
#ifdef SQLITE_OMIT_TRACE
  iOmit |= ((sqlite_int64)1<<44);
#endif
#ifdef SQLITE_OMIT_TRIGGER
  iOmit |= ((sqlite_int64)1<<45);
#endif
#ifdef SQLITE_OMIT_TRUNCATE_OPTIMIZATION
  iOmit |= ((sqlite_int64)1<<46);
#endif
#ifdef SQLITE_OMIT_UTF16
  iOmit |= ((sqlite_int64)1<<47);
#endif
#ifdef SQLITE_OMIT_VACUUM
  iOmit |= ((sqlite_int64)1<<48);
#endif
#ifdef SQLITE_OMIT_VIEW
  iOmit |= ((sqlite_int64)1<<49);
#endif
#ifdef SQLITE_OMIT_VIRTUALTABLE
  iOmit |= ((sqlite_int64)1<<50);
#endif
#ifdef SQLITE_OMIT_WSD
  iOmit |= ((sqlite_int64)1<<51);
#endif
#ifdef SQLITE_OMIT_XFER_OPT
  iOmit |= ((sqlite_int64)1<<52);
#endif
#ifdef SQLITE_PERFORMANCE_TRACE
  iOther |= ((sqlite_int64)1<<24);
#endif
#ifdef SQLITE_PROXY_DEBUG
  iOther |= ((sqlite_int64)1<<25);
#endif
#ifdef SQLITE_SECURE_DELETE
  iOther |= ((sqlite_int64)1<<26);
#endif
#ifdef SQLITE_SMALL_STACK
  iOther |= ((sqlite_int64)1<<27);
#endif
#ifdef SQLITE_SOUNDEX
  iOther |= ((sqlite_int64)1<<28);
#endif
#ifdef SQLITE_TCL
  iOther |= ((sqlite_int64)1<<29);
#endif
#ifdef SQLITE_TEST
  iOther |= ((sqlite_int64)1<<30);
#endif
#ifdef SQLITE_USE_ALLOCA
  iOther |= ((sqlite_int64)1<<31);
#endif
#ifdef SQLITE_ZERO_MALLOC
  iOther |= ((sqlite_int64)1<<32);
#endif

  sqlite3_snprintf(sizeof(zOpts)-1, zOpts, 
                   "%016llx%016llx%016llx", iEnable, iOmit, iOther);
  return zOpts;
}

#if !defined(SQLITE_OMIT_TRACE) && defined(SQLITE_ENABLE_IOTRACE)
/*
** If the following function pointer is not NULL and if
** SQLITE_ENABLE_IOTRACE is enabled, then messages describing
** I/O active are written using this function.  These messages
** are intended for debugging activity only.
................................................................................
    }
    
    /* Record a pointer to the logger funcction and its first argument.
    ** The default is NULL.  Logging is disabled if the function pointer is
    ** NULL.
    */
    case SQLITE_CONFIG_LOG: {


      sqlite3GlobalConfig.xLog = va_arg(ap, void(*)(void*,int,const char*));



      sqlite3GlobalConfig.pLogArg = va_arg(ap, void*);
      break;
    }

    default: {
      rc = SQLITE_ERROR;
      break;







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







>
>
|
>
>
>







32
33
34
35
36
37
38













































































































































































































































































































































39
40
41
42
43
44
45
...
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
#ifndef SQLITE_AMALGAMATION
const char sqlite3_version[] = SQLITE_VERSION;
#endif
const char *sqlite3_libversion(void){ return sqlite3_version; }
const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
int sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
int sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; }














































































































































































































































































































































#if !defined(SQLITE_OMIT_TRACE) && defined(SQLITE_ENABLE_IOTRACE)
/*
** If the following function pointer is not NULL and if
** SQLITE_ENABLE_IOTRACE is enabled, then messages describing
** I/O active are written using this function.  These messages
** are intended for debugging activity only.
................................................................................
    }
    
    /* Record a pointer to the logger funcction and its first argument.
    ** The default is NULL.  Logging is disabled if the function pointer is
    ** NULL.
    */
    case SQLITE_CONFIG_LOG: {
      /* MSVC is picky about pulling func ptrs from va lists.
      ** http://support.microsoft.com/kb/47961
      ** sqlite3GlobalConfig.xLog = va_arg(ap, void(*)(void*,int,const char*));
      */
      typedef void(*LOGFUNC_t)(void*,int,const char*);
      sqlite3GlobalConfig.xLog = va_arg(ap, LOGFUNC_t);
      sqlite3GlobalConfig.pLogArg = va_arg(ap, void*);
      break;
    }

    default: {
      rc = SQLITE_ERROR;
      break;

Changes to src/pragma.c.

1355
1356
1357
1358
1359
1360
1361




























1362
1363
1364
1365
1366
1367
1368
      sqlite3VdbeChangeP3(v, addr+1, iCookie);
      sqlite3VdbeSetNumCols(v, 1);
      sqlite3VdbeSetColName(v, 0, COLNAME_NAME, zLeft, SQLITE_TRANSIENT);
    }
  }else
#endif /* SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS */





























#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST)
  /*
  ** Report the current state of file logs for all databases
  */
  if( sqlite3StrICmp(zLeft, "lock_status")==0 ){
    static const char *const azLockName[] = {
      "unlocked", "shared", "reserved", "pending", "exclusive"







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
      sqlite3VdbeChangeP3(v, addr+1, iCookie);
      sqlite3VdbeSetNumCols(v, 1);
      sqlite3VdbeSetColName(v, 0, COLNAME_NAME, zLeft, SQLITE_TRANSIENT);
    }
  }else
#endif /* SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS */

#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
  /*
  **   PRAGMA compile_options
  **   PRAGMA compile_option(<option>)
  **
  ** The first form returns a single row for each option that was 
  ** defined at compile time.  The second form returns 0 or 1 
  ** indicating whether the specified option was defined at 
  ** compile time.
  */
  if( sqlite3StrICmp(zLeft, "compile_option")==0 && zRight ){
    int used = sqlite3_compileoption_used(zRight);
    returnSingleInt(pParse, zRight, used);
  }else

  if( sqlite3StrICmp(zLeft, "compile_options")==0 && !zRight ){
    int i = 0;
    const char *zOpt;
    sqlite3VdbeSetNumCols(v, 1);
    pParse->nMem = 1;
    sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "compile_option", SQLITE_STATIC);
    while( (zOpt = sqlite3_compileoption_get(i++))!=0 ){
      sqlite3VdbeAddOp4(v, OP_String8, 0, 1, 0, zOpt, 0);
      sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 1);
    }
  }else
#endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */

#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST)
  /*
  ** Report the current state of file logs for all databases
  */
  if( sqlite3StrICmp(zLeft, "lock_status")==0 ){
    static const char *const azLockName[] = {
      "unlocked", "shared", "reserved", "pending", "exclusive"

Changes to src/sqlite.h.in.

104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
...
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
*/
#define SQLITE_VERSION        "--VERS--"
#define SQLITE_VERSION_NUMBER --VERSION-NUMBER--
#define SQLITE_SOURCE_ID      "--SOURCE-ID--"

/*
** CAPI3REF: Run-Time Library Version Numbers
** KEYWORDS: sqlite3_version
**
** These interfaces provide the same information as the [SQLITE_VERSION],
** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
** but are associated with the library instead of the header file.  ^(Cautious
** programmers might include assert() statements in their application to
** verify that values returned by these interfaces match the macros in
** the header, and thus insure that the application is
................................................................................
** macro.  ^The sqlite3_libversion() function returns a pointer to the
** to the sqlite3_version[] string constant.  The sqlite3_libversion()
** function is provided for use in DLLs since DLL users usually do not have
** direct access to string constants within the DLL.  ^The
** sqlite3_libversion_number() function returns an integer equal to
** [SQLITE_VERSION_NUMBER].  ^The sqlite3_sourceid() function returns 
** a pointer to a string constant whose value is the same as the 
** [SQLITE_SOURCE_ID] C preprocessor macro.  ^The sqlite3_compileopts() 
** function returns a pointer to a string constant whose value describes
** the compiler options used.
**
** See also: [sqlite_version()], [sqlite_source_id()], 
** and [sqlite_compile_opts()].
*/
SQLITE_EXTERN const char sqlite3_version[];
const char *sqlite3_libversion(void);
const char *sqlite3_sourceid(void);
int sqlite3_libversion_number(void);















const char *sqlite3_compileopts(void);












/*
** CAPI3REF: Test To See If The Library Is Threadsafe
**
** ^The sqlite3_threadsafe() function returns zero if and only if
** SQLite was compiled mutexing code omitted due to the
** [SQLITE_THREADSAFE] compile-time option being set to 0.







|







 







|
<
<

|
<





>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>







104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
...
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
*/
#define SQLITE_VERSION        "--VERS--"
#define SQLITE_VERSION_NUMBER --VERSION-NUMBER--
#define SQLITE_SOURCE_ID      "--SOURCE-ID--"

/*
** CAPI3REF: Run-Time Library Version Numbers
** KEYWORDS: sqlite3_version, sqlite3_sourceid
**
** These interfaces provide the same information as the [SQLITE_VERSION],
** [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros
** but are associated with the library instead of the header file.  ^(Cautious
** programmers might include assert() statements in their application to
** verify that values returned by these interfaces match the macros in
** the header, and thus insure that the application is
................................................................................
** macro.  ^The sqlite3_libversion() function returns a pointer to the
** to the sqlite3_version[] string constant.  The sqlite3_libversion()
** function is provided for use in DLLs since DLL users usually do not have
** direct access to string constants within the DLL.  ^The
** sqlite3_libversion_number() function returns an integer equal to
** [SQLITE_VERSION_NUMBER].  ^The sqlite3_sourceid() function returns 
** a pointer to a string constant whose value is the same as the 
** [SQLITE_SOURCE_ID] C preprocessor macro.


**
** See also: [sqlite_version()] and [sqlite_source_id()].

*/
SQLITE_EXTERN const char sqlite3_version[];
const char *sqlite3_libversion(void);
const char *sqlite3_sourceid(void);
int sqlite3_libversion_number(void);

/*
** CAPI3REF: Run-Time Library Compilation Options Diagnostics
** KEYWORDS: sqlite3_compileoption_used, sqlite3_compileoption_get
**
** ^The sqlite3_compileoption_used() function returns 0 or 1 
** indicating whether the specified option was defined at 
** compile time.  ^The SQLITE_ prefix may be omitted from the 
** option name passed to sqlite3_compileoption_used().  
**
** ^The sqlite3_compileoption_get() function allows interating
** over the list of options that were defined at compile time by
** returning the N-th compile time option string.  ^If N is out of range,
** sqlite3_compileoption_get() returns a NULL pointer.  ^The SQLITE_ 
** prefix is omitted from any strings returned by 
** sqlite3_compileoption_get().
**
** ^Support for the diagnostic functions sqlite3_compileoption_used()
** and sqlite3_compileoption_get() may be omitted by specifing the 
** SQLITE_OMIT_COMPILEOPTION_DIAGS option at compile time.
**
** See also: [sqlite_compile_option_used()] and [sqlite_compile_option_get()].
*/
#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
int sqlite3_compileoption_used(const char *zOptName);
const char * const sqlite3_compileoption_get(int N);
#endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */

/*
** CAPI3REF: Test To See If The Library Is Threadsafe
**
** ^The sqlite3_threadsafe() function returns zero if and only if
** SQLite was compiled mutexing code omitted due to the
** [SQLITE_THREADSAFE] compile-time option being set to 0.

Changes to tool/mksqlite3c.tcl.

262
263
264
265
266
267
268

269
270
271
272
273
274
275
   expr.c
   alter.c
   analyze.c
   attach.c
   auth.c
   build.c
   callback.c

   delete.c
   func.c
   fkey.c
   insert.c
   legacy.c
   loadext.c
   pragma.c







>







262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
   expr.c
   alter.c
   analyze.c
   attach.c
   auth.c
   build.c
   callback.c
   ctime.c
   delete.c
   func.c
   fkey.c
   insert.c
   legacy.c
   loadext.c
   pragma.c