/ Check-in [833da702]
Login

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

Overview
Comment:Removed checking of some compile options from the sqlite3_compileopts() API.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | compile_opts
Files: files | file ages | folders
SHA1: 833da702ff9bd99d62640756d80e094256efff5c
User & Date: shaneh 2010-02-23 05:17:52
Context
2010-02-23
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
05:17
Removed checking of some compile options from the sqlite3_compileopts() API. check-in: 833da702 user: shaneh tags: compile_opts
04:19
Test new api to report which options (defines) were used to compile SQLite. check-in: 84c97569 user: shaneh tags: compile_opts
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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
...
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
...
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
#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_AMALGAMATION
  iOther |= ((sqlite_int64)1<<2);
#endif
#ifdef SQLITE_API
  iOther |= ((sqlite_int64)1<<3);
#endif
#ifdef SQLITE_ASCII
  iOther |= ((sqlite_int64)1<<4);
#endif
#ifdef SQLITE_BIG_DBL
  iOther |= ((sqlite_int64)1<<5);
#endif
#ifdef SQLITE_CASE_SENSITIVE_LIKE
  iOther |= ((sqlite_int64)1<<6);
#endif
#ifdef SQLITE_CHECK_PAGES
  iOther |= ((sqlite_int64)1<<7);
#endif
#ifdef SQLITE_CORE
  iOther |= ((sqlite_int64)1<<8);
#endif
#ifdef SQLITE_COVERAGE_TEST
  iOther |= ((sqlite_int64)1<<9);
#endif
#ifdef SQLITE_DEBUG
  iOther |= ((sqlite_int64)1<<10);
#endif
#ifdef SQLITE_DISABLE_DIRSYNC
  iOther |= ((sqlite_int64)1<<11);
#endif
#ifdef SQLITE_DISABLE_LFS
  iOther |= ((sqlite_int64)1<<12);
#endif
#ifdef SQLITE_EBCDIC
  iOther |= ((sqlite_int64)1<<13);
#endif
#ifdef SQLITE_ENABLE_ATOMIC_WRITE
  iEnable |= ((sqlite_int64)1<<0);
#endif
#ifdef SQLITE_ENABLE_CEROD
  iEnable |= ((sqlite_int64)1<<1);
#endif
................................................................................
#endif
#ifdef SQLITE_ENABLE_FTS2
  iEnable |= ((sqlite_int64)1<<5);
#endif
#ifdef SQLITE_ENABLE_FTS3
  iEnable |= ((sqlite_int64)1<<6);
#endif



#ifdef SQLITE_ENABLE_FTS4
  iEnable |= ((sqlite_int64)1<<7);
#endif
#ifdef SQLITE_ENABLE_ICU
  iEnable |= ((sqlite_int64)1<<8);
#endif
#ifdef SQLITE_ENABLE_IOTRACE
  iEnable |= ((sqlite_int64)1<<9);
#endif
#ifdef SQLITE_ENABLE_LOAD_EXTENSION
  iEnable |= ((sqlite_int64)1<<10);
#endif
#ifdef SQLITE_ENABLE_LOCKING_STYLE
  iEnable |= ((sqlite_int64)1<<11);
#endif
#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
  iEnable |= ((sqlite_int64)1<<12);
#endif
#ifdef SQLITE_ENABLE_MEMSYS3
  iEnable |= ((sqlite_int64)1<<13);
#endif
#ifdef SQLITE_ENABLE_MEMSYS5
  iEnable |= ((sqlite_int64)1<<14);
#endif
#ifdef SQLITE_ENABLE_OVERSIZE_CELL_CHECK
  iEnable |= ((sqlite_int64)1<<15);
#endif
#ifdef SQLITE_ENABLE_RTREE
  iEnable |= ((sqlite_int64)1<<16);
#endif
#ifdef SQLITE_ENABLE_STAT2
  iEnable |= ((sqlite_int64)1<<17);
#endif
#ifdef SQLITE_ENABLE_UNLOCK_NOTIFY
  iEnable |= ((sqlite_int64)1<<18);
#endif
#ifdef SQLITE_ENABLE_UPDATE_DELETE_LIMIT
  iEnable |= ((sqlite_int64)1<<19);
#endif
#ifdef SQLITE_EXTERN
  iOther |= ((sqlite_int64)1<<14);
#endif
#ifdef SQLITE_FILE_HEADER
  iOther |= ((sqlite_int64)1<<15);
#endif
#ifdef SQLITE_HAS_CODEC
  iOther |= ((sqlite_int64)1<<16);
#endif
#ifdef SQLITE_HAVE_ISNAN
  iOther |= ((sqlite_int64)1<<17);
#endif
#ifdef SQLITE_HOMEGROWN_RECURSIVE_MUTEX
  iOther |= ((sqlite_int64)1<<18);
#endif
#ifdef SQLITE_IGNORE_AFP_LOCK_ERRORS
  iOther |= ((sqlite_int64)1<<19);
#endif
#ifdef SQLITE_IGNORE_FLOCK_LOCK_ERRORS
  iOther |= ((sqlite_int64)1<<20);
#endif
#ifdef SQLITE_INT64_TYPE
  iOther |= ((sqlite_int64)1<<21);
