Fossil SCM
Update SQLite to pre-3.6.23 that leaves SQLITE_ENABLE_LOCKING_STYLE turned off by default. This should help it to build correctly on Tiger. Ticket [8b3c5d30f7e6]
Commit
73223b8bd62bab67360fdf8e16dc82d216fd5ab7
Parent
63d31b0448b3d25…
2 files changed
+121
-82
+12
-6
+121
-82
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -313,41 +313,38 @@ | ||
| 313 | 313 | ** and with SQLITE_ENABLE_STAT2 |
| 314 | 314 | */ |
| 315 | 315 | #define SQLITE_INDEX_SAMPLES 10 |
| 316 | 316 | |
| 317 | 317 | /* |
| 318 | -** This macro is used to "hide" some ugliness in casting an int | |
| 319 | -** value to a ptr value under the MSVC 64-bit compiler. Casting | |
| 320 | -** non 64-bit values to ptr types results in a "hard" error with | |
| 321 | -** the MSVC 64-bit compiler which this attempts to avoid. | |
| 322 | -** | |
| 323 | -** A simple compiler pragma or casting sequence could not be found | |
| 324 | -** to correct this in all situations, so this macro was introduced. | |
| 325 | -** | |
| 326 | -** It could be argued that the intptr_t type could be used in this | |
| 327 | -** case, but that type is not available on all compilers, or | |
| 328 | -** requires the #include of specific headers which differs between | |
| 329 | -** platforms. | |
| 318 | +** The following macros are used to cast pointers to integers and | |
| 319 | +** integers to pointers. The way you do this varies from one compiler | |
| 320 | +** to the next, so we have developed the following set of #if statements | |
| 321 | +** to generate appropriate macros for a wide range of compilers. | |
| 322 | +** | |
| 323 | +** The correct "ANSI" way to do this is to use the intptr_t type. | |
| 324 | +** Unfortunately, that typedef is not available on all compilers, or | |
| 325 | +** if it is available, it requires an #include of specific headers | |
| 326 | +** that very from one machine to the next. | |
| 330 | 327 | ** |
| 331 | 328 | ** Ticket #3860: The llvm-gcc-4.2 compiler from Apple chokes on |
| 332 | 329 | ** the ((void*)&((char*)0)[X]) construct. But MSVC chokes on ((void*)(X)). |
| 333 | 330 | ** So we have to define the macros in different ways depending on the |
| 334 | 331 | ** compiler. |
| 335 | 332 | */ |
| 336 | -#if defined(__GNUC__) | |
| 337 | -# if defined(HAVE_STDINT_H) | |
| 338 | -# define SQLITE_INT_TO_PTR(X) ((void*)(intptr_t)(X)) | |
| 339 | -# define SQLITE_PTR_TO_INT(X) ((int)(intptr_t)(X)) | |
| 340 | -# else | |
| 341 | -# define SQLITE_INT_TO_PTR(X) ((void*)(X)) | |
| 342 | -# define SQLITE_PTR_TO_INT(X) ((int)(X)) | |
| 343 | -# endif | |
| 344 | -#else | |
| 345 | -# define SQLITE_INT_TO_PTR(X) ((void*)&((char*)0)[X]) | |
| 346 | -# define SQLITE_PTR_TO_INT(X) ((int)(((char*)X)-(char*)0)) | |
| 333 | +#if defined(__PTRDIFF_TYPE__) /* This case should work for GCC */ | |
| 334 | +# define SQLITE_INT_TO_PTR(X) ((void*)(__PTRDIFF_TYPE__)(X)) | |
| 335 | +# define SQLITE_PTR_TO_INT(X) ((int)(__PTRDIFF_TYPE__)(X)) | |
| 336 | +#elif !defined(__GNUC__) /* Works for compilers other than LLVM */ | |
| 337 | +# define SQLITE_INT_TO_PTR(X) ((void*)&((char*)0)[X]) | |
| 338 | +# define SQLITE_PTR_TO_INT(X) ((int)(((char*)X)-(char*)0)) | |
| 339 | +#elif defined(HAVE_STDINT_H) /* Use this case if we have ANSI headers */ | |
| 340 | +# define SQLITE_INT_TO_PTR(X) ((void*)(intptr_t)(X)) | |
| 341 | +# define SQLITE_PTR_TO_INT(X) ((int)(intptr_t)(X)) | |
| 342 | +#else /* Generates a warning - but it always works */ | |
| 343 | +# define SQLITE_INT_TO_PTR(X) ((void*)(X)) | |
| 344 | +# define SQLITE_PTR_TO_INT(X) ((int)(X)) | |
| 347 | 345 | #endif |
| 348 | - | |
| 349 | 346 | |
| 350 | 347 | /* |
| 351 | 348 | ** The SQLITE_THREADSAFE macro must be defined as either 0 or 1. |
| 352 | 349 | ** Older versions of SQLite used an optional THREADSAFE macro. |
| 353 | 350 | ** We support that for legacy |
| @@ -631,11 +628,11 @@ | ||
| 631 | 628 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 632 | 629 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 633 | 630 | */ |
| 634 | 631 | #define SQLITE_VERSION "3.6.23" |
| 635 | 632 | #define SQLITE_VERSION_NUMBER 3006023 |
| 636 | -#define SQLITE_SOURCE_ID "2010-02-26 13:07:37 8f29490da62df07ea922b03cab52b6edd2669edb" | |
| 633 | +#define SQLITE_SOURCE_ID "2010-03-04 22:36:45 1a0fa8d19d69d4ecaaaa879ac3c893980375fcc6" | |
| 637 | 634 | |
| 638 | 635 | /* |
| 639 | 636 | ** CAPI3REF: Run-Time Library Version Numbers |
| 640 | 637 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 641 | 638 | ** |
| @@ -668,13 +665,13 @@ | ||
| 668 | 665 | SQLITE_API const char sqlite3_version[] = SQLITE_VERSION; |
| 669 | 666 | SQLITE_API const char *sqlite3_libversion(void); |
| 670 | 667 | SQLITE_API const char *sqlite3_sourceid(void); |
| 671 | 668 | SQLITE_API int sqlite3_libversion_number(void); |
| 672 | 669 | |
| 670 | +#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS | |
| 673 | 671 | /* |
| 674 | 672 | ** CAPI3REF: Run-Time Library Compilation Options Diagnostics |
| 675 | -** KEYWORDS: sqlite3_compileoption_used, sqlite3_compileoption_get | |
| 676 | 673 | ** |
| 677 | 674 | ** ^The sqlite3_compileoption_used() function returns 0 or 1 |
| 678 | 675 | ** indicating whether the specified option was defined at |
| 679 | 676 | ** compile time. ^The SQLITE_ prefix may be omitted from the |
| 680 | 677 | ** option name passed to sqlite3_compileoption_used(). |
| @@ -686,15 +683,15 @@ | ||
| 686 | 683 | ** prefix is omitted from any strings returned by |
| 687 | 684 | ** sqlite3_compileoption_get(). |
| 688 | 685 | ** |
| 689 | 686 | ** ^Support for the diagnostic functions sqlite3_compileoption_used() |
| 690 | 687 | ** and sqlite3_compileoption_get() may be omitted by specifing the |
| 691 | -** SQLITE_OMIT_COMPILEOPTION_DIAGS option at compile time. | |
| 688 | +** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time. | |
| 692 | 689 | ** |
| 693 | -** See also: [sqlite_compile_option_used()] and [sqlite_compile_option_get()]. | |
| 690 | +** See also: SQL functions [sqlite_compileoption_used()] and | |
| 691 | +** [sqlite_compileoption_get()] and the [compile_options pragma]. | |
| 694 | 692 | */ |
| 695 | -#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS | |
| 696 | 693 | SQLITE_API int sqlite3_compileoption_used(const char *zOptName); |
| 697 | 694 | SQLITE_API const char *sqlite3_compileoption_get(int N); |
| 698 | 695 | #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */ |
| 699 | 696 | |
| 700 | 697 | /* |
| @@ -6222,20 +6219,26 @@ | ||
| 6222 | 6219 | /* |
| 6223 | 6220 | ** CAPI3REF: Error Logging Interface |
| 6224 | 6221 | ** EXPERIMENTAL |
| 6225 | 6222 | ** |
| 6226 | 6223 | ** ^The [sqlite3_log()] interface writes a message into the error log |
| 6227 | -** established by the [SQLITE_CONFIG_ERRORLOG] option to [sqlite3_config()]. | |
| 6224 | +** established by the [SQLITE_CONFIG_LOG] option to [sqlite3_config()]. | |
| 6228 | 6225 | ** ^If logging is enabled, the zFormat string and subsequent arguments are |
| 6229 | 6226 | ** passed through to [sqlite3_vmprintf()] to generate the final output string. |
| 6230 | 6227 | ** |
| 6231 | 6228 | ** The sqlite3_log() interface is intended for use by extensions such as |
| 6232 | 6229 | ** virtual tables, collating functions, and SQL functions. While there is |
| 6233 | 6230 | ** nothing to prevent an application from calling sqlite3_log(), doing so |
| 6234 | 6231 | ** is considered bad form. |
| 6235 | 6232 | ** |
| 6236 | 6233 | ** The zFormat string must not be NULL. |
| 6234 | +** | |
| 6235 | +** To avoid deadlocks and other threading problems, the sqlite3_log() routine | |
| 6236 | +** will not use dynamically allocated memory. The log message is stored in | |
| 6237 | +** a fixed-length buffer on the stack. If the log message is longer than | |
| 6238 | +** a few hundred characters, it will be truncated to the length of the | |
| 6239 | +** buffer. | |
| 6237 | 6240 | */ |
| 6238 | 6241 | SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...); |
| 6239 | 6242 | |
| 6240 | 6243 | /* |
| 6241 | 6244 | ** Undo the hack that converts floating point types to integer for |
| @@ -16867,11 +16870,13 @@ | ||
| 16867 | 16870 | break; |
| 16868 | 16871 | case etFLOAT: |
| 16869 | 16872 | case etEXP: |
| 16870 | 16873 | case etGENERIC: |
| 16871 | 16874 | realvalue = va_arg(ap,double); |
| 16872 | -#ifndef SQLITE_OMIT_FLOATING_POINT | |
| 16875 | +#ifdef SQLITE_OMIT_FLOATING_POINT | |
| 16876 | + length = 0; | |
| 16877 | +#else | |
| 16873 | 16878 | if( precision<0 ) precision = 6; /* Set default precision */ |
| 16874 | 16879 | if( precision>etBUFSIZE/2-10 ) precision = etBUFSIZE/2-10; |
| 16875 | 16880 | if( realvalue<0.0 ){ |
| 16876 | 16881 | realvalue = -realvalue; |
| 16877 | 16882 | prefix = '-'; |
| @@ -17013,13 +17018,11 @@ | ||
| 17013 | 17018 | } |
| 17014 | 17019 | i = prefix!=0; |
| 17015 | 17020 | while( nPad-- ) bufpt[i++] = '0'; |
| 17016 | 17021 | length = width; |
| 17017 | 17022 | } |
| 17018 | -#else | |
| 17019 | - length = 0; | |
| 17020 | -#endif /* SQLITE_OMIT_FLOATING_POINT */ | |
| 17023 | +#endif /* !defined(SQLITE_OMIT_FLOATING_POINT) */ | |
| 17021 | 17024 | break; |
| 17022 | 17025 | case etSIZE: |
| 17023 | 17026 | *(va_arg(ap,int*)) = pAccum->nChar; |
| 17024 | 17027 | length = width = 0; |
| 17025 | 17028 | break; |
| @@ -17062,11 +17065,11 @@ | ||
| 17062 | 17065 | char q = ((xtype==etSQLESCAPE3)?'"':'\''); /* Quote character */ |
| 17063 | 17066 | char *escarg = va_arg(ap,char*); |
| 17064 | 17067 | isnull = escarg==0; |
| 17065 | 17068 | if( isnull ) escarg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)"); |
| 17066 | 17069 | k = precision; |
| 17067 | - for(i=n=0; (ch=escarg[i])!=0 && k!=0; i++, k--){ | |
| 17070 | + for(i=n=0; k!=0 && (ch=escarg[i])!=0; i++, k--){ | |
| 17068 | 17071 | if( ch==q ) n++; |
| 17069 | 17072 | } |
| 17070 | 17073 | needQuote = !isnull && xtype==etSQLESCAPE2; |
| 17071 | 17074 | n += i + 1 + needQuote*2; |
| 17072 | 17075 | if( n>etBUFSIZE ){ |
| @@ -17345,30 +17348,40 @@ | ||
| 17345 | 17348 | sqlite3VXPrintf(&acc, 0, zFormat, ap); |
| 17346 | 17349 | va_end(ap); |
| 17347 | 17350 | z = sqlite3StrAccumFinish(&acc); |
| 17348 | 17351 | return z; |
| 17349 | 17352 | } |
| 17353 | + | |
| 17354 | +/* | |
| 17355 | +** This is the routine that actually formats the sqlite3_log() message. | |
| 17356 | +** We house it in a separate routine from sqlite3_log() to avoid using | |
| 17357 | +** stack space on small-stack systems when logging is disabled. | |
| 17358 | +** | |
| 17359 | +** sqlite3_log() must render into a static buffer. It cannot dynamically | |
| 17360 | +** allocate memory because it might be called while the memory allocator | |
| 17361 | +** mutex is held. | |
| 17362 | +*/ | |
| 17363 | +static void renderLogMsg(int iErrCode, const char *zFormat, va_list ap){ | |
| 17364 | + StrAccum acc; /* String accumulator */ | |
| 17365 | + char zMsg[SQLITE_PRINT_BUF_SIZE*3]; /* Complete log message */ | |
| 17366 | + | |
| 17367 | + sqlite3StrAccumInit(&acc, zMsg, sizeof(zMsg), 0); | |
| 17368 | + acc.useMalloc = 0; | |
| 17369 | + sqlite3VXPrintf(&acc, 0, zFormat, ap); | |
| 17370 | + sqlite3GlobalConfig.xLog(sqlite3GlobalConfig.pLogArg, iErrCode, | |
| 17371 | + sqlite3StrAccumFinish(&acc)); | |
| 17372 | +} | |
| 17350 | 17373 | |
| 17351 | 17374 | /* |
| 17352 | 17375 | ** Format and write a message to the log if logging is enabled. |
| 17353 | 17376 | */ |
| 17354 | 17377 | SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...){ |
| 17355 | - void (*xLog)(void*, int, const char*); /* The global logger function */ | |
| 17356 | - void *pLogArg; /* First argument to the logger */ | |
| 17357 | 17378 | va_list ap; /* Vararg list */ |
| 17358 | - char *zMsg; /* Complete log message */ | |
| 17359 | - | |
| 17360 | - xLog = sqlite3GlobalConfig.xLog; | |
| 17361 | - if( xLog ){ | |
| 17379 | + if( sqlite3GlobalConfig.xLog ){ | |
| 17362 | 17380 | va_start(ap, zFormat); |
| 17363 | - sqlite3BeginBenignMalloc(); | |
| 17364 | - zMsg = sqlite3_vmprintf(zFormat, ap); | |
| 17365 | - sqlite3EndBenignMalloc(); | |
| 17381 | + renderLogMsg(iErrCode, zFormat, ap); | |
| 17366 | 17382 | va_end(ap); |
| 17367 | - pLogArg = sqlite3GlobalConfig.pLogArg; | |
| 17368 | - xLog(pLogArg, iErrCode, zMsg ? zMsg : zFormat); | |
| 17369 | - sqlite3_free(zMsg); | |
| 17370 | 17383 | } |
| 17371 | 17384 | } |
| 17372 | 17385 | |
| 17373 | 17386 | #if defined(SQLITE_DEBUG) |
| 17374 | 17387 | /* |
| @@ -19180,10 +19193,23 @@ | ||
| 19180 | 19193 | p[1] = (u8)(v & 0x7f); |
| 19181 | 19194 | return 2; |
| 19182 | 19195 | } |
| 19183 | 19196 | return sqlite3PutVarint(p, v); |
| 19184 | 19197 | } |
| 19198 | + | |
| 19199 | +/* | |
| 19200 | +** Bitmasks used by sqlite3GetVarint(). These precomputed constants | |
| 19201 | +** are defined here rather than simply putting the constant expressions | |
| 19202 | +** inline in order to work around bugs in the RVT compiler. | |
| 19203 | +** | |
| 19204 | +** SLOT_2_0 A mask for (0x7f<<14) | 0x7f | |
| 19205 | +** | |
| 19206 | +** SLOT_4_2_0 A mask for (0x7f<<28) | SLOT_2_0 | |
| 19207 | +*/ | |
| 19208 | +#define SLOT_2_0 0x001fc07f | |
| 19209 | +#define SLOT_4_2_0 0xf01fc07f | |
| 19210 | + | |
| 19185 | 19211 | |
| 19186 | 19212 | /* |
| 19187 | 19213 | ** Read a 64-bit variable-length integer from memory starting at p[0]. |
| 19188 | 19214 | ** Return the number of bytes read. The value is stored in *v. |
| 19189 | 19215 | */ |
| @@ -19208,33 +19234,37 @@ | ||
| 19208 | 19234 | a |= b; |
| 19209 | 19235 | *v = a; |
| 19210 | 19236 | return 2; |
| 19211 | 19237 | } |
| 19212 | 19238 | |
| 19239 | + /* Verify that constants are precomputed correctly */ | |
| 19240 | + assert( SLOT_2_0 == ((0x7f<<14) | (0x7f)) ); | |
| 19241 | + assert( SLOT_4_2_0 == ((0xf<<28) | (0x7f<<14) | (0x7f)) ); | |
| 19242 | + | |
| 19213 | 19243 | p++; |
| 19214 | 19244 | a = a<<14; |
| 19215 | 19245 | a |= *p; |
| 19216 | 19246 | /* a: p0<<14 | p2 (unmasked) */ |
| 19217 | 19247 | if (!(a&0x80)) |
| 19218 | 19248 | { |
| 19219 | - a &= (0x7f<<14)|(0x7f); | |
| 19249 | + a &= SLOT_2_0; | |
| 19220 | 19250 | b &= 0x7f; |
| 19221 | 19251 | b = b<<7; |
| 19222 | 19252 | a |= b; |
| 19223 | 19253 | *v = a; |
| 19224 | 19254 | return 3; |
| 19225 | 19255 | } |
| 19226 | 19256 | |
| 19227 | 19257 | /* CSE1 from below */ |
| 19228 | - a &= (0x7f<<14)|(0x7f); | |
| 19258 | + a &= SLOT_2_0; | |
| 19229 | 19259 | p++; |
| 19230 | 19260 | b = b<<14; |
| 19231 | 19261 | b |= *p; |
| 19232 | 19262 | /* b: p1<<14 | p3 (unmasked) */ |
| 19233 | 19263 | if (!(b&0x80)) |
| 19234 | 19264 | { |
| 19235 | - b &= (0x7f<<14)|(0x7f); | |
| 19265 | + b &= SLOT_2_0; | |
| 19236 | 19266 | /* moved CSE1 up */ |
| 19237 | 19267 | /* a &= (0x7f<<14)|(0x7f); */ |
| 19238 | 19268 | a = a<<7; |
| 19239 | 19269 | a |= b; |
| 19240 | 19270 | *v = a; |
| @@ -19244,11 +19274,11 @@ | ||
| 19244 | 19274 | /* a: p0<<14 | p2 (masked) */ |
| 19245 | 19275 | /* b: p1<<14 | p3 (unmasked) */ |
| 19246 | 19276 | /* 1:save off p0<<21 | p1<<14 | p2<<7 | p3 (masked) */ |
| 19247 | 19277 | /* moved CSE1 up */ |
| 19248 | 19278 | /* a &= (0x7f<<14)|(0x7f); */ |
| 19249 | - b &= (0x7f<<14)|(0x7f); | |
| 19279 | + b &= SLOT_2_0; | |
| 19250 | 19280 | s = a; |
| 19251 | 19281 | /* s: p0<<14 | p2 (masked) */ |
| 19252 | 19282 | |
| 19253 | 19283 | p++; |
| 19254 | 19284 | a = a<<14; |
| @@ -19277,11 +19307,11 @@ | ||
| 19277 | 19307 | /* b: p1<<28 | p3<<14 | p5 (unmasked) */ |
| 19278 | 19308 | if (!(b&0x80)) |
| 19279 | 19309 | { |
| 19280 | 19310 | /* we can skip this cause it was (effectively) done above in calc'ing s */ |
| 19281 | 19311 | /* b &= (0x7f<<28)|(0x7f<<14)|(0x7f); */ |
| 19282 | - a &= (0x7f<<14)|(0x7f); | |
| 19312 | + a &= SLOT_2_0; | |
| 19283 | 19313 | a = a<<7; |
| 19284 | 19314 | a |= b; |
| 19285 | 19315 | s = s>>18; |
| 19286 | 19316 | *v = ((u64)s)<<32 | a; |
| 19287 | 19317 | return 6; |
| @@ -19291,28 +19321,28 @@ | ||
| 19291 | 19321 | a = a<<14; |
| 19292 | 19322 | a |= *p; |
| 19293 | 19323 | /* a: p2<<28 | p4<<14 | p6 (unmasked) */ |
| 19294 | 19324 | if (!(a&0x80)) |
| 19295 | 19325 | { |
| 19296 | - a &= (0x1f<<28)|(0x7f<<14)|(0x7f); | |
| 19297 | - b &= (0x7f<<14)|(0x7f); | |
| 19326 | + a &= SLOT_4_2_0; | |
| 19327 | + b &= SLOT_2_0; | |
| 19298 | 19328 | b = b<<7; |
| 19299 | 19329 | a |= b; |
| 19300 | 19330 | s = s>>11; |
| 19301 | 19331 | *v = ((u64)s)<<32 | a; |
| 19302 | 19332 | return 7; |
| 19303 | 19333 | } |
| 19304 | 19334 | |
| 19305 | 19335 | /* CSE2 from below */ |
| 19306 | - a &= (0x7f<<14)|(0x7f); | |
| 19336 | + a &= SLOT_2_0; | |
| 19307 | 19337 | p++; |
| 19308 | 19338 | b = b<<14; |
| 19309 | 19339 | b |= *p; |
| 19310 | 19340 | /* b: p3<<28 | p5<<14 | p7 (unmasked) */ |
| 19311 | 19341 | if (!(b&0x80)) |
| 19312 | 19342 | { |
| 19313 | - b &= (0x1f<<28)|(0x7f<<14)|(0x7f); | |
| 19343 | + b &= SLOT_4_2_0; | |
| 19314 | 19344 | /* moved CSE2 up */ |
| 19315 | 19345 | /* a &= (0x7f<<14)|(0x7f); */ |
| 19316 | 19346 | a = a<<7; |
| 19317 | 19347 | a |= b; |
| 19318 | 19348 | s = s>>4; |
| @@ -19325,11 +19355,11 @@ | ||
| 19325 | 19355 | a |= *p; |
| 19326 | 19356 | /* a: p4<<29 | p6<<15 | p8 (unmasked) */ |
| 19327 | 19357 | |
| 19328 | 19358 | /* moved CSE2 up */ |
| 19329 | 19359 | /* a &= (0x7f<<29)|(0x7f<<15)|(0xff); */ |
| 19330 | - b &= (0x7f<<14)|(0x7f); | |
| 19360 | + b &= SLOT_2_0; | |
| 19331 | 19361 | b = b<<8; |
| 19332 | 19362 | a |= b; |
| 19333 | 19363 | |
| 19334 | 19364 | s = s<<4; |
| 19335 | 19365 | b = p[-4]; |
| @@ -19445,13 +19475,13 @@ | ||
| 19445 | 19475 | a = a<<14; |
| 19446 | 19476 | a |= *p; |
| 19447 | 19477 | /* a: p0<<28 | p2<<14 | p4 (unmasked) */ |
| 19448 | 19478 | if (!(a&0x80)) |
| 19449 | 19479 | { |
| 19450 | - /* Walues between 268435456 and 34359738367 */ | |
| 19451 | - a &= (0x1f<<28)|(0x7f<<14)|(0x7f); | |
| 19452 | - b &= (0x1f<<28)|(0x7f<<14)|(0x7f); | |
| 19480 | + /* Values between 268435456 and 34359738367 */ | |
| 19481 | + a &= SLOT_4_2_0; | |
| 19482 | + b &= SLOT_4_2_0; | |
| 19453 | 19483 | b = b<<7; |
| 19454 | 19484 | *v = a | b; |
| 19455 | 19485 | return 5; |
| 19456 | 19486 | } |
| 19457 | 19487 | |
| @@ -21446,11 +21476,11 @@ | ||
| 21446 | 21476 | ** selection of the appropriate locking style based on the filesystem |
| 21447 | 21477 | ** where the database is located. |
| 21448 | 21478 | */ |
| 21449 | 21479 | #if !defined(SQLITE_ENABLE_LOCKING_STYLE) |
| 21450 | 21480 | # if defined(__APPLE__) |
| 21451 | -# define SQLITE_ENABLE_LOCKING_STYLE 1 | |
| 21481 | +# define SQLITE_ENABLE_LOCKING_STYLE 0 | |
| 21452 | 21482 | # else |
| 21453 | 21483 | # define SQLITE_ENABLE_LOCKING_STYLE 0 |
| 21454 | 21484 | # endif |
| 21455 | 21485 | #endif |
| 21456 | 21486 | |
| @@ -21511,10 +21541,13 @@ | ||
| 21511 | 21541 | # include <sys/file.h> |
| 21512 | 21542 | # include <sys/param.h> |
| 21513 | 21543 | # include <sys/mount.h> |
| 21514 | 21544 | # endif |
| 21515 | 21545 | #endif /* SQLITE_ENABLE_LOCKING_STYLE */ |
| 21546 | + | |
| 21547 | +#ifdef __APPLE__ | |
| 21548 | +#endif | |
| 21516 | 21549 | |
| 21517 | 21550 | /* |
| 21518 | 21551 | ** Allowed values of unixFile.fsFlags |
| 21519 | 21552 | */ |
| 21520 | 21553 | #define SQLITE_FSFLAGS_IS_MSDOS 0x1 |
| @@ -23155,11 +23188,11 @@ | ||
| 23155 | 23188 | lock.l_type = F_UNLCK; |
| 23156 | 23189 | lock.l_whence = SEEK_SET; |
| 23157 | 23190 | lock.l_start = SHARED_FIRST; |
| 23158 | 23191 | lock.l_len = divSize; |
| 23159 | 23192 | if( fcntl(h, F_SETLK, &lock)==(-1) ){ |
| 23160 | - int tErrno = errno; | |
| 23193 | + tErrno = errno; | |
| 23161 | 23194 | rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_UNLOCK); |
| 23162 | 23195 | if( IS_LOCK_ERROR(rc) ){ |
| 23163 | 23196 | pFile->lastErrno = tErrno; |
| 23164 | 23197 | } |
| 23165 | 23198 | goto end_unlock; |
| @@ -23167,11 +23200,11 @@ | ||
| 23167 | 23200 | lock.l_type = F_RDLCK; |
| 23168 | 23201 | lock.l_whence = SEEK_SET; |
| 23169 | 23202 | lock.l_start = SHARED_FIRST; |
| 23170 | 23203 | lock.l_len = divSize; |
| 23171 | 23204 | if( fcntl(h, F_SETLK, &lock)==(-1) ){ |
| 23172 | - int tErrno = errno; | |
| 23205 | + tErrno = errno; | |
| 23173 | 23206 | rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_RDLOCK); |
| 23174 | 23207 | if( IS_LOCK_ERROR(rc) ){ |
| 23175 | 23208 | pFile->lastErrno = tErrno; |
| 23176 | 23209 | } |
| 23177 | 23210 | goto end_unlock; |
| @@ -23179,11 +23212,11 @@ | ||
| 23179 | 23212 | lock.l_type = F_UNLCK; |
| 23180 | 23213 | lock.l_whence = SEEK_SET; |
| 23181 | 23214 | lock.l_start = SHARED_FIRST+divSize; |
| 23182 | 23215 | lock.l_len = SHARED_SIZE-divSize; |
| 23183 | 23216 | if( fcntl(h, F_SETLK, &lock)==(-1) ){ |
| 23184 | - int tErrno = errno; | |
| 23217 | + tErrno = errno; | |
| 23185 | 23218 | rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_UNLOCK); |
| 23186 | 23219 | if( IS_LOCK_ERROR(rc) ){ |
| 23187 | 23220 | pFile->lastErrno = tErrno; |
| 23188 | 23221 | } |
| 23189 | 23222 | goto end_unlock; |
| @@ -23192,11 +23225,11 @@ | ||
| 23192 | 23225 | lock.l_type = F_RDLCK; |
| 23193 | 23226 | lock.l_whence = SEEK_SET; |
| 23194 | 23227 | lock.l_start = SHARED_FIRST; |
| 23195 | 23228 | lock.l_len = SHARED_SIZE; |
| 23196 | 23229 | if( fcntl(h, F_SETLK, &lock)==(-1) ){ |
| 23197 | - int tErrno = errno; | |
| 23230 | + tErrno = errno; | |
| 23198 | 23231 | rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_RDLOCK); |
| 23199 | 23232 | if( IS_LOCK_ERROR(rc) ){ |
| 23200 | 23233 | pFile->lastErrno = tErrno; |
| 23201 | 23234 | } |
| 23202 | 23235 | goto end_unlock; |
| @@ -26491,11 +26524,11 @@ | ||
| 26491 | 26524 | sqlite3_free(pNew); |
| 26492 | 26525 | sqlite3_free(pUnused); |
| 26493 | 26526 | return rc; |
| 26494 | 26527 | } |
| 26495 | 26528 | |
| 26496 | -#ifdef SQLITE_TEST | |
| 26529 | +#if defined(SQLITE_TEST) && defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE | |
| 26497 | 26530 | /* simulate multiple hosts by creating unique hostid file paths */ |
| 26498 | 26531 | SQLITE_API int sqlite3_hostid_num = 0; |
| 26499 | 26532 | #endif |
| 26500 | 26533 | |
| 26501 | 26534 | #define PROXY_HOSTIDLEN 16 /* conch file host id length */ |
| @@ -30169,10 +30202,11 @@ | ||
| 30169 | 30202 | SQLITE_PRIVATE void sqlite3PcacheSetPageSize(PCache *pCache, int szPage){ |
| 30170 | 30203 | assert( pCache->nRef==0 && pCache->pDirty==0 ); |
| 30171 | 30204 | if( pCache->pCache ){ |
| 30172 | 30205 | sqlite3GlobalConfig.pcache.xDestroy(pCache->pCache); |
| 30173 | 30206 | pCache->pCache = 0; |
| 30207 | + pCache->pPage1 = 0; | |
| 30174 | 30208 | } |
| 30175 | 30209 | pCache->szPage = szPage; |
| 30176 | 30210 | } |
| 30177 | 30211 | |
| 30178 | 30212 | /* |
| @@ -43918,12 +43952,19 @@ | ||
| 43918 | 43952 | ** the dropCell() routine will overwrite the entire cell with zeroes. |
| 43919 | 43953 | ** In this case, temporarily copy the cell into the aOvflSpace[] |
| 43920 | 43954 | ** buffer. It will be copied out again as soon as the aSpace[] buffer |
| 43921 | 43955 | ** is allocated. */ |
| 43922 | 43956 | if( pBt->secureDelete ){ |
| 43923 | - memcpy(&aOvflSpace[apDiv[i]-pParent->aData], apDiv[i], szNew[i]); | |
| 43924 | - apDiv[i] = &aOvflSpace[apDiv[i]-pParent->aData]; | |
| 43957 | + int iOff = apDiv[i] - pParent->aData; | |
| 43958 | + if( (iOff+szNew[i])>pBt->usableSize ){ | |
| 43959 | + rc = SQLITE_CORRUPT_BKPT; | |
| 43960 | + memset(apOld, 0, (i+1)*sizeof(MemPage*)); | |
| 43961 | + goto balance_cleanup; | |
| 43962 | + }else{ | |
| 43963 | + memcpy(&aOvflSpace[iOff], apDiv[i], szNew[i]); | |
| 43964 | + apDiv[i] = &aOvflSpace[apDiv[i]-pParent->aData]; | |
| 43965 | + } | |
| 43925 | 43966 | } |
| 43926 | 43967 | dropCell(pParent, i+nxDiv-pParent->nOverflow, szNew[i], &rc); |
| 43927 | 43968 | } |
| 43928 | 43969 | } |
| 43929 | 43970 | |
| @@ -58617,11 +58658,13 @@ | ||
| 58617 | 58658 | ** an error of some kind. |
| 58618 | 58659 | */ |
| 58619 | 58660 | vdbe_error_halt: |
| 58620 | 58661 | assert( rc ); |
| 58621 | 58662 | p->rc = rc; |
| 58622 | - sqlite3_log(rc, "prepared statement aborts at %d: [%s]", pc, p->zSql); | |
| 58663 | + testcase( sqlite3GlobalConfig.xLog!=0 ); | |
| 58664 | + sqlite3_log(rc, "statement aborts at %d: [%s] %s", | |
| 58665 | + pc, p->zSql, p->zErrMsg); | |
| 58623 | 58666 | sqlite3VdbeHalt(p); |
| 58624 | 58667 | if( rc==SQLITE_IOERR_NOMEM ) db->mallocFailed = 1; |
| 58625 | 58668 | rc = SQLITE_ERROR; |
| 58626 | 58669 | if( resetSchemaOnFault ) sqlite3ResetInternalSchema(db, 0); |
| 58627 | 58670 | |
| @@ -73606,12 +73649,12 @@ | ||
| 73606 | 73649 | FUNCTION(randomblob, 1, 0, 0, randomBlob ), |
| 73607 | 73650 | FUNCTION(nullif, 2, 0, 1, nullifFunc ), |
| 73608 | 73651 | FUNCTION(sqlite_version, 0, 0, 0, versionFunc ), |
| 73609 | 73652 | FUNCTION(sqlite_source_id, 0, 0, 0, sourceidFunc ), |
| 73610 | 73653 | #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS |
| 73611 | - FUNCTION(sqlite_compile_option_used,1, 0, 0, compileoptionusedFunc ), | |
| 73612 | - FUNCTION(sqlite_compile_option_get, 1, 0, 0, compileoptiongetFunc ), | |
| 73654 | + FUNCTION(sqlite_compileoption_used,1, 0, 0, compileoptionusedFunc ), | |
| 73655 | + FUNCTION(sqlite_compileoption_get, 1, 0, 0, compileoptiongetFunc ), | |
| 73613 | 73656 | #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */ |
| 73614 | 73657 | FUNCTION(quote, 1, 0, 0, quoteFunc ), |
| 73615 | 73658 | FUNCTION(last_insert_rowid, 0, 0, 0, last_insert_rowid), |
| 73616 | 73659 | FUNCTION(changes, 0, 0, 0, changes ), |
| 73617 | 73660 | FUNCTION(total_changes, 0, 0, 0, total_changes ), |
| @@ -79179,22 +79222,14 @@ | ||
| 79179 | 79222 | #endif /* SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS */ |
| 79180 | 79223 | |
| 79181 | 79224 | #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS |
| 79182 | 79225 | /* |
| 79183 | 79226 | ** PRAGMA compile_options |
| 79184 | - ** PRAGMA compile_option(<option>) | |
| 79185 | 79227 | ** |
| 79186 | - ** The first form returns a single row for each option that was | |
| 79187 | - ** defined at compile time. The second form returns 0 or 1 | |
| 79188 | - ** indicating whether the specified option was defined at | |
| 79189 | - ** compile time. | |
| 79228 | + ** Return the names of all compile-time options used in this build, | |
| 79229 | + ** one option per row. | |
| 79190 | 79230 | */ |
| 79191 | - if( sqlite3StrICmp(zLeft, "compile_option")==0 && zRight ){ | |
| 79192 | - int used = sqlite3_compileoption_used(zRight); | |
| 79193 | - returnSingleInt(pParse, zRight, used); | |
| 79194 | - }else | |
| 79195 | - | |
| 79196 | 79231 | if( sqlite3StrICmp(zLeft, "compile_options")==0 ){ |
| 79197 | 79232 | int i = 0; |
| 79198 | 79233 | const char *zOpt; |
| 79199 | 79234 | sqlite3VdbeSetNumCols(v, 1); |
| 79200 | 79235 | pParse->nMem = 1; |
| @@ -86540,11 +86575,15 @@ | ||
| 86540 | 86575 | ** actually occurs when doing a vacuum since the vacuum_db is initially |
| 86541 | 86576 | ** empty. Only the journal header is written. Apparently it takes more |
| 86542 | 86577 | ** time to parse and run the PRAGMA to turn journalling off than it does |
| 86543 | 86578 | ** to write the journal header file. |
| 86544 | 86579 | */ |
| 86545 | - zSql = "ATTACH '' AS vacuum_db;"; | |
| 86580 | + if( sqlite3TempInMemory(db) ){ | |
| 86581 | + zSql = "ATTACH ':memory:' AS vacuum_db;"; | |
| 86582 | + }else{ | |
| 86583 | + zSql = "ATTACH '' AS vacuum_db;"; | |
| 86584 | + } | |
| 86546 | 86585 | rc = execSql(db, pzErrMsg, zSql); |
| 86547 | 86586 | if( rc!=SQLITE_OK ) goto end_of_vacuum; |
| 86548 | 86587 | pDb = &db->aDb[db->nDb-1]; |
| 86549 | 86588 | assert( strcmp(db->aDb[db->nDb-1].zName,"vacuum_db")==0 ); |
| 86550 | 86589 | pTemp = db->aDb[db->nDb-1].pBt; |
| 86551 | 86590 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -313,41 +313,38 @@ | |
| 313 | ** and with SQLITE_ENABLE_STAT2 |
| 314 | */ |
| 315 | #define SQLITE_INDEX_SAMPLES 10 |
| 316 | |
| 317 | /* |
| 318 | ** This macro is used to "hide" some ugliness in casting an int |
| 319 | ** value to a ptr value under the MSVC 64-bit compiler. Casting |
| 320 | ** non 64-bit values to ptr types results in a "hard" error with |
| 321 | ** the MSVC 64-bit compiler which this attempts to avoid. |
| 322 | ** |
| 323 | ** A simple compiler pragma or casting sequence could not be found |
| 324 | ** to correct this in all situations, so this macro was introduced. |
| 325 | ** |
| 326 | ** It could be argued that the intptr_t type could be used in this |
| 327 | ** case, but that type is not available on all compilers, or |
| 328 | ** requires the #include of specific headers which differs between |
| 329 | ** platforms. |
| 330 | ** |
| 331 | ** Ticket #3860: The llvm-gcc-4.2 compiler from Apple chokes on |
| 332 | ** the ((void*)&((char*)0)[X]) construct. But MSVC chokes on ((void*)(X)). |
| 333 | ** So we have to define the macros in different ways depending on the |
| 334 | ** compiler. |
| 335 | */ |
| 336 | #if defined(__GNUC__) |
| 337 | # if defined(HAVE_STDINT_H) |
| 338 | # define SQLITE_INT_TO_PTR(X) ((void*)(intptr_t)(X)) |
| 339 | # define SQLITE_PTR_TO_INT(X) ((int)(intptr_t)(X)) |
| 340 | # else |
| 341 | # define SQLITE_INT_TO_PTR(X) ((void*)(X)) |
| 342 | # define SQLITE_PTR_TO_INT(X) ((int)(X)) |
| 343 | # endif |
| 344 | #else |
| 345 | # define SQLITE_INT_TO_PTR(X) ((void*)&((char*)0)[X]) |
| 346 | # define SQLITE_PTR_TO_INT(X) ((int)(((char*)X)-(char*)0)) |
| 347 | #endif |
| 348 | |
| 349 | |
| 350 | /* |
| 351 | ** The SQLITE_THREADSAFE macro must be defined as either 0 or 1. |
| 352 | ** Older versions of SQLite used an optional THREADSAFE macro. |
| 353 | ** We support that for legacy |
| @@ -631,11 +628,11 @@ | |
| 631 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 632 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 633 | */ |
| 634 | #define SQLITE_VERSION "3.6.23" |
| 635 | #define SQLITE_VERSION_NUMBER 3006023 |
| 636 | #define SQLITE_SOURCE_ID "2010-02-26 13:07:37 8f29490da62df07ea922b03cab52b6edd2669edb" |
| 637 | |
| 638 | /* |
| 639 | ** CAPI3REF: Run-Time Library Version Numbers |
| 640 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 641 | ** |
| @@ -668,13 +665,13 @@ | |
| 668 | SQLITE_API const char sqlite3_version[] = SQLITE_VERSION; |
| 669 | SQLITE_API const char *sqlite3_libversion(void); |
| 670 | SQLITE_API const char *sqlite3_sourceid(void); |
| 671 | SQLITE_API int sqlite3_libversion_number(void); |
| 672 | |
| 673 | /* |
| 674 | ** CAPI3REF: Run-Time Library Compilation Options Diagnostics |
| 675 | ** KEYWORDS: sqlite3_compileoption_used, sqlite3_compileoption_get |
| 676 | ** |
| 677 | ** ^The sqlite3_compileoption_used() function returns 0 or 1 |
| 678 | ** indicating whether the specified option was defined at |
| 679 | ** compile time. ^The SQLITE_ prefix may be omitted from the |
| 680 | ** option name passed to sqlite3_compileoption_used(). |
| @@ -686,15 +683,15 @@ | |
| 686 | ** prefix is omitted from any strings returned by |
| 687 | ** sqlite3_compileoption_get(). |
| 688 | ** |
| 689 | ** ^Support for the diagnostic functions sqlite3_compileoption_used() |
| 690 | ** and sqlite3_compileoption_get() may be omitted by specifing the |
| 691 | ** SQLITE_OMIT_COMPILEOPTION_DIAGS option at compile time. |
| 692 | ** |
| 693 | ** See also: [sqlite_compile_option_used()] and [sqlite_compile_option_get()]. |
| 694 | */ |
| 695 | #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS |
| 696 | SQLITE_API int sqlite3_compileoption_used(const char *zOptName); |
| 697 | SQLITE_API const char *sqlite3_compileoption_get(int N); |
| 698 | #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */ |
| 699 | |
| 700 | /* |
| @@ -6222,20 +6219,26 @@ | |
| 6222 | /* |
| 6223 | ** CAPI3REF: Error Logging Interface |
| 6224 | ** EXPERIMENTAL |
| 6225 | ** |
| 6226 | ** ^The [sqlite3_log()] interface writes a message into the error log |
| 6227 | ** established by the [SQLITE_CONFIG_ERRORLOG] option to [sqlite3_config()]. |
| 6228 | ** ^If logging is enabled, the zFormat string and subsequent arguments are |
| 6229 | ** passed through to [sqlite3_vmprintf()] to generate the final output string. |
| 6230 | ** |
| 6231 | ** The sqlite3_log() interface is intended for use by extensions such as |
| 6232 | ** virtual tables, collating functions, and SQL functions. While there is |
| 6233 | ** nothing to prevent an application from calling sqlite3_log(), doing so |
| 6234 | ** is considered bad form. |
| 6235 | ** |
| 6236 | ** The zFormat string must not be NULL. |
| 6237 | */ |
| 6238 | SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...); |
| 6239 | |
| 6240 | /* |
| 6241 | ** Undo the hack that converts floating point types to integer for |
| @@ -16867,11 +16870,13 @@ | |
| 16867 | break; |
| 16868 | case etFLOAT: |
| 16869 | case etEXP: |
| 16870 | case etGENERIC: |
| 16871 | realvalue = va_arg(ap,double); |
| 16872 | #ifndef SQLITE_OMIT_FLOATING_POINT |
| 16873 | if( precision<0 ) precision = 6; /* Set default precision */ |
| 16874 | if( precision>etBUFSIZE/2-10 ) precision = etBUFSIZE/2-10; |
| 16875 | if( realvalue<0.0 ){ |
| 16876 | realvalue = -realvalue; |
| 16877 | prefix = '-'; |
| @@ -17013,13 +17018,11 @@ | |
| 17013 | } |
| 17014 | i = prefix!=0; |
| 17015 | while( nPad-- ) bufpt[i++] = '0'; |
| 17016 | length = width; |
| 17017 | } |
| 17018 | #else |
| 17019 | length = 0; |
| 17020 | #endif /* SQLITE_OMIT_FLOATING_POINT */ |
| 17021 | break; |
| 17022 | case etSIZE: |
| 17023 | *(va_arg(ap,int*)) = pAccum->nChar; |
| 17024 | length = width = 0; |
| 17025 | break; |
| @@ -17062,11 +17065,11 @@ | |
| 17062 | char q = ((xtype==etSQLESCAPE3)?'"':'\''); /* Quote character */ |
| 17063 | char *escarg = va_arg(ap,char*); |
| 17064 | isnull = escarg==0; |
| 17065 | if( isnull ) escarg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)"); |
| 17066 | k = precision; |
| 17067 | for(i=n=0; (ch=escarg[i])!=0 && k!=0; i++, k--){ |
| 17068 | if( ch==q ) n++; |
| 17069 | } |
| 17070 | needQuote = !isnull && xtype==etSQLESCAPE2; |
| 17071 | n += i + 1 + needQuote*2; |
| 17072 | if( n>etBUFSIZE ){ |
| @@ -17345,30 +17348,40 @@ | |
| 17345 | sqlite3VXPrintf(&acc, 0, zFormat, ap); |
| 17346 | va_end(ap); |
| 17347 | z = sqlite3StrAccumFinish(&acc); |
| 17348 | return z; |
| 17349 | } |
| 17350 | |
| 17351 | /* |
| 17352 | ** Format and write a message to the log if logging is enabled. |
| 17353 | */ |
| 17354 | SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...){ |
| 17355 | void (*xLog)(void*, int, const char*); /* The global logger function */ |
| 17356 | void *pLogArg; /* First argument to the logger */ |
| 17357 | va_list ap; /* Vararg list */ |
| 17358 | char *zMsg; /* Complete log message */ |
| 17359 | |
| 17360 | xLog = sqlite3GlobalConfig.xLog; |
| 17361 | if( xLog ){ |
| 17362 | va_start(ap, zFormat); |
| 17363 | sqlite3BeginBenignMalloc(); |
| 17364 | zMsg = sqlite3_vmprintf(zFormat, ap); |
| 17365 | sqlite3EndBenignMalloc(); |
| 17366 | va_end(ap); |
| 17367 | pLogArg = sqlite3GlobalConfig.pLogArg; |
| 17368 | xLog(pLogArg, iErrCode, zMsg ? zMsg : zFormat); |
| 17369 | sqlite3_free(zMsg); |
| 17370 | } |
| 17371 | } |
| 17372 | |
| 17373 | #if defined(SQLITE_DEBUG) |
| 17374 | /* |
| @@ -19180,10 +19193,23 @@ | |
| 19180 | p[1] = (u8)(v & 0x7f); |
| 19181 | return 2; |
| 19182 | } |
| 19183 | return sqlite3PutVarint(p, v); |
| 19184 | } |
| 19185 | |
| 19186 | /* |
| 19187 | ** Read a 64-bit variable-length integer from memory starting at p[0]. |
| 19188 | ** Return the number of bytes read. The value is stored in *v. |
| 19189 | */ |
| @@ -19208,33 +19234,37 @@ | |
| 19208 | a |= b; |
| 19209 | *v = a; |
| 19210 | return 2; |
| 19211 | } |
| 19212 | |
| 19213 | p++; |
| 19214 | a = a<<14; |
| 19215 | a |= *p; |
| 19216 | /* a: p0<<14 | p2 (unmasked) */ |
| 19217 | if (!(a&0x80)) |
| 19218 | { |
| 19219 | a &= (0x7f<<14)|(0x7f); |
| 19220 | b &= 0x7f; |
| 19221 | b = b<<7; |
| 19222 | a |= b; |
| 19223 | *v = a; |
| 19224 | return 3; |
| 19225 | } |
| 19226 | |
| 19227 | /* CSE1 from below */ |
| 19228 | a &= (0x7f<<14)|(0x7f); |
| 19229 | p++; |
| 19230 | b = b<<14; |
| 19231 | b |= *p; |
| 19232 | /* b: p1<<14 | p3 (unmasked) */ |
| 19233 | if (!(b&0x80)) |
| 19234 | { |
| 19235 | b &= (0x7f<<14)|(0x7f); |
| 19236 | /* moved CSE1 up */ |
| 19237 | /* a &= (0x7f<<14)|(0x7f); */ |
| 19238 | a = a<<7; |
| 19239 | a |= b; |
| 19240 | *v = a; |
| @@ -19244,11 +19274,11 @@ | |
| 19244 | /* a: p0<<14 | p2 (masked) */ |
| 19245 | /* b: p1<<14 | p3 (unmasked) */ |
| 19246 | /* 1:save off p0<<21 | p1<<14 | p2<<7 | p3 (masked) */ |
| 19247 | /* moved CSE1 up */ |
| 19248 | /* a &= (0x7f<<14)|(0x7f); */ |
| 19249 | b &= (0x7f<<14)|(0x7f); |
| 19250 | s = a; |
| 19251 | /* s: p0<<14 | p2 (masked) */ |
| 19252 | |
| 19253 | p++; |
| 19254 | a = a<<14; |
| @@ -19277,11 +19307,11 @@ | |
| 19277 | /* b: p1<<28 | p3<<14 | p5 (unmasked) */ |
| 19278 | if (!(b&0x80)) |
| 19279 | { |
| 19280 | /* we can skip this cause it was (effectively) done above in calc'ing s */ |
| 19281 | /* b &= (0x7f<<28)|(0x7f<<14)|(0x7f); */ |
| 19282 | a &= (0x7f<<14)|(0x7f); |
| 19283 | a = a<<7; |
| 19284 | a |= b; |
| 19285 | s = s>>18; |
| 19286 | *v = ((u64)s)<<32 | a; |
| 19287 | return 6; |
| @@ -19291,28 +19321,28 @@ | |
| 19291 | a = a<<14; |
| 19292 | a |= *p; |
| 19293 | /* a: p2<<28 | p4<<14 | p6 (unmasked) */ |
| 19294 | if (!(a&0x80)) |
| 19295 | { |
| 19296 | a &= (0x1f<<28)|(0x7f<<14)|(0x7f); |
| 19297 | b &= (0x7f<<14)|(0x7f); |
| 19298 | b = b<<7; |
| 19299 | a |= b; |
| 19300 | s = s>>11; |
| 19301 | *v = ((u64)s)<<32 | a; |
| 19302 | return 7; |
| 19303 | } |
| 19304 | |
| 19305 | /* CSE2 from below */ |
| 19306 | a &= (0x7f<<14)|(0x7f); |
| 19307 | p++; |
| 19308 | b = b<<14; |
| 19309 | b |= *p; |
| 19310 | /* b: p3<<28 | p5<<14 | p7 (unmasked) */ |
| 19311 | if (!(b&0x80)) |
| 19312 | { |
| 19313 | b &= (0x1f<<28)|(0x7f<<14)|(0x7f); |
| 19314 | /* moved CSE2 up */ |
| 19315 | /* a &= (0x7f<<14)|(0x7f); */ |
| 19316 | a = a<<7; |
| 19317 | a |= b; |
| 19318 | s = s>>4; |
| @@ -19325,11 +19355,11 @@ | |
| 19325 | a |= *p; |
| 19326 | /* a: p4<<29 | p6<<15 | p8 (unmasked) */ |
| 19327 | |
| 19328 | /* moved CSE2 up */ |
| 19329 | /* a &= (0x7f<<29)|(0x7f<<15)|(0xff); */ |
| 19330 | b &= (0x7f<<14)|(0x7f); |
| 19331 | b = b<<8; |
| 19332 | a |= b; |
| 19333 | |
| 19334 | s = s<<4; |
| 19335 | b = p[-4]; |
| @@ -19445,13 +19475,13 @@ | |
| 19445 | a = a<<14; |
| 19446 | a |= *p; |
| 19447 | /* a: p0<<28 | p2<<14 | p4 (unmasked) */ |
| 19448 | if (!(a&0x80)) |
| 19449 | { |
| 19450 | /* Walues between 268435456 and 34359738367 */ |
| 19451 | a &= (0x1f<<28)|(0x7f<<14)|(0x7f); |
| 19452 | b &= (0x1f<<28)|(0x7f<<14)|(0x7f); |
| 19453 | b = b<<7; |
| 19454 | *v = a | b; |
| 19455 | return 5; |
| 19456 | } |
| 19457 | |
| @@ -21446,11 +21476,11 @@ | |
| 21446 | ** selection of the appropriate locking style based on the filesystem |
| 21447 | ** where the database is located. |
| 21448 | */ |
| 21449 | #if !defined(SQLITE_ENABLE_LOCKING_STYLE) |
| 21450 | # if defined(__APPLE__) |
| 21451 | # define SQLITE_ENABLE_LOCKING_STYLE 1 |
| 21452 | # else |
| 21453 | # define SQLITE_ENABLE_LOCKING_STYLE 0 |
| 21454 | # endif |
| 21455 | #endif |
| 21456 | |
| @@ -21511,10 +21541,13 @@ | |
| 21511 | # include <sys/file.h> |
| 21512 | # include <sys/param.h> |
| 21513 | # include <sys/mount.h> |
| 21514 | # endif |
| 21515 | #endif /* SQLITE_ENABLE_LOCKING_STYLE */ |
| 21516 | |
| 21517 | /* |
| 21518 | ** Allowed values of unixFile.fsFlags |
| 21519 | */ |
| 21520 | #define SQLITE_FSFLAGS_IS_MSDOS 0x1 |
| @@ -23155,11 +23188,11 @@ | |
| 23155 | lock.l_type = F_UNLCK; |
| 23156 | lock.l_whence = SEEK_SET; |
| 23157 | lock.l_start = SHARED_FIRST; |
| 23158 | lock.l_len = divSize; |
| 23159 | if( fcntl(h, F_SETLK, &lock)==(-1) ){ |
| 23160 | int tErrno = errno; |
| 23161 | rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_UNLOCK); |
| 23162 | if( IS_LOCK_ERROR(rc) ){ |
| 23163 | pFile->lastErrno = tErrno; |
| 23164 | } |
| 23165 | goto end_unlock; |
| @@ -23167,11 +23200,11 @@ | |
| 23167 | lock.l_type = F_RDLCK; |
| 23168 | lock.l_whence = SEEK_SET; |
| 23169 | lock.l_start = SHARED_FIRST; |
| 23170 | lock.l_len = divSize; |
| 23171 | if( fcntl(h, F_SETLK, &lock)==(-1) ){ |
| 23172 | int tErrno = errno; |
| 23173 | rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_RDLOCK); |
| 23174 | if( IS_LOCK_ERROR(rc) ){ |
| 23175 | pFile->lastErrno = tErrno; |
| 23176 | } |
| 23177 | goto end_unlock; |
| @@ -23179,11 +23212,11 @@ | |
| 23179 | lock.l_type = F_UNLCK; |
| 23180 | lock.l_whence = SEEK_SET; |
| 23181 | lock.l_start = SHARED_FIRST+divSize; |
| 23182 | lock.l_len = SHARED_SIZE-divSize; |
| 23183 | if( fcntl(h, F_SETLK, &lock)==(-1) ){ |
| 23184 | int tErrno = errno; |
| 23185 | rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_UNLOCK); |
| 23186 | if( IS_LOCK_ERROR(rc) ){ |
| 23187 | pFile->lastErrno = tErrno; |
| 23188 | } |
| 23189 | goto end_unlock; |
| @@ -23192,11 +23225,11 @@ | |
| 23192 | lock.l_type = F_RDLCK; |
| 23193 | lock.l_whence = SEEK_SET; |
| 23194 | lock.l_start = SHARED_FIRST; |
| 23195 | lock.l_len = SHARED_SIZE; |
| 23196 | if( fcntl(h, F_SETLK, &lock)==(-1) ){ |
| 23197 | int tErrno = errno; |
| 23198 | rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_RDLOCK); |
| 23199 | if( IS_LOCK_ERROR(rc) ){ |
| 23200 | pFile->lastErrno = tErrno; |
| 23201 | } |
| 23202 | goto end_unlock; |
| @@ -26491,11 +26524,11 @@ | |
| 26491 | sqlite3_free(pNew); |
| 26492 | sqlite3_free(pUnused); |
| 26493 | return rc; |
| 26494 | } |
| 26495 | |
| 26496 | #ifdef SQLITE_TEST |
| 26497 | /* simulate multiple hosts by creating unique hostid file paths */ |
| 26498 | SQLITE_API int sqlite3_hostid_num = 0; |
| 26499 | #endif |
| 26500 | |
| 26501 | #define PROXY_HOSTIDLEN 16 /* conch file host id length */ |
| @@ -30169,10 +30202,11 @@ | |
| 30169 | SQLITE_PRIVATE void sqlite3PcacheSetPageSize(PCache *pCache, int szPage){ |
| 30170 | assert( pCache->nRef==0 && pCache->pDirty==0 ); |
| 30171 | if( pCache->pCache ){ |
| 30172 | sqlite3GlobalConfig.pcache.xDestroy(pCache->pCache); |
| 30173 | pCache->pCache = 0; |
| 30174 | } |
| 30175 | pCache->szPage = szPage; |
| 30176 | } |
| 30177 | |
| 30178 | /* |
| @@ -43918,12 +43952,19 @@ | |
| 43918 | ** the dropCell() routine will overwrite the entire cell with zeroes. |
| 43919 | ** In this case, temporarily copy the cell into the aOvflSpace[] |
| 43920 | ** buffer. It will be copied out again as soon as the aSpace[] buffer |
| 43921 | ** is allocated. */ |
| 43922 | if( pBt->secureDelete ){ |
| 43923 | memcpy(&aOvflSpace[apDiv[i]-pParent->aData], apDiv[i], szNew[i]); |
| 43924 | apDiv[i] = &aOvflSpace[apDiv[i]-pParent->aData]; |
| 43925 | } |
| 43926 | dropCell(pParent, i+nxDiv-pParent->nOverflow, szNew[i], &rc); |
| 43927 | } |
| 43928 | } |
| 43929 | |
| @@ -58617,11 +58658,13 @@ | |
| 58617 | ** an error of some kind. |
| 58618 | */ |
| 58619 | vdbe_error_halt: |
| 58620 | assert( rc ); |
| 58621 | p->rc = rc; |
| 58622 | sqlite3_log(rc, "prepared statement aborts at %d: [%s]", pc, p->zSql); |
| 58623 | sqlite3VdbeHalt(p); |
| 58624 | if( rc==SQLITE_IOERR_NOMEM ) db->mallocFailed = 1; |
| 58625 | rc = SQLITE_ERROR; |
| 58626 | if( resetSchemaOnFault ) sqlite3ResetInternalSchema(db, 0); |
| 58627 | |
| @@ -73606,12 +73649,12 @@ | |
| 73606 | FUNCTION(randomblob, 1, 0, 0, randomBlob ), |
| 73607 | FUNCTION(nullif, 2, 0, 1, nullifFunc ), |
| 73608 | FUNCTION(sqlite_version, 0, 0, 0, versionFunc ), |
| 73609 | FUNCTION(sqlite_source_id, 0, 0, 0, sourceidFunc ), |
| 73610 | #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS |
| 73611 | FUNCTION(sqlite_compile_option_used,1, 0, 0, compileoptionusedFunc ), |
| 73612 | FUNCTION(sqlite_compile_option_get, 1, 0, 0, compileoptiongetFunc ), |
| 73613 | #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */ |
| 73614 | FUNCTION(quote, 1, 0, 0, quoteFunc ), |
| 73615 | FUNCTION(last_insert_rowid, 0, 0, 0, last_insert_rowid), |
| 73616 | FUNCTION(changes, 0, 0, 0, changes ), |
| 73617 | FUNCTION(total_changes, 0, 0, 0, total_changes ), |
| @@ -79179,22 +79222,14 @@ | |
| 79179 | #endif /* SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS */ |
| 79180 | |
| 79181 | #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS |
| 79182 | /* |
| 79183 | ** PRAGMA compile_options |
| 79184 | ** PRAGMA compile_option(<option>) |
| 79185 | ** |
| 79186 | ** The first form returns a single row for each option that was |
| 79187 | ** defined at compile time. The second form returns 0 or 1 |
| 79188 | ** indicating whether the specified option was defined at |
| 79189 | ** compile time. |
| 79190 | */ |
| 79191 | if( sqlite3StrICmp(zLeft, "compile_option")==0 && zRight ){ |
| 79192 | int used = sqlite3_compileoption_used(zRight); |
| 79193 | returnSingleInt(pParse, zRight, used); |
| 79194 | }else |
| 79195 | |
| 79196 | if( sqlite3StrICmp(zLeft, "compile_options")==0 ){ |
| 79197 | int i = 0; |
| 79198 | const char *zOpt; |
| 79199 | sqlite3VdbeSetNumCols(v, 1); |
| 79200 | pParse->nMem = 1; |
| @@ -86540,11 +86575,15 @@ | |
| 86540 | ** actually occurs when doing a vacuum since the vacuum_db is initially |
| 86541 | ** empty. Only the journal header is written. Apparently it takes more |
| 86542 | ** time to parse and run the PRAGMA to turn journalling off than it does |
| 86543 | ** to write the journal header file. |
| 86544 | */ |
| 86545 | zSql = "ATTACH '' AS vacuum_db;"; |
| 86546 | rc = execSql(db, pzErrMsg, zSql); |
| 86547 | if( rc!=SQLITE_OK ) goto end_of_vacuum; |
| 86548 | pDb = &db->aDb[db->nDb-1]; |
| 86549 | assert( strcmp(db->aDb[db->nDb-1].zName,"vacuum_db")==0 ); |
| 86550 | pTemp = db->aDb[db->nDb-1].pBt; |
| 86551 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -313,41 +313,38 @@ | |
| 313 | ** and with SQLITE_ENABLE_STAT2 |
| 314 | */ |
| 315 | #define SQLITE_INDEX_SAMPLES 10 |
| 316 | |
| 317 | /* |
| 318 | ** The following macros are used to cast pointers to integers and |
| 319 | ** integers to pointers. The way you do this varies from one compiler |
| 320 | ** to the next, so we have developed the following set of #if statements |
| 321 | ** to generate appropriate macros for a wide range of compilers. |
| 322 | ** |
| 323 | ** The correct "ANSI" way to do this is to use the intptr_t type. |
| 324 | ** Unfortunately, that typedef is not available on all compilers, or |
| 325 | ** if it is available, it requires an #include of specific headers |
| 326 | ** that very from one machine to the next. |
| 327 | ** |
| 328 | ** Ticket #3860: The llvm-gcc-4.2 compiler from Apple chokes on |
| 329 | ** the ((void*)&((char*)0)[X]) construct. But MSVC chokes on ((void*)(X)). |
| 330 | ** So we have to define the macros in different ways depending on the |
| 331 | ** compiler. |
| 332 | */ |
| 333 | #if defined(__PTRDIFF_TYPE__) /* This case should work for GCC */ |
| 334 | # define SQLITE_INT_TO_PTR(X) ((void*)(__PTRDIFF_TYPE__)(X)) |
| 335 | # define SQLITE_PTR_TO_INT(X) ((int)(__PTRDIFF_TYPE__)(X)) |
| 336 | #elif !defined(__GNUC__) /* Works for compilers other than LLVM */ |
| 337 | # define SQLITE_INT_TO_PTR(X) ((void*)&((char*)0)[X]) |
| 338 | # define SQLITE_PTR_TO_INT(X) ((int)(((char*)X)-(char*)0)) |
| 339 | #elif defined(HAVE_STDINT_H) /* Use this case if we have ANSI headers */ |
| 340 | # define SQLITE_INT_TO_PTR(X) ((void*)(intptr_t)(X)) |
| 341 | # define SQLITE_PTR_TO_INT(X) ((int)(intptr_t)(X)) |
| 342 | #else /* Generates a warning - but it always works */ |
| 343 | # define SQLITE_INT_TO_PTR(X) ((void*)(X)) |
| 344 | # define SQLITE_PTR_TO_INT(X) ((int)(X)) |
| 345 | #endif |
| 346 | |
| 347 | /* |
| 348 | ** The SQLITE_THREADSAFE macro must be defined as either 0 or 1. |
| 349 | ** Older versions of SQLite used an optional THREADSAFE macro. |
| 350 | ** We support that for legacy |
| @@ -631,11 +628,11 @@ | |
| 628 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 629 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 630 | */ |
| 631 | #define SQLITE_VERSION "3.6.23" |
| 632 | #define SQLITE_VERSION_NUMBER 3006023 |
| 633 | #define SQLITE_SOURCE_ID "2010-03-04 22:36:45 1a0fa8d19d69d4ecaaaa879ac3c893980375fcc6" |
| 634 | |
| 635 | /* |
| 636 | ** CAPI3REF: Run-Time Library Version Numbers |
| 637 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 638 | ** |
| @@ -668,13 +665,13 @@ | |
| 665 | SQLITE_API const char sqlite3_version[] = SQLITE_VERSION; |
| 666 | SQLITE_API const char *sqlite3_libversion(void); |
| 667 | SQLITE_API const char *sqlite3_sourceid(void); |
| 668 | SQLITE_API int sqlite3_libversion_number(void); |
| 669 | |
| 670 | #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS |
| 671 | /* |
| 672 | ** CAPI3REF: Run-Time Library Compilation Options Diagnostics |
| 673 | ** |
| 674 | ** ^The sqlite3_compileoption_used() function returns 0 or 1 |
| 675 | ** indicating whether the specified option was defined at |
| 676 | ** compile time. ^The SQLITE_ prefix may be omitted from the |
| 677 | ** option name passed to sqlite3_compileoption_used(). |
| @@ -686,15 +683,15 @@ | |
| 683 | ** prefix is omitted from any strings returned by |
| 684 | ** sqlite3_compileoption_get(). |
| 685 | ** |
| 686 | ** ^Support for the diagnostic functions sqlite3_compileoption_used() |
| 687 | ** and sqlite3_compileoption_get() may be omitted by specifing the |
| 688 | ** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time. |
| 689 | ** |
| 690 | ** See also: SQL functions [sqlite_compileoption_used()] and |
| 691 | ** [sqlite_compileoption_get()] and the [compile_options pragma]. |
| 692 | */ |
| 693 | SQLITE_API int sqlite3_compileoption_used(const char *zOptName); |
| 694 | SQLITE_API const char *sqlite3_compileoption_get(int N); |
| 695 | #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */ |
| 696 | |
| 697 | /* |
| @@ -6222,20 +6219,26 @@ | |
| 6219 | /* |
| 6220 | ** CAPI3REF: Error Logging Interface |
| 6221 | ** EXPERIMENTAL |
| 6222 | ** |
| 6223 | ** ^The [sqlite3_log()] interface writes a message into the error log |
| 6224 | ** established by the [SQLITE_CONFIG_LOG] option to [sqlite3_config()]. |
| 6225 | ** ^If logging is enabled, the zFormat string and subsequent arguments are |
| 6226 | ** passed through to [sqlite3_vmprintf()] to generate the final output string. |
| 6227 | ** |
| 6228 | ** The sqlite3_log() interface is intended for use by extensions such as |
| 6229 | ** virtual tables, collating functions, and SQL functions. While there is |
| 6230 | ** nothing to prevent an application from calling sqlite3_log(), doing so |
| 6231 | ** is considered bad form. |
| 6232 | ** |
| 6233 | ** The zFormat string must not be NULL. |
| 6234 | ** |
| 6235 | ** To avoid deadlocks and other threading problems, the sqlite3_log() routine |
| 6236 | ** will not use dynamically allocated memory. The log message is stored in |
| 6237 | ** a fixed-length buffer on the stack. If the log message is longer than |
| 6238 | ** a few hundred characters, it will be truncated to the length of the |
| 6239 | ** buffer. |
| 6240 | */ |
| 6241 | SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...); |
| 6242 | |
| 6243 | /* |
| 6244 | ** Undo the hack that converts floating point types to integer for |
| @@ -16867,11 +16870,13 @@ | |
| 16870 | break; |
| 16871 | case etFLOAT: |
| 16872 | case etEXP: |
| 16873 | case etGENERIC: |
| 16874 | realvalue = va_arg(ap,double); |
| 16875 | #ifdef SQLITE_OMIT_FLOATING_POINT |
| 16876 | length = 0; |
| 16877 | #else |
| 16878 | if( precision<0 ) precision = 6; /* Set default precision */ |
| 16879 | if( precision>etBUFSIZE/2-10 ) precision = etBUFSIZE/2-10; |
| 16880 | if( realvalue<0.0 ){ |
| 16881 | realvalue = -realvalue; |
| 16882 | prefix = '-'; |
| @@ -17013,13 +17018,11 @@ | |
| 17018 | } |
| 17019 | i = prefix!=0; |
| 17020 | while( nPad-- ) bufpt[i++] = '0'; |
| 17021 | length = width; |
| 17022 | } |
| 17023 | #endif /* !defined(SQLITE_OMIT_FLOATING_POINT) */ |
| 17024 | break; |
| 17025 | case etSIZE: |
| 17026 | *(va_arg(ap,int*)) = pAccum->nChar; |
| 17027 | length = width = 0; |
| 17028 | break; |
| @@ -17062,11 +17065,11 @@ | |
| 17065 | char q = ((xtype==etSQLESCAPE3)?'"':'\''); /* Quote character */ |
| 17066 | char *escarg = va_arg(ap,char*); |
| 17067 | isnull = escarg==0; |
| 17068 | if( isnull ) escarg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)"); |
| 17069 | k = precision; |
| 17070 | for(i=n=0; k!=0 && (ch=escarg[i])!=0; i++, k--){ |
| 17071 | if( ch==q ) n++; |
| 17072 | } |
| 17073 | needQuote = !isnull && xtype==etSQLESCAPE2; |
| 17074 | n += i + 1 + needQuote*2; |
| 17075 | if( n>etBUFSIZE ){ |
| @@ -17345,30 +17348,40 @@ | |
| 17348 | sqlite3VXPrintf(&acc, 0, zFormat, ap); |
| 17349 | va_end(ap); |
| 17350 | z = sqlite3StrAccumFinish(&acc); |
| 17351 | return z; |
| 17352 | } |
| 17353 | |
| 17354 | /* |
| 17355 | ** This is the routine that actually formats the sqlite3_log() message. |
| 17356 | ** We house it in a separate routine from sqlite3_log() to avoid using |
| 17357 | ** stack space on small-stack systems when logging is disabled. |
| 17358 | ** |
| 17359 | ** sqlite3_log() must render into a static buffer. It cannot dynamically |
| 17360 | ** allocate memory because it might be called while the memory allocator |
| 17361 | ** mutex is held. |
| 17362 | */ |
| 17363 | static void renderLogMsg(int iErrCode, const char *zFormat, va_list ap){ |
| 17364 | StrAccum acc; /* String accumulator */ |
| 17365 | char zMsg[SQLITE_PRINT_BUF_SIZE*3]; /* Complete log message */ |
| 17366 | |
| 17367 | sqlite3StrAccumInit(&acc, zMsg, sizeof(zMsg), 0); |
| 17368 | acc.useMalloc = 0; |
| 17369 | sqlite3VXPrintf(&acc, 0, zFormat, ap); |
| 17370 | sqlite3GlobalConfig.xLog(sqlite3GlobalConfig.pLogArg, iErrCode, |
| 17371 | sqlite3StrAccumFinish(&acc)); |
| 17372 | } |
| 17373 | |
| 17374 | /* |
| 17375 | ** Format and write a message to the log if logging is enabled. |
| 17376 | */ |
| 17377 | SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...){ |
| 17378 | va_list ap; /* Vararg list */ |
| 17379 | if( sqlite3GlobalConfig.xLog ){ |
| 17380 | va_start(ap, zFormat); |
| 17381 | renderLogMsg(iErrCode, zFormat, ap); |
| 17382 | va_end(ap); |
| 17383 | } |
| 17384 | } |
| 17385 | |
| 17386 | #if defined(SQLITE_DEBUG) |
| 17387 | /* |
| @@ -19180,10 +19193,23 @@ | |
| 19193 | p[1] = (u8)(v & 0x7f); |
| 19194 | return 2; |
| 19195 | } |
| 19196 | return sqlite3PutVarint(p, v); |
| 19197 | } |
| 19198 | |
| 19199 | /* |
| 19200 | ** Bitmasks used by sqlite3GetVarint(). These precomputed constants |
| 19201 | ** are defined here rather than simply putting the constant expressions |
| 19202 | ** inline in order to work around bugs in the RVT compiler. |
| 19203 | ** |
| 19204 | ** SLOT_2_0 A mask for (0x7f<<14) | 0x7f |
| 19205 | ** |
| 19206 | ** SLOT_4_2_0 A mask for (0x7f<<28) | SLOT_2_0 |
| 19207 | */ |
| 19208 | #define SLOT_2_0 0x001fc07f |
| 19209 | #define SLOT_4_2_0 0xf01fc07f |
| 19210 | |
| 19211 | |
| 19212 | /* |
| 19213 | ** Read a 64-bit variable-length integer from memory starting at p[0]. |
| 19214 | ** Return the number of bytes read. The value is stored in *v. |
| 19215 | */ |
| @@ -19208,33 +19234,37 @@ | |
| 19234 | a |= b; |
| 19235 | *v = a; |
| 19236 | return 2; |
| 19237 | } |
| 19238 | |
| 19239 | /* Verify that constants are precomputed correctly */ |
| 19240 | assert( SLOT_2_0 == ((0x7f<<14) | (0x7f)) ); |
| 19241 | assert( SLOT_4_2_0 == ((0xf<<28) | (0x7f<<14) | (0x7f)) ); |
| 19242 | |
| 19243 | p++; |
| 19244 | a = a<<14; |
| 19245 | a |= *p; |
| 19246 | /* a: p0<<14 | p2 (unmasked) */ |
| 19247 | if (!(a&0x80)) |
| 19248 | { |
| 19249 | a &= SLOT_2_0; |
| 19250 | b &= 0x7f; |
| 19251 | b = b<<7; |
| 19252 | a |= b; |
| 19253 | *v = a; |
| 19254 | return 3; |
| 19255 | } |
| 19256 | |
| 19257 | /* CSE1 from below */ |
| 19258 | a &= SLOT_2_0; |
| 19259 | p++; |
| 19260 | b = b<<14; |
| 19261 | b |= *p; |
| 19262 | /* b: p1<<14 | p3 (unmasked) */ |
| 19263 | if (!(b&0x80)) |
| 19264 | { |
| 19265 | b &= SLOT_2_0; |
| 19266 | /* moved CSE1 up */ |
| 19267 | /* a &= (0x7f<<14)|(0x7f); */ |
| 19268 | a = a<<7; |
| 19269 | a |= b; |
| 19270 | *v = a; |
| @@ -19244,11 +19274,11 @@ | |
| 19274 | /* a: p0<<14 | p2 (masked) */ |
| 19275 | /* b: p1<<14 | p3 (unmasked) */ |
| 19276 | /* 1:save off p0<<21 | p1<<14 | p2<<7 | p3 (masked) */ |
| 19277 | /* moved CSE1 up */ |
| 19278 | /* a &= (0x7f<<14)|(0x7f); */ |
| 19279 | b &= SLOT_2_0; |
| 19280 | s = a; |
| 19281 | /* s: p0<<14 | p2 (masked) */ |
| 19282 | |
| 19283 | p++; |
| 19284 | a = a<<14; |
| @@ -19277,11 +19307,11 @@ | |
| 19307 | /* b: p1<<28 | p3<<14 | p5 (unmasked) */ |
| 19308 | if (!(b&0x80)) |
| 19309 | { |
| 19310 | /* we can skip this cause it was (effectively) done above in calc'ing s */ |
| 19311 | /* b &= (0x7f<<28)|(0x7f<<14)|(0x7f); */ |
| 19312 | a &= SLOT_2_0; |
| 19313 | a = a<<7; |
| 19314 | a |= b; |
| 19315 | s = s>>18; |
| 19316 | *v = ((u64)s)<<32 | a; |
| 19317 | return 6; |
| @@ -19291,28 +19321,28 @@ | |
| 19321 | a = a<<14; |
| 19322 | a |= *p; |
| 19323 | /* a: p2<<28 | p4<<14 | p6 (unmasked) */ |
| 19324 | if (!(a&0x80)) |
| 19325 | { |
| 19326 | a &= SLOT_4_2_0; |
| 19327 | b &= SLOT_2_0; |
| 19328 | b = b<<7; |
| 19329 | a |= b; |
| 19330 | s = s>>11; |
| 19331 | *v = ((u64)s)<<32 | a; |
| 19332 | return 7; |
| 19333 | } |
| 19334 | |
| 19335 | /* CSE2 from below */ |
| 19336 | a &= SLOT_2_0; |
| 19337 | p++; |
| 19338 | b = b<<14; |
| 19339 | b |= *p; |
| 19340 | /* b: p3<<28 | p5<<14 | p7 (unmasked) */ |
| 19341 | if (!(b&0x80)) |
| 19342 | { |
| 19343 | b &= SLOT_4_2_0; |
| 19344 | /* moved CSE2 up */ |
| 19345 | /* a &= (0x7f<<14)|(0x7f); */ |
| 19346 | a = a<<7; |
| 19347 | a |= b; |
| 19348 | s = s>>4; |
| @@ -19325,11 +19355,11 @@ | |
| 19355 | a |= *p; |
| 19356 | /* a: p4<<29 | p6<<15 | p8 (unmasked) */ |
| 19357 | |
| 19358 | /* moved CSE2 up */ |
| 19359 | /* a &= (0x7f<<29)|(0x7f<<15)|(0xff); */ |
| 19360 | b &= SLOT_2_0; |
| 19361 | b = b<<8; |
| 19362 | a |= b; |
| 19363 | |
| 19364 | s = s<<4; |
| 19365 | b = p[-4]; |
| @@ -19445,13 +19475,13 @@ | |
| 19475 | a = a<<14; |
| 19476 | a |= *p; |
| 19477 | /* a: p0<<28 | p2<<14 | p4 (unmasked) */ |
| 19478 | if (!(a&0x80)) |
| 19479 | { |
| 19480 | /* Values between 268435456 and 34359738367 */ |
| 19481 | a &= SLOT_4_2_0; |
| 19482 | b &= SLOT_4_2_0; |
| 19483 | b = b<<7; |
| 19484 | *v = a | b; |
| 19485 | return 5; |
| 19486 | } |
| 19487 | |
| @@ -21446,11 +21476,11 @@ | |
| 21476 | ** selection of the appropriate locking style based on the filesystem |
| 21477 | ** where the database is located. |
| 21478 | */ |
| 21479 | #if !defined(SQLITE_ENABLE_LOCKING_STYLE) |
| 21480 | # if defined(__APPLE__) |
| 21481 | # define SQLITE_ENABLE_LOCKING_STYLE 0 |
| 21482 | # else |
| 21483 | # define SQLITE_ENABLE_LOCKING_STYLE 0 |
| 21484 | # endif |
| 21485 | #endif |
| 21486 | |
| @@ -21511,10 +21541,13 @@ | |
| 21541 | # include <sys/file.h> |
| 21542 | # include <sys/param.h> |
| 21543 | # include <sys/mount.h> |
| 21544 | # endif |
| 21545 | #endif /* SQLITE_ENABLE_LOCKING_STYLE */ |
| 21546 | |
| 21547 | #ifdef __APPLE__ |
| 21548 | #endif |
| 21549 | |
| 21550 | /* |
| 21551 | ** Allowed values of unixFile.fsFlags |
| 21552 | */ |
| 21553 | #define SQLITE_FSFLAGS_IS_MSDOS 0x1 |
| @@ -23155,11 +23188,11 @@ | |
| 23188 | lock.l_type = F_UNLCK; |
| 23189 | lock.l_whence = SEEK_SET; |
| 23190 | lock.l_start = SHARED_FIRST; |
| 23191 | lock.l_len = divSize; |
| 23192 | if( fcntl(h, F_SETLK, &lock)==(-1) ){ |
| 23193 | tErrno = errno; |
| 23194 | rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_UNLOCK); |
| 23195 | if( IS_LOCK_ERROR(rc) ){ |
| 23196 | pFile->lastErrno = tErrno; |
| 23197 | } |
| 23198 | goto end_unlock; |
| @@ -23167,11 +23200,11 @@ | |
| 23200 | lock.l_type = F_RDLCK; |
| 23201 | lock.l_whence = SEEK_SET; |
| 23202 | lock.l_start = SHARED_FIRST; |
| 23203 | lock.l_len = divSize; |
| 23204 | if( fcntl(h, F_SETLK, &lock)==(-1) ){ |
| 23205 | tErrno = errno; |
| 23206 | rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_RDLOCK); |
| 23207 | if( IS_LOCK_ERROR(rc) ){ |
| 23208 | pFile->lastErrno = tErrno; |
| 23209 | } |
| 23210 | goto end_unlock; |
| @@ -23179,11 +23212,11 @@ | |
| 23212 | lock.l_type = F_UNLCK; |
| 23213 | lock.l_whence = SEEK_SET; |
| 23214 | lock.l_start = SHARED_FIRST+divSize; |
| 23215 | lock.l_len = SHARED_SIZE-divSize; |
| 23216 | if( fcntl(h, F_SETLK, &lock)==(-1) ){ |
| 23217 | tErrno = errno; |
| 23218 | rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_UNLOCK); |
| 23219 | if( IS_LOCK_ERROR(rc) ){ |
| 23220 | pFile->lastErrno = tErrno; |
| 23221 | } |
| 23222 | goto end_unlock; |
| @@ -23192,11 +23225,11 @@ | |
| 23225 | lock.l_type = F_RDLCK; |
| 23226 | lock.l_whence = SEEK_SET; |
| 23227 | lock.l_start = SHARED_FIRST; |
| 23228 | lock.l_len = SHARED_SIZE; |
| 23229 | if( fcntl(h, F_SETLK, &lock)==(-1) ){ |
| 23230 | tErrno = errno; |
| 23231 | rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_RDLOCK); |
| 23232 | if( IS_LOCK_ERROR(rc) ){ |
| 23233 | pFile->lastErrno = tErrno; |
| 23234 | } |
| 23235 | goto end_unlock; |
| @@ -26491,11 +26524,11 @@ | |
| 26524 | sqlite3_free(pNew); |
| 26525 | sqlite3_free(pUnused); |
| 26526 | return rc; |
| 26527 | } |
| 26528 | |
| 26529 | #if defined(SQLITE_TEST) && defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE |
| 26530 | /* simulate multiple hosts by creating unique hostid file paths */ |
| 26531 | SQLITE_API int sqlite3_hostid_num = 0; |
| 26532 | #endif |
| 26533 | |
| 26534 | #define PROXY_HOSTIDLEN 16 /* conch file host id length */ |
| @@ -30169,10 +30202,11 @@ | |
| 30202 | SQLITE_PRIVATE void sqlite3PcacheSetPageSize(PCache *pCache, int szPage){ |
| 30203 | assert( pCache->nRef==0 && pCache->pDirty==0 ); |
| 30204 | if( pCache->pCache ){ |
| 30205 | sqlite3GlobalConfig.pcache.xDestroy(pCache->pCache); |
| 30206 | pCache->pCache = 0; |
| 30207 | pCache->pPage1 = 0; |
| 30208 | } |
| 30209 | pCache->szPage = szPage; |
| 30210 | } |
| 30211 | |
| 30212 | /* |
| @@ -43918,12 +43952,19 @@ | |
| 43952 | ** the dropCell() routine will overwrite the entire cell with zeroes. |
| 43953 | ** In this case, temporarily copy the cell into the aOvflSpace[] |
| 43954 | ** buffer. It will be copied out again as soon as the aSpace[] buffer |
| 43955 | ** is allocated. */ |
| 43956 | if( pBt->secureDelete ){ |
| 43957 | int iOff = apDiv[i] - pParent->aData; |
| 43958 | if( (iOff+szNew[i])>pBt->usableSize ){ |
| 43959 | rc = SQLITE_CORRUPT_BKPT; |
| 43960 | memset(apOld, 0, (i+1)*sizeof(MemPage*)); |
| 43961 | goto balance_cleanup; |
| 43962 | }else{ |
| 43963 | memcpy(&aOvflSpace[iOff], apDiv[i], szNew[i]); |
| 43964 | apDiv[i] = &aOvflSpace[apDiv[i]-pParent->aData]; |
| 43965 | } |
| 43966 | } |
| 43967 | dropCell(pParent, i+nxDiv-pParent->nOverflow, szNew[i], &rc); |
| 43968 | } |
| 43969 | } |
| 43970 | |
| @@ -58617,11 +58658,13 @@ | |
| 58658 | ** an error of some kind. |
| 58659 | */ |
| 58660 | vdbe_error_halt: |
| 58661 | assert( rc ); |
| 58662 | p->rc = rc; |
| 58663 | testcase( sqlite3GlobalConfig.xLog!=0 ); |
| 58664 | sqlite3_log(rc, "statement aborts at %d: [%s] %s", |
| 58665 | pc, p->zSql, p->zErrMsg); |
| 58666 | sqlite3VdbeHalt(p); |
| 58667 | if( rc==SQLITE_IOERR_NOMEM ) db->mallocFailed = 1; |
| 58668 | rc = SQLITE_ERROR; |
| 58669 | if( resetSchemaOnFault ) sqlite3ResetInternalSchema(db, 0); |
| 58670 | |
| @@ -73606,12 +73649,12 @@ | |
| 73649 | FUNCTION(randomblob, 1, 0, 0, randomBlob ), |
| 73650 | FUNCTION(nullif, 2, 0, 1, nullifFunc ), |
| 73651 | FUNCTION(sqlite_version, 0, 0, 0, versionFunc ), |
| 73652 | FUNCTION(sqlite_source_id, 0, 0, 0, sourceidFunc ), |
| 73653 | #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS |
| 73654 | FUNCTION(sqlite_compileoption_used,1, 0, 0, compileoptionusedFunc ), |
| 73655 | FUNCTION(sqlite_compileoption_get, 1, 0, 0, compileoptiongetFunc ), |
| 73656 | #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */ |
| 73657 | FUNCTION(quote, 1, 0, 0, quoteFunc ), |
| 73658 | FUNCTION(last_insert_rowid, 0, 0, 0, last_insert_rowid), |
| 73659 | FUNCTION(changes, 0, 0, 0, changes ), |
| 73660 | FUNCTION(total_changes, 0, 0, 0, total_changes ), |
| @@ -79179,22 +79222,14 @@ | |
| 79222 | #endif /* SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS */ |
| 79223 | |
| 79224 | #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS |
| 79225 | /* |
| 79226 | ** PRAGMA compile_options |
| 79227 | ** |
| 79228 | ** Return the names of all compile-time options used in this build, |
| 79229 | ** one option per row. |
| 79230 | */ |
| 79231 | if( sqlite3StrICmp(zLeft, "compile_options")==0 ){ |
| 79232 | int i = 0; |
| 79233 | const char *zOpt; |
| 79234 | sqlite3VdbeSetNumCols(v, 1); |
| 79235 | pParse->nMem = 1; |
| @@ -86540,11 +86575,15 @@ | |
| 86575 | ** actually occurs when doing a vacuum since the vacuum_db is initially |
| 86576 | ** empty. Only the journal header is written. Apparently it takes more |
| 86577 | ** time to parse and run the PRAGMA to turn journalling off than it does |
| 86578 | ** to write the journal header file. |
| 86579 | */ |
| 86580 | if( sqlite3TempInMemory(db) ){ |
| 86581 | zSql = "ATTACH ':memory:' AS vacuum_db;"; |
| 86582 | }else{ |
| 86583 | zSql = "ATTACH '' AS vacuum_db;"; |
| 86584 | } |
| 86585 | rc = execSql(db, pzErrMsg, zSql); |
| 86586 | if( rc!=SQLITE_OK ) goto end_of_vacuum; |
| 86587 | pDb = &db->aDb[db->nDb-1]; |
| 86588 | assert( strcmp(db->aDb[db->nDb-1].zName,"vacuum_db")==0 ); |
| 86589 | pTemp = db->aDb[db->nDb-1].pBt; |
| 86590 |
+12
-6
| --- src/sqlite3.h | ||
| +++ src/sqlite3.h | ||
| @@ -107,11 +107,11 @@ | ||
| 107 | 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | 109 | */ |
| 110 | 110 | #define SQLITE_VERSION "3.6.23" |
| 111 | 111 | #define SQLITE_VERSION_NUMBER 3006023 |
| 112 | -#define SQLITE_SOURCE_ID "2010-02-26 13:07:37 8f29490da62df07ea922b03cab52b6edd2669edb" | |
| 112 | +#define SQLITE_SOURCE_ID "2010-03-04 22:36:45 1a0fa8d19d69d4ecaaaa879ac3c893980375fcc6" | |
| 113 | 113 | |
| 114 | 114 | /* |
| 115 | 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | 117 | ** |
| @@ -144,13 +144,13 @@ | ||
| 144 | 144 | SQLITE_API SQLITE_EXTERN const char sqlite3_version[]; |
| 145 | 145 | SQLITE_API const char *sqlite3_libversion(void); |
| 146 | 146 | SQLITE_API const char *sqlite3_sourceid(void); |
| 147 | 147 | SQLITE_API int sqlite3_libversion_number(void); |
| 148 | 148 | |
| 149 | +#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS | |
| 149 | 150 | /* |
| 150 | 151 | ** CAPI3REF: Run-Time Library Compilation Options Diagnostics |
| 151 | -** KEYWORDS: sqlite3_compileoption_used, sqlite3_compileoption_get | |
| 152 | 152 | ** |
| 153 | 153 | ** ^The sqlite3_compileoption_used() function returns 0 or 1 |
| 154 | 154 | ** indicating whether the specified option was defined at |
| 155 | 155 | ** compile time. ^The SQLITE_ prefix may be omitted from the |
| 156 | 156 | ** option name passed to sqlite3_compileoption_used(). |
| @@ -162,15 +162,15 @@ | ||
| 162 | 162 | ** prefix is omitted from any strings returned by |
| 163 | 163 | ** sqlite3_compileoption_get(). |
| 164 | 164 | ** |
| 165 | 165 | ** ^Support for the diagnostic functions sqlite3_compileoption_used() |
| 166 | 166 | ** and sqlite3_compileoption_get() may be omitted by specifing the |
| 167 | -** SQLITE_OMIT_COMPILEOPTION_DIAGS option at compile time. | |
| 167 | +** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time. | |
| 168 | 168 | ** |
| 169 | -** See also: [sqlite_compile_option_used()] and [sqlite_compile_option_get()]. | |
| 169 | +** See also: SQL functions [sqlite_compileoption_used()] and | |
| 170 | +** [sqlite_compileoption_get()] and the [compile_options pragma]. | |
| 170 | 171 | */ |
| 171 | -#ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS | |
| 172 | 172 | SQLITE_API int sqlite3_compileoption_used(const char *zOptName); |
| 173 | 173 | SQLITE_API const char *sqlite3_compileoption_get(int N); |
| 174 | 174 | #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */ |
| 175 | 175 | |
| 176 | 176 | /* |
| @@ -5698,20 +5698,26 @@ | ||
| 5698 | 5698 | /* |
| 5699 | 5699 | ** CAPI3REF: Error Logging Interface |
| 5700 | 5700 | ** EXPERIMENTAL |
| 5701 | 5701 | ** |
| 5702 | 5702 | ** ^The [sqlite3_log()] interface writes a message into the error log |
| 5703 | -** established by the [SQLITE_CONFIG_ERRORLOG] option to [sqlite3_config()]. | |
| 5703 | +** established by the [SQLITE_CONFIG_LOG] option to [sqlite3_config()]. | |
| 5704 | 5704 | ** ^If logging is enabled, the zFormat string and subsequent arguments are |
| 5705 | 5705 | ** passed through to [sqlite3_vmprintf()] to generate the final output string. |
| 5706 | 5706 | ** |
| 5707 | 5707 | ** The sqlite3_log() interface is intended for use by extensions such as |
| 5708 | 5708 | ** virtual tables, collating functions, and SQL functions. While there is |
| 5709 | 5709 | ** nothing to prevent an application from calling sqlite3_log(), doing so |
| 5710 | 5710 | ** is considered bad form. |
| 5711 | 5711 | ** |
| 5712 | 5712 | ** The zFormat string must not be NULL. |
| 5713 | +** | |
| 5714 | +** To avoid deadlocks and other threading problems, the sqlite3_log() routine | |
| 5715 | +** will not use dynamically allocated memory. The log message is stored in | |
| 5716 | +** a fixed-length buffer on the stack. If the log message is longer than | |
| 5717 | +** a few hundred characters, it will be truncated to the length of the | |
| 5718 | +** buffer. | |
| 5713 | 5719 | */ |
| 5714 | 5720 | SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...); |
| 5715 | 5721 | |
| 5716 | 5722 | /* |
| 5717 | 5723 | ** Undo the hack that converts floating point types to integer for |
| 5718 | 5724 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -107,11 +107,11 @@ | |
| 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | */ |
| 110 | #define SQLITE_VERSION "3.6.23" |
| 111 | #define SQLITE_VERSION_NUMBER 3006023 |
| 112 | #define SQLITE_SOURCE_ID "2010-02-26 13:07:37 8f29490da62df07ea922b03cab52b6edd2669edb" |
| 113 | |
| 114 | /* |
| 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | ** |
| @@ -144,13 +144,13 @@ | |
| 144 | SQLITE_API SQLITE_EXTERN const char sqlite3_version[]; |
| 145 | SQLITE_API const char *sqlite3_libversion(void); |
| 146 | SQLITE_API const char *sqlite3_sourceid(void); |
| 147 | SQLITE_API int sqlite3_libversion_number(void); |
| 148 | |
| 149 | /* |
| 150 | ** CAPI3REF: Run-Time Library Compilation Options Diagnostics |
| 151 | ** KEYWORDS: sqlite3_compileoption_used, sqlite3_compileoption_get |
| 152 | ** |
| 153 | ** ^The sqlite3_compileoption_used() function returns 0 or 1 |
| 154 | ** indicating whether the specified option was defined at |
| 155 | ** compile time. ^The SQLITE_ prefix may be omitted from the |
| 156 | ** option name passed to sqlite3_compileoption_used(). |
| @@ -162,15 +162,15 @@ | |
| 162 | ** prefix is omitted from any strings returned by |
| 163 | ** sqlite3_compileoption_get(). |
| 164 | ** |
| 165 | ** ^Support for the diagnostic functions sqlite3_compileoption_used() |
| 166 | ** and sqlite3_compileoption_get() may be omitted by specifing the |
| 167 | ** SQLITE_OMIT_COMPILEOPTION_DIAGS option at compile time. |
| 168 | ** |
| 169 | ** See also: [sqlite_compile_option_used()] and [sqlite_compile_option_get()]. |
| 170 | */ |
| 171 | #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS |
| 172 | SQLITE_API int sqlite3_compileoption_used(const char *zOptName); |
| 173 | SQLITE_API const char *sqlite3_compileoption_get(int N); |
| 174 | #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */ |
| 175 | |
| 176 | /* |
| @@ -5698,20 +5698,26 @@ | |
| 5698 | /* |
| 5699 | ** CAPI3REF: Error Logging Interface |
| 5700 | ** EXPERIMENTAL |
| 5701 | ** |
| 5702 | ** ^The [sqlite3_log()] interface writes a message into the error log |
| 5703 | ** established by the [SQLITE_CONFIG_ERRORLOG] option to [sqlite3_config()]. |
| 5704 | ** ^If logging is enabled, the zFormat string and subsequent arguments are |
| 5705 | ** passed through to [sqlite3_vmprintf()] to generate the final output string. |
| 5706 | ** |
| 5707 | ** The sqlite3_log() interface is intended for use by extensions such as |
| 5708 | ** virtual tables, collating functions, and SQL functions. While there is |
| 5709 | ** nothing to prevent an application from calling sqlite3_log(), doing so |
| 5710 | ** is considered bad form. |
| 5711 | ** |
| 5712 | ** The zFormat string must not be NULL. |
| 5713 | */ |
| 5714 | SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...); |
| 5715 | |
| 5716 | /* |
| 5717 | ** Undo the hack that converts floating point types to integer for |
| 5718 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -107,11 +107,11 @@ | |
| 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | */ |
| 110 | #define SQLITE_VERSION "3.6.23" |
| 111 | #define SQLITE_VERSION_NUMBER 3006023 |
| 112 | #define SQLITE_SOURCE_ID "2010-03-04 22:36:45 1a0fa8d19d69d4ecaaaa879ac3c893980375fcc6" |
| 113 | |
| 114 | /* |
| 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | ** |
| @@ -144,13 +144,13 @@ | |
| 144 | SQLITE_API SQLITE_EXTERN const char sqlite3_version[]; |
| 145 | SQLITE_API const char *sqlite3_libversion(void); |
| 146 | SQLITE_API const char *sqlite3_sourceid(void); |
| 147 | SQLITE_API int sqlite3_libversion_number(void); |
| 148 | |
| 149 | #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS |
| 150 | /* |
| 151 | ** CAPI3REF: Run-Time Library Compilation Options Diagnostics |
| 152 | ** |
| 153 | ** ^The sqlite3_compileoption_used() function returns 0 or 1 |
| 154 | ** indicating whether the specified option was defined at |
| 155 | ** compile time. ^The SQLITE_ prefix may be omitted from the |
| 156 | ** option name passed to sqlite3_compileoption_used(). |
| @@ -162,15 +162,15 @@ | |
| 162 | ** prefix is omitted from any strings returned by |
| 163 | ** sqlite3_compileoption_get(). |
| 164 | ** |
| 165 | ** ^Support for the diagnostic functions sqlite3_compileoption_used() |
| 166 | ** and sqlite3_compileoption_get() may be omitted by specifing the |
| 167 | ** [SQLITE_OMIT_COMPILEOPTION_DIAGS] option at compile time. |
| 168 | ** |
| 169 | ** See also: SQL functions [sqlite_compileoption_used()] and |
| 170 | ** [sqlite_compileoption_get()] and the [compile_options pragma]. |
| 171 | */ |
| 172 | SQLITE_API int sqlite3_compileoption_used(const char *zOptName); |
| 173 | SQLITE_API const char *sqlite3_compileoption_get(int N); |
| 174 | #endif /* SQLITE_OMIT_COMPILEOPTION_DIAGS */ |
| 175 | |
| 176 | /* |
| @@ -5698,20 +5698,26 @@ | |
| 5698 | /* |
| 5699 | ** CAPI3REF: Error Logging Interface |
| 5700 | ** EXPERIMENTAL |
| 5701 | ** |
| 5702 | ** ^The [sqlite3_log()] interface writes a message into the error log |
| 5703 | ** established by the [SQLITE_CONFIG_LOG] option to [sqlite3_config()]. |
| 5704 | ** ^If logging is enabled, the zFormat string and subsequent arguments are |
| 5705 | ** passed through to [sqlite3_vmprintf()] to generate the final output string. |
| 5706 | ** |
| 5707 | ** The sqlite3_log() interface is intended for use by extensions such as |
| 5708 | ** virtual tables, collating functions, and SQL functions. While there is |
| 5709 | ** nothing to prevent an application from calling sqlite3_log(), doing so |
| 5710 | ** is considered bad form. |
| 5711 | ** |
| 5712 | ** The zFormat string must not be NULL. |
| 5713 | ** |
| 5714 | ** To avoid deadlocks and other threading problems, the sqlite3_log() routine |
| 5715 | ** will not use dynamically allocated memory. The log message is stored in |
| 5716 | ** a fixed-length buffer on the stack. If the log message is longer than |
| 5717 | ** a few hundred characters, it will be truncated to the length of the |
| 5718 | ** buffer. |
| 5719 | */ |
| 5720 | SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...); |
| 5721 | |
| 5722 | /* |
| 5723 | ** Undo the hack that converts floating point types to integer for |
| 5724 |