#endif
#ifdef SQLITE_INTEGRITY_CHECK_ERROR_MAX
  iOther |= ((sqlite_int64)1<<22);
#endif
#ifdef SQLITE_LOCK_TRACE
  iOther |= ((sqlite_int64)1<<23);
#endif
#ifdef SQLITE_MALLOC_SOFT_LIMIT
  iOther |= ((sqlite_int64)1<<24);
#endif
#ifdef SQLITE_MEMDEBUG
  iOther |= ((sqlite_int64)1<<25);
#endif
#ifdef SQLITE_MIXED_ENDIAN_64BIT_FLOAT
  iOther |= ((sqlite_int64)1<<26);
#endif
#ifdef SQLITE_MUTEX_NOOP
  iOther |= ((sqlite_int64)1<<27);
#endif
#ifdef SQLITE_MUTEX_OMIT
  iOther |= ((sqlite_int64)1<<28);
#endif
#ifdef SQLITE_MUTEX_OS2
  iOther |= ((sqlite_int64)1<<29);
#endif
#ifdef SQLITE_MUTEX_PTHREADS
  iOther |= ((sqlite_int64)1<<30);
#endif
#ifdef SQLITE_MUTEX_W32
  iOther |= ((sqlite_int64)1<<31);
#endif
#ifdef SQLITE_NO_SYNC
  iOther |= ((sqlite_int64)1<<32);
#endif
#ifdef SQLITE_N_COLCACHE
  iOther |= ((sqlite_int64)1<<33);
#endif
#ifdef SQLITE_N_KEYWORD
  iOther |= ((sqlite_int64)1<<34);
#endif
#ifdef SQLITE_OMIT_ALTERTABLE
  iOmit |= ((sqlite_int64)1<<0);
#endif
#ifdef SQLITE_OMIT_ANALYZE
  iOmit |= ((sqlite_int64)1<<1);
#endif
................................................................................
#endif
#ifdef SQLITE_OMIT_WSD
  iOmit |= ((sqlite_int64)1<<51);
#endif
#ifdef SQLITE_OMIT_XFER_OPT
  iOmit |= ((sqlite_int64)1<<52);
#endif
#ifdef SQLITE_OS_OTHER
  iOther |= ((sqlite_int64)1<<35);
#endif
#ifdef SQLITE_OS_UNIX
  iOther |= ((sqlite_int64)1<<36);
#endif
#ifdef SQLITE_PERFORMANCE_TRACE
  iOther |= ((sqlite_int64)1<<37);
#endif
#ifdef SQLITE_PRINT_BUF_SIZE
  iOther |= ((sqlite_int64)1<<38);
#endif
#ifdef SQLITE_PRIVATE
  iOther |= ((sqlite_int64)1<<39);
#endif
#ifdef SQLITE_PROXY_DEBUG
  iOther |= ((sqlite_int64)1<<40);
#endif
#ifdef SQLITE_SECURE_DELETE
  iOther |= ((sqlite_int64)1<<41);
#endif
#ifdef SQLITE_SMALL_STACK
  iOther |= ((sqlite_int64)1<<42);
#endif
#ifdef SQLITE_SOUNDEX
  iOther |= ((sqlite_int64)1<<43);
#endif
#ifdef SQLITE_SYSTEM_MALLOC
  iOther |= ((sqlite_int64)1<<44);
#endif
#ifdef SQLITE_TCL
  iOther |= ((sqlite_int64)1<<45);
#endif
#ifdef SQLITE_TEMP_FILE_PREFIX
  iOther |= ((sqlite_int64)1<<46);
#endif
#ifdef SQLITE_TEMP_STORE
  iOther |= ((sqlite_int64)1<<47);
#endif
#ifdef SQLITE_TEST
  iOther |= ((sqlite_int64)1<<48);
#endif
#ifdef SQLITE_TEXT
  iOther |= ((sqlite_int64)1<<49);
#endif
#ifdef SQLITE_THREADSAFE
  iOther |= ((sqlite_int64)1<<50);
#endif
#ifdef SQLITE_USE_ALLOCA
  iOther |= ((sqlite_int64)1<<51);
#endif
#ifdef SQLITE_VERSION
  iOther |= ((sqlite_int64)1<<52);
#endif
#ifdef SQLITE_VERSION_NUMBER
  iOther |= ((sqlite_int64)1<<53);
#endif
#ifdef SQLITE_ZERO_MALLOC
  iOther |= ((sqlite_int64)1<<54);
#endif

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








|












<
<
<
|
|
|
<
<
<
<
<
<
|
|
|
|
|
|
<
<
<
|
|
|
|
|
|
|
|
|
|
|
<
<
<







 







>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
<
<
<
<
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
<
<
|
|
|
<
<
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
<
<
<
<
<







 







<
<
<
<
<
<
|
|
|
<
<
<
<
<
<
|
|
|
|
|
|
|
|
|
|
|
|
<
<
<
|
|
|
<
<
<
<
<
<
|
|
|
<
<
<
<
<
<
|
|
|
<
<
<
<
<
<
|
|







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
..
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
...
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
#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
................................................................................
#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
................................................................................
#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;
}