| | @@ -1,17 +1,17 @@ |
| 1 | 1 | /****************************************************************************** |
| 2 | 2 | ** This file is an amalgamation of many separate C source files from SQLite |
| 3 | | -** version 3.15.0. By combining all the individual C code files into this |
| 3 | +** version 3.15.0. By combining all the individual C code files into this |
| 4 | 4 | ** single large file, the entire code can be compiled as a single translation |
| 5 | 5 | ** unit. This allows many compilers to do optimizations that would not be |
| 6 | 6 | ** possible if the files were compiled separately. Performance improvements |
| 7 | 7 | ** of 5% or more are commonly seen when SQLite is compiled as a single |
| 8 | 8 | ** translation unit. |
| 9 | 9 | ** |
| 10 | 10 | ** This file is all you need to compile SQLite. To use SQLite in other |
| 11 | 11 | ** programs, you need this file and the "sqlite3.h" header file that defines |
| 12 | | -** the programming interface to the SQLite library. (If you do not have |
| 12 | +** the programming interface to the SQLite library. (If you do not have |
| 13 | 13 | ** the "sqlite3.h" header file at hand, you will find a copy embedded within |
| 14 | 14 | ** the text of this file. Search for "Begin file sqlite3.h" to find the start |
| 15 | 15 | ** of the embedded sqlite3.h header file.) Additional code files may be needed |
| 16 | 16 | ** if you want a wrapper to interface SQLite with your choice of programming |
| 17 | 17 | ** language. The code for the "sqlite3" command-line shell is also in a |
| | @@ -366,11 +366,12 @@ |
| 366 | 366 | ** The SQLITE_VERSION_NUMBER for any given release of SQLite will also |
| 367 | 367 | ** be larger than the release from which it is derived. Either Y will |
| 368 | 368 | ** be held constant and Z will be incremented or else Y will be incremented |
| 369 | 369 | ** and Z will be reset to zero. |
| 370 | 370 | ** |
| 371 | | -** Since version 3.6.18, SQLite source code has been stored in the |
| 371 | +** Since [version 3.6.18] ([dateof:3.6.18]), |
| 372 | +** SQLite source code has been stored in the |
| 372 | 373 | ** <a href="http://www.fossil-scm.org/">Fossil configuration management |
| 373 | 374 | ** system</a>. ^The SQLITE_SOURCE_ID macro evaluates to |
| 374 | 375 | ** a string which identifies a particular check-in of SQLite |
| 375 | 376 | ** within its configuration management system. ^The SQLITE_SOURCE_ID |
| 376 | 377 | ** string contains the date and time of the check-in (UTC) and an SHA1 |
| | @@ -380,11 +381,11 @@ |
| 380 | 381 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 381 | 382 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 382 | 383 | */ |
| 383 | 384 | #define SQLITE_VERSION "3.15.0" |
| 384 | 385 | #define SQLITE_VERSION_NUMBER 3015000 |
| 385 | | -#define SQLITE_SOURCE_ID "2016-09-10 19:51:40 711c59171b22df04224183a713e6c36e0bb3bba8" |
| 386 | +#define SQLITE_SOURCE_ID "2016-09-22 18:53:13 c3774c6a5fe48af91fda28e9e18c6ed9053ea992" |
| 386 | 387 | |
| 387 | 388 | /* |
| 388 | 389 | ** CAPI3REF: Run-Time Library Version Numbers |
| 389 | 390 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 390 | 391 | ** |
| | @@ -413,13 +414,13 @@ |
| 413 | 414 | ** [SQLITE_SOURCE_ID] C preprocessor macro. |
| 414 | 415 | ** |
| 415 | 416 | ** See also: [sqlite_version()] and [sqlite_source_id()]. |
| 416 | 417 | */ |
| 417 | 418 | SQLITE_API const char sqlite3_version[] = SQLITE_VERSION; |
| 418 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void); |
| 419 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void); |
| 420 | | -SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void); |
| 419 | +SQLITE_API const char *sqlite3_libversion(void); |
| 420 | +SQLITE_API const char *sqlite3_sourceid(void); |
| 421 | +SQLITE_API int sqlite3_libversion_number(void); |
| 421 | 422 | |
| 422 | 423 | /* |
| 423 | 424 | ** CAPI3REF: Run-Time Library Compilation Options Diagnostics |
| 424 | 425 | ** |
| 425 | 426 | ** ^The sqlite3_compileoption_used() function returns 0 or 1 |
| | @@ -440,12 +441,12 @@ |
| 440 | 441 | ** |
| 441 | 442 | ** See also: SQL functions [sqlite_compileoption_used()] and |
| 442 | 443 | ** [sqlite_compileoption_get()] and the [compile_options pragma]. |
| 443 | 444 | */ |
| 444 | 445 | #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS |
| 445 | | -SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName); |
| 446 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N); |
| 446 | +SQLITE_API int sqlite3_compileoption_used(const char *zOptName); |
| 447 | +SQLITE_API const char *sqlite3_compileoption_get(int N); |
| 447 | 448 | #endif |
| 448 | 449 | |
| 449 | 450 | /* |
| 450 | 451 | ** CAPI3REF: Test To See If The Library Is Threadsafe |
| 451 | 452 | ** |
| | @@ -480,11 +481,11 @@ |
| 480 | 481 | ** sqlite3_config(). In other words, the return value from sqlite3_threadsafe() |
| 481 | 482 | ** is unchanged by calls to sqlite3_config().)^ |
| 482 | 483 | ** |
| 483 | 484 | ** See the [threading mode] documentation for additional information. |
| 484 | 485 | */ |
| 485 | | -SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void); |
| 486 | +SQLITE_API int sqlite3_threadsafe(void); |
| 486 | 487 | |
| 487 | 488 | /* |
| 488 | 489 | ** CAPI3REF: Database Connection Handle |
| 489 | 490 | ** KEYWORDS: {database connection} {database connections} |
| 490 | 491 | ** |
| | @@ -577,12 +578,12 @@ |
| 577 | 578 | ** from [sqlite3_open()], [sqlite3_open16()], or |
| 578 | 579 | ** [sqlite3_open_v2()], and not previously closed. |
| 579 | 580 | ** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer |
| 580 | 581 | ** argument is a harmless no-op. |
| 581 | 582 | */ |
| 582 | | -SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3*); |
| 583 | | -SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3*); |
| 583 | +SQLITE_API int sqlite3_close(sqlite3*); |
| 584 | +SQLITE_API int sqlite3_close_v2(sqlite3*); |
| 584 | 585 | |
| 585 | 586 | /* |
| 586 | 587 | ** The type for a callback function. |
| 587 | 588 | ** This is legacy and deprecated. It is included for historical |
| 588 | 589 | ** compatibility and is not documented. |
| | @@ -649,11 +650,11 @@ |
| 649 | 650 | ** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running. |
| 650 | 651 | ** <li> The application must not modify the SQL statement text passed into |
| 651 | 652 | ** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running. |
| 652 | 653 | ** </ul> |
| 653 | 654 | */ |
| 654 | | -SQLITE_API int SQLITE_STDCALL sqlite3_exec( |
| 655 | +SQLITE_API int sqlite3_exec( |
| 655 | 656 | sqlite3*, /* An open database */ |
| 656 | 657 | const char *sql, /* SQL to be evaluated */ |
| 657 | 658 | int (*callback)(void*,int,char**,char**), /* Callback function */ |
| 658 | 659 | void *, /* 1st argument to callback */ |
| 659 | 660 | char **errmsg /* Error msg written here */ |
| | @@ -710,11 +711,12 @@ |
| 710 | 711 | ** |
| 711 | 712 | ** In its default configuration, SQLite API routines return one of 30 integer |
| 712 | 713 | ** [result codes]. However, experience has shown that many of |
| 713 | 714 | ** these result codes are too coarse-grained. They do not provide as |
| 714 | 715 | ** much information about problems as programmers might like. In an effort to |
| 715 | | -** address this, newer versions of SQLite (version 3.3.8 and later) include |
| 716 | +** address this, newer versions of SQLite (version 3.3.8 [dateof:3.3.8] |
| 717 | +** and later) include |
| 716 | 718 | ** support for additional result codes that provide more detailed information |
| 717 | 719 | ** about errors. These [extended result codes] are enabled or disabled |
| 718 | 720 | ** on a per database connection basis using the |
| 719 | 721 | ** [sqlite3_extended_result_codes()] API. Or, the extended code for |
| 720 | 722 | ** the most recent error can be obtained using |
| | @@ -1648,14 +1650,14 @@ |
| 1648 | 1650 | ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied |
| 1649 | 1651 | ** implementation of sqlite3_os_init() or sqlite3_os_end() |
| 1650 | 1652 | ** must return [SQLITE_OK] on success and some other [error code] upon |
| 1651 | 1653 | ** failure. |
| 1652 | 1654 | */ |
| 1653 | | -SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void); |
| 1654 | | -SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void); |
| 1655 | | -SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void); |
| 1656 | | -SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void); |
| 1655 | +SQLITE_API int sqlite3_initialize(void); |
| 1656 | +SQLITE_API int sqlite3_shutdown(void); |
| 1657 | +SQLITE_API int sqlite3_os_init(void); |
| 1658 | +SQLITE_API int sqlite3_os_end(void); |
| 1657 | 1659 | |
| 1658 | 1660 | /* |
| 1659 | 1661 | ** CAPI3REF: Configuring The SQLite Library |
| 1660 | 1662 | ** |
| 1661 | 1663 | ** The sqlite3_config() interface is used to make global configuration |
| | @@ -1684,11 +1686,11 @@ |
| 1684 | 1686 | ** |
| 1685 | 1687 | ** ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK]. |
| 1686 | 1688 | ** ^If the option is unknown or SQLite is unable to set the option |
| 1687 | 1689 | ** then this routine returns a non-zero [error code]. |
| 1688 | 1690 | */ |
| 1689 | | -SQLITE_API int SQLITE_CDECL sqlite3_config(int, ...); |
| 1691 | +SQLITE_API int sqlite3_config(int, ...); |
| 1690 | 1692 | |
| 1691 | 1693 | /* |
| 1692 | 1694 | ** CAPI3REF: Configure database connections |
| 1693 | 1695 | ** METHOD: sqlite3 |
| 1694 | 1696 | ** |
| | @@ -1703,11 +1705,11 @@ |
| 1703 | 1705 | ** Subsequent arguments vary depending on the configuration verb. |
| 1704 | 1706 | ** |
| 1705 | 1707 | ** ^Calls to sqlite3_db_config() return SQLITE_OK if and only if |
| 1706 | 1708 | ** the call is considered successful. |
| 1707 | 1709 | */ |
| 1708 | | -SQLITE_API int SQLITE_CDECL sqlite3_db_config(sqlite3*, int op, ...); |
| 1710 | +SQLITE_API int sqlite3_db_config(sqlite3*, int op, ...); |
| 1709 | 1711 | |
| 1710 | 1712 | /* |
| 1711 | 1713 | ** CAPI3REF: Memory Allocation Routines |
| 1712 | 1714 | ** |
| 1713 | 1715 | ** An instance of this object defines the interface between SQLite |
| | @@ -2254,11 +2256,11 @@ |
| 2254 | 2256 | ** |
| 2255 | 2257 | ** ^The sqlite3_extended_result_codes() routine enables or disables the |
| 2256 | 2258 | ** [extended result codes] feature of SQLite. ^The extended result |
| 2257 | 2259 | ** codes are disabled by default for historical compatibility. |
| 2258 | 2260 | */ |
| 2259 | | -SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3*, int onoff); |
| 2261 | +SQLITE_API int sqlite3_extended_result_codes(sqlite3*, int onoff); |
| 2260 | 2262 | |
| 2261 | 2263 | /* |
| 2262 | 2264 | ** CAPI3REF: Last Insert Rowid |
| 2263 | 2265 | ** METHOD: sqlite3 |
| 2264 | 2266 | ** |
| | @@ -2306,11 +2308,11 @@ |
| 2306 | 2308 | ** function is running and thus changes the last insert [rowid], |
| 2307 | 2309 | ** then the value returned by [sqlite3_last_insert_rowid()] is |
| 2308 | 2310 | ** unpredictable and might not equal either the old or the new |
| 2309 | 2311 | ** last insert [rowid]. |
| 2310 | 2312 | */ |
| 2311 | | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3*); |
| 2313 | +SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*); |
| 2312 | 2314 | |
| 2313 | 2315 | /* |
| 2314 | 2316 | ** CAPI3REF: Count The Number Of Rows Modified |
| 2315 | 2317 | ** METHOD: sqlite3 |
| 2316 | 2318 | ** |
| | @@ -2359,11 +2361,11 @@ |
| 2359 | 2361 | ** |
| 2360 | 2362 | ** If a separate thread makes changes on the same database connection |
| 2361 | 2363 | ** while [sqlite3_changes()] is running then the value returned |
| 2362 | 2364 | ** is unpredictable and not meaningful. |
| 2363 | 2365 | */ |
| 2364 | | -SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3*); |
| 2366 | +SQLITE_API int sqlite3_changes(sqlite3*); |
| 2365 | 2367 | |
| 2366 | 2368 | /* |
| 2367 | 2369 | ** CAPI3REF: Total Number Of Rows Modified |
| 2368 | 2370 | ** METHOD: sqlite3 |
| 2369 | 2371 | ** |
| | @@ -2383,11 +2385,11 @@ |
| 2383 | 2385 | ** |
| 2384 | 2386 | ** If a separate thread makes changes on the same database connection |
| 2385 | 2387 | ** while [sqlite3_total_changes()] is running then the value |
| 2386 | 2388 | ** returned is unpredictable and not meaningful. |
| 2387 | 2389 | */ |
| 2388 | | -SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3*); |
| 2390 | +SQLITE_API int sqlite3_total_changes(sqlite3*); |
| 2389 | 2391 | |
| 2390 | 2392 | /* |
| 2391 | 2393 | ** CAPI3REF: Interrupt A Long-Running Query |
| 2392 | 2394 | ** METHOD: sqlite3 |
| 2393 | 2395 | ** |
| | @@ -2423,11 +2425,11 @@ |
| 2423 | 2425 | ** that are started after the sqlite3_interrupt() call returns. |
| 2424 | 2426 | ** |
| 2425 | 2427 | ** If the database connection closes while [sqlite3_interrupt()] |
| 2426 | 2428 | ** is running then bad things will likely happen. |
| 2427 | 2429 | */ |
| 2428 | | -SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3*); |
| 2430 | +SQLITE_API void sqlite3_interrupt(sqlite3*); |
| 2429 | 2431 | |
| 2430 | 2432 | /* |
| 2431 | 2433 | ** CAPI3REF: Determine If An SQL Statement Is Complete |
| 2432 | 2434 | ** |
| 2433 | 2435 | ** These routines are useful during command-line input to determine if the |
| | @@ -2458,12 +2460,12 @@ |
| 2458 | 2460 | ** UTF-8 string. |
| 2459 | 2461 | ** |
| 2460 | 2462 | ** The input to [sqlite3_complete16()] must be a zero-terminated |
| 2461 | 2463 | ** UTF-16 string in native byte order. |
| 2462 | 2464 | */ |
| 2463 | | -SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *sql); |
| 2464 | | -SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *sql); |
| 2465 | +SQLITE_API int sqlite3_complete(const char *sql); |
| 2466 | +SQLITE_API int sqlite3_complete16(const void *sql); |
| 2465 | 2467 | |
| 2466 | 2468 | /* |
| 2467 | 2469 | ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors |
| 2468 | 2470 | ** KEYWORDS: {busy-handler callback} {busy handler} |
| 2469 | 2471 | ** METHOD: sqlite3 |
| | @@ -2520,11 +2522,11 @@ |
| 2520 | 2522 | ** result in undefined behavior. |
| 2521 | 2523 | ** |
| 2522 | 2524 | ** A busy handler must not close the database connection |
| 2523 | 2525 | ** or [prepared statement] that invoked the busy handler. |
| 2524 | 2526 | */ |
| 2525 | | -SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3*,int(*)(void*,int),void*); |
| 2527 | +SQLITE_API int sqlite3_busy_handler(sqlite3*,int(*)(void*,int),void*); |
| 2526 | 2528 | |
| 2527 | 2529 | /* |
| 2528 | 2530 | ** CAPI3REF: Set A Busy Timeout |
| 2529 | 2531 | ** METHOD: sqlite3 |
| 2530 | 2532 | ** |
| | @@ -2543,11 +2545,11 @@ |
| 2543 | 2545 | ** was defined (using [sqlite3_busy_handler()]) prior to calling |
| 2544 | 2546 | ** this routine, that other busy handler is cleared.)^ |
| 2545 | 2547 | ** |
| 2546 | 2548 | ** See also: [PRAGMA busy_timeout] |
| 2547 | 2549 | */ |
| 2548 | | -SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3*, int ms); |
| 2550 | +SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms); |
| 2549 | 2551 | |
| 2550 | 2552 | /* |
| 2551 | 2553 | ** CAPI3REF: Convenience Routines For Running Queries |
| 2552 | 2554 | ** METHOD: sqlite3 |
| 2553 | 2555 | ** |
| | @@ -2618,19 +2620,19 @@ |
| 2618 | 2620 | ** interface defined here. As a consequence, errors that occur in the |
| 2619 | 2621 | ** wrapper layer outside of the internal [sqlite3_exec()] call are not |
| 2620 | 2622 | ** reflected in subsequent calls to [sqlite3_errcode()] or |
| 2621 | 2623 | ** [sqlite3_errmsg()]. |
| 2622 | 2624 | */ |
| 2623 | | -SQLITE_API int SQLITE_STDCALL sqlite3_get_table( |
| 2625 | +SQLITE_API int sqlite3_get_table( |
| 2624 | 2626 | sqlite3 *db, /* An open database */ |
| 2625 | 2627 | const char *zSql, /* SQL to be evaluated */ |
| 2626 | 2628 | char ***pazResult, /* Results of the query */ |
| 2627 | 2629 | int *pnRow, /* Number of result rows written here */ |
| 2628 | 2630 | int *pnColumn, /* Number of result columns written here */ |
| 2629 | 2631 | char **pzErrmsg /* Error msg written here */ |
| 2630 | 2632 | ); |
| 2631 | | -SQLITE_API void SQLITE_STDCALL sqlite3_free_table(char **result); |
| 2633 | +SQLITE_API void sqlite3_free_table(char **result); |
| 2632 | 2634 | |
| 2633 | 2635 | /* |
| 2634 | 2636 | ** CAPI3REF: Formatted String Printing Functions |
| 2635 | 2637 | ** |
| 2636 | 2638 | ** These routines are work-alikes of the "printf()" family of functions |
| | @@ -2732,14 +2734,14 @@ |
| 2732 | 2734 | ** |
| 2733 | 2735 | ** ^(The "%z" formatting option works like "%s" but with the |
| 2734 | 2736 | ** addition that after the string has been read and copied into |
| 2735 | 2737 | ** the result, [sqlite3_free()] is called on the input string.)^ |
| 2736 | 2738 | */ |
| 2737 | | -SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...); |
| 2738 | | -SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list); |
| 2739 | | -SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...); |
| 2740 | | -SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list); |
| 2739 | +SQLITE_API char *sqlite3_mprintf(const char*,...); |
| 2740 | +SQLITE_API char *sqlite3_vmprintf(const char*, va_list); |
| 2741 | +SQLITE_API char *sqlite3_snprintf(int,char*,const char*, ...); |
| 2742 | +SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list); |
| 2741 | 2743 | |
| 2742 | 2744 | /* |
| 2743 | 2745 | ** CAPI3REF: Memory Allocation Subsystem |
| 2744 | 2746 | ** |
| 2745 | 2747 | ** The SQLite core uses these three routines for all of its own |
| | @@ -2825,16 +2827,16 @@ |
| 2825 | 2827 | ** |
| 2826 | 2828 | ** The application must not read or write any part of |
| 2827 | 2829 | ** a block of memory after it has been released using |
| 2828 | 2830 | ** [sqlite3_free()] or [sqlite3_realloc()]. |
| 2829 | 2831 | */ |
| 2830 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int); |
| 2831 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64); |
| 2832 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void*, int); |
| 2833 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void*, sqlite3_uint64); |
| 2834 | | -SQLITE_API void SQLITE_STDCALL sqlite3_free(void*); |
| 2835 | | -SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void*); |
| 2832 | +SQLITE_API void *sqlite3_malloc(int); |
| 2833 | +SQLITE_API void *sqlite3_malloc64(sqlite3_uint64); |
| 2834 | +SQLITE_API void *sqlite3_realloc(void*, int); |
| 2835 | +SQLITE_API void *sqlite3_realloc64(void*, sqlite3_uint64); |
| 2836 | +SQLITE_API void sqlite3_free(void*); |
| 2837 | +SQLITE_API sqlite3_uint64 sqlite3_msize(void*); |
| 2836 | 2838 | |
| 2837 | 2839 | /* |
| 2838 | 2840 | ** CAPI3REF: Memory Allocator Statistics |
| 2839 | 2841 | ** |
| 2840 | 2842 | ** SQLite provides these two interfaces for reporting on the status |
| | @@ -2855,12 +2857,12 @@ |
| 2855 | 2857 | ** [sqlite3_memory_used()] if and only if the parameter to |
| 2856 | 2858 | ** [sqlite3_memory_highwater()] is true. ^The value returned |
| 2857 | 2859 | ** by [sqlite3_memory_highwater(1)] is the high-water mark |
| 2858 | 2860 | ** prior to the reset. |
| 2859 | 2861 | */ |
| 2860 | | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void); |
| 2861 | | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag); |
| 2862 | +SQLITE_API sqlite3_int64 sqlite3_memory_used(void); |
| 2863 | +SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag); |
| 2862 | 2864 | |
| 2863 | 2865 | /* |
| 2864 | 2866 | ** CAPI3REF: Pseudo-Random Number Generator |
| 2865 | 2867 | ** |
| 2866 | 2868 | ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to |
| | @@ -2879,11 +2881,11 @@ |
| 2879 | 2881 | ** ^If the previous call to this routine had an N of 1 or more and a |
| 2880 | 2882 | ** non-NULL P then the pseudo-randomness is generated |
| 2881 | 2883 | ** internally and without recourse to the [sqlite3_vfs] xRandomness |
| 2882 | 2884 | ** method. |
| 2883 | 2885 | */ |
| 2884 | | -SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *P); |
| 2886 | +SQLITE_API void sqlite3_randomness(int N, void *P); |
| 2885 | 2887 | |
| 2886 | 2888 | /* |
| 2887 | 2889 | ** CAPI3REF: Compile-Time Authorization Callbacks |
| 2888 | 2890 | ** METHOD: sqlite3 |
| 2889 | 2891 | ** |
| | @@ -2962,11 +2964,11 @@ |
| 2962 | 2964 | ** [sqlite3_prepare()] or its variants. Authorization is not |
| 2963 | 2965 | ** performed during statement evaluation in [sqlite3_step()], unless |
| 2964 | 2966 | ** as stated in the previous paragraph, sqlite3_step() invokes |
| 2965 | 2967 | ** sqlite3_prepare_v2() to reprepare a statement after a schema change. |
| 2966 | 2968 | */ |
| 2967 | | -SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer( |
| 2969 | +SQLITE_API int sqlite3_set_authorizer( |
| 2968 | 2970 | sqlite3*, |
| 2969 | 2971 | int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), |
| 2970 | 2972 | void *pUserData |
| 2971 | 2973 | ); |
| 2972 | 2974 | |
| | @@ -3070,13 +3072,13 @@ |
| 3070 | 3072 | ** digits in the time are meaningless. Future versions of SQLite |
| 3071 | 3073 | ** might provide greater resolution on the profiler callback. The |
| 3072 | 3074 | ** sqlite3_profile() function is considered experimental and is |
| 3073 | 3075 | ** subject to change in future versions of SQLite. |
| 3074 | 3076 | */ |
| 3075 | | -SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_trace(sqlite3*, |
| 3077 | +SQLITE_API SQLITE_DEPRECATED void *sqlite3_trace(sqlite3*, |
| 3076 | 3078 | void(*xTrace)(void*,const char*), void*); |
| 3077 | | -SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_profile(sqlite3*, |
| 3079 | +SQLITE_API SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*, |
| 3078 | 3080 | void(*xProfile)(void*,const char*,sqlite3_uint64), void*); |
| 3079 | 3081 | |
| 3080 | 3082 | /* |
| 3081 | 3083 | ** CAPI3REF: SQL Trace Event Codes |
| 3082 | 3084 | ** KEYWORDS: SQLITE_TRACE |
| | @@ -3161,11 +3163,11 @@ |
| 3161 | 3163 | ** |
| 3162 | 3164 | ** The sqlite3_trace_v2() interface is intended to replace the legacy |
| 3163 | 3165 | ** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which |
| 3164 | 3166 | ** are deprecated. |
| 3165 | 3167 | */ |
| 3166 | | -SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2( |
| 3168 | +SQLITE_API int sqlite3_trace_v2( |
| 3167 | 3169 | sqlite3*, |
| 3168 | 3170 | unsigned uMask, |
| 3169 | 3171 | int(*xCallback)(unsigned,void*,void*,void*), |
| 3170 | 3172 | void *pCtx |
| 3171 | 3173 | ); |
| | @@ -3200,11 +3202,11 @@ |
| 3200 | 3202 | ** the database connection that invoked the progress handler. |
| 3201 | 3203 | ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their |
| 3202 | 3204 | ** database connections for the meaning of "modify" in this paragraph. |
| 3203 | 3205 | ** |
| 3204 | 3206 | */ |
| 3205 | | -SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); |
| 3207 | +SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); |
| 3206 | 3208 | |
| 3207 | 3209 | /* |
| 3208 | 3210 | ** CAPI3REF: Opening A New Database Connection |
| 3209 | 3211 | ** CONSTRUCTOR: sqlite3 |
| 3210 | 3212 | ** |
| | @@ -3429,19 +3431,19 @@ |
| 3429 | 3431 | ** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various |
| 3430 | 3432 | ** features that require the use of temporary files may fail. |
| 3431 | 3433 | ** |
| 3432 | 3434 | ** See also: [sqlite3_temp_directory] |
| 3433 | 3435 | */ |
| 3434 | | -SQLITE_API int SQLITE_STDCALL sqlite3_open( |
| 3436 | +SQLITE_API int sqlite3_open( |
| 3435 | 3437 | const char *filename, /* Database filename (UTF-8) */ |
| 3436 | 3438 | sqlite3 **ppDb /* OUT: SQLite db handle */ |
| 3437 | 3439 | ); |
| 3438 | | -SQLITE_API int SQLITE_STDCALL sqlite3_open16( |
| 3440 | +SQLITE_API int sqlite3_open16( |
| 3439 | 3441 | const void *filename, /* Database filename (UTF-16) */ |
| 3440 | 3442 | sqlite3 **ppDb /* OUT: SQLite db handle */ |
| 3441 | 3443 | ); |
| 3442 | | -SQLITE_API int SQLITE_STDCALL sqlite3_open_v2( |
| 3444 | +SQLITE_API int sqlite3_open_v2( |
| 3443 | 3445 | const char *filename, /* Database filename (UTF-8) */ |
| 3444 | 3446 | sqlite3 **ppDb, /* OUT: SQLite db handle */ |
| 3445 | 3447 | int flags, /* Flags */ |
| 3446 | 3448 | const char *zVfs /* Name of VFS module to use */ |
| 3447 | 3449 | ); |
| | @@ -3483,13 +3485,13 @@ |
| 3483 | 3485 | ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and |
| 3484 | 3486 | ** is not a database file pathname pointer that SQLite passed into the xOpen |
| 3485 | 3487 | ** VFS method, then the behavior of this routine is undefined and probably |
| 3486 | 3488 | ** undesirable. |
| 3487 | 3489 | */ |
| 3488 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam); |
| 3489 | | -SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault); |
| 3490 | | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64); |
| 3490 | +SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam); |
| 3491 | +SQLITE_API int sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault); |
| 3492 | +SQLITE_API sqlite3_int64 sqlite3_uri_int64(const char*, const char*, sqlite3_int64); |
| 3491 | 3493 | |
| 3492 | 3494 | |
| 3493 | 3495 | /* |
| 3494 | 3496 | ** CAPI3REF: Error Codes And Messages |
| 3495 | 3497 | ** METHOD: sqlite3 |
| | @@ -3529,15 +3531,15 @@ |
| 3529 | 3531 | ** |
| 3530 | 3532 | ** If an interface fails with SQLITE_MISUSE, that means the interface |
| 3531 | 3533 | ** was invoked incorrectly by the application. In that case, the |
| 3532 | 3534 | ** error code and message may or may not be set. |
| 3533 | 3535 | */ |
| 3534 | | -SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db); |
| 3535 | | -SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db); |
| 3536 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*); |
| 3537 | | -SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*); |
| 3538 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int); |
| 3536 | +SQLITE_API int sqlite3_errcode(sqlite3 *db); |
| 3537 | +SQLITE_API int sqlite3_extended_errcode(sqlite3 *db); |
| 3538 | +SQLITE_API const char *sqlite3_errmsg(sqlite3*); |
| 3539 | +SQLITE_API const void *sqlite3_errmsg16(sqlite3*); |
| 3540 | +SQLITE_API const char *sqlite3_errstr(int); |
| 3539 | 3541 | |
| 3540 | 3542 | /* |
| 3541 | 3543 | ** CAPI3REF: Prepared Statement Object |
| 3542 | 3544 | ** KEYWORDS: {prepared statement} {prepared statements} |
| 3543 | 3545 | ** |
| | @@ -3601,11 +3603,11 @@ |
| 3601 | 3603 | ** created by an untrusted script can be contained using the |
| 3602 | 3604 | ** [max_page_count] [PRAGMA]. |
| 3603 | 3605 | ** |
| 3604 | 3606 | ** New run-time limit categories may be added in future releases. |
| 3605 | 3607 | */ |
| 3606 | | -SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3*, int id, int newVal); |
| 3608 | +SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal); |
| 3607 | 3609 | |
| 3608 | 3610 | /* |
| 3609 | 3611 | ** CAPI3REF: Run-Time Limit Categories |
| 3610 | 3612 | ** KEYWORDS: {limit category} {*limit categories} |
| 3611 | 3613 | ** |
| | @@ -3753,32 +3755,32 @@ |
| 3753 | 3755 | ** or [GLOB] operator or if the parameter is compared to an indexed column |
| 3754 | 3756 | ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled. |
| 3755 | 3757 | ** </li> |
| 3756 | 3758 | ** </ol> |
| 3757 | 3759 | */ |
| 3758 | | -SQLITE_API int SQLITE_STDCALL sqlite3_prepare( |
| 3760 | +SQLITE_API int sqlite3_prepare( |
| 3759 | 3761 | sqlite3 *db, /* Database handle */ |
| 3760 | 3762 | const char *zSql, /* SQL statement, UTF-8 encoded */ |
| 3761 | 3763 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3762 | 3764 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3763 | 3765 | const char **pzTail /* OUT: Pointer to unused portion of zSql */ |
| 3764 | 3766 | ); |
| 3765 | | -SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2( |
| 3767 | +SQLITE_API int sqlite3_prepare_v2( |
| 3766 | 3768 | sqlite3 *db, /* Database handle */ |
| 3767 | 3769 | const char *zSql, /* SQL statement, UTF-8 encoded */ |
| 3768 | 3770 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3769 | 3771 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3770 | 3772 | const char **pzTail /* OUT: Pointer to unused portion of zSql */ |
| 3771 | 3773 | ); |
| 3772 | | -SQLITE_API int SQLITE_STDCALL sqlite3_prepare16( |
| 3774 | +SQLITE_API int sqlite3_prepare16( |
| 3773 | 3775 | sqlite3 *db, /* Database handle */ |
| 3774 | 3776 | const void *zSql, /* SQL statement, UTF-16 encoded */ |
| 3775 | 3777 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3776 | 3778 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3777 | 3779 | const void **pzTail /* OUT: Pointer to unused portion of zSql */ |
| 3778 | 3780 | ); |
| 3779 | | -SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2( |
| 3781 | +SQLITE_API int sqlite3_prepare16_v2( |
| 3780 | 3782 | sqlite3 *db, /* Database handle */ |
| 3781 | 3783 | const void *zSql, /* SQL statement, UTF-16 encoded */ |
| 3782 | 3784 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3783 | 3785 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3784 | 3786 | const void **pzTail /* OUT: Pointer to unused portion of zSql */ |
| | @@ -3813,12 +3815,12 @@ |
| 3813 | 3815 | ** automatically freed when the prepared statement is finalized. |
| 3814 | 3816 | ** ^The string returned by sqlite3_expanded_sql(P), on the other hand, |
| 3815 | 3817 | ** is obtained from [sqlite3_malloc()] and must be free by the application |
| 3816 | 3818 | ** by passing it to [sqlite3_free()]. |
| 3817 | 3819 | */ |
| 3818 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt); |
| 3819 | | -SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt); |
| 3820 | +SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt); |
| 3821 | +SQLITE_API char *sqlite3_expanded_sql(sqlite3_stmt *pStmt); |
| 3820 | 3822 | |
| 3821 | 3823 | /* |
| 3822 | 3824 | ** CAPI3REF: Determine If An SQL Statement Writes The Database |
| 3823 | 3825 | ** METHOD: sqlite3_stmt |
| 3824 | 3826 | ** |
| | @@ -3846,11 +3848,11 @@ |
| 3846 | 3848 | ** database. ^The [ATTACH] and [DETACH] statements also cause |
| 3847 | 3849 | ** sqlite3_stmt_readonly() to return true since, while those statements |
| 3848 | 3850 | ** change the configuration of a database connection, they do not make |
| 3849 | 3851 | ** changes to the content of the database files on disk. |
| 3850 | 3852 | */ |
| 3851 | | -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt); |
| 3853 | +SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt); |
| 3852 | 3854 | |
| 3853 | 3855 | /* |
| 3854 | 3856 | ** CAPI3REF: Determine If A Prepared Statement Has Been Reset |
| 3855 | 3857 | ** METHOD: sqlite3_stmt |
| 3856 | 3858 | ** |
| | @@ -3867,11 +3869,11 @@ |
| 3867 | 3869 | ** to locate all prepared statements associated with a database |
| 3868 | 3870 | ** connection that are in need of being reset. This can be used, |
| 3869 | 3871 | ** for example, in diagnostic routines to search for prepared |
| 3870 | 3872 | ** statements that are holding a transaction open. |
| 3871 | 3873 | */ |
| 3872 | | -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt*); |
| 3874 | +SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt*); |
| 3873 | 3875 | |
| 3874 | 3876 | /* |
| 3875 | 3877 | ** CAPI3REF: Dynamically Typed Value Object |
| 3876 | 3878 | ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value} |
| 3877 | 3879 | ** |
| | @@ -4031,24 +4033,24 @@ |
| 4031 | 4033 | ** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails. |
| 4032 | 4034 | ** |
| 4033 | 4035 | ** See also: [sqlite3_bind_parameter_count()], |
| 4034 | 4036 | ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()]. |
| 4035 | 4037 | */ |
| 4036 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*)); |
| 4037 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64, |
| 4038 | +SQLITE_API int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*)); |
| 4039 | +SQLITE_API int sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64, |
| 4038 | 4040 | void(*)(void*)); |
| 4039 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt*, int, double); |
| 4040 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt*, int, int); |
| 4041 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64); |
| 4042 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int); |
| 4043 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*)); |
| 4044 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*)); |
| 4045 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64, |
| 4041 | +SQLITE_API int sqlite3_bind_double(sqlite3_stmt*, int, double); |
| 4042 | +SQLITE_API int sqlite3_bind_int(sqlite3_stmt*, int, int); |
| 4043 | +SQLITE_API int sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64); |
| 4044 | +SQLITE_API int sqlite3_bind_null(sqlite3_stmt*, int); |
| 4045 | +SQLITE_API int sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*)); |
| 4046 | +SQLITE_API int sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*)); |
| 4047 | +SQLITE_API int sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64, |
| 4046 | 4048 | void(*)(void*), unsigned char encoding); |
| 4047 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); |
| 4048 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n); |
| 4049 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64); |
| 4049 | +SQLITE_API int sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); |
| 4050 | +SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n); |
| 4051 | +SQLITE_API int sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64); |
| 4050 | 4052 | |
| 4051 | 4053 | /* |
| 4052 | 4054 | ** CAPI3REF: Number Of SQL Parameters |
| 4053 | 4055 | ** METHOD: sqlite3_stmt |
| 4054 | 4056 | ** |
| | @@ -4065,11 +4067,11 @@ |
| 4065 | 4067 | ** |
| 4066 | 4068 | ** See also: [sqlite3_bind_blob|sqlite3_bind()], |
| 4067 | 4069 | ** [sqlite3_bind_parameter_name()], and |
| 4068 | 4070 | ** [sqlite3_bind_parameter_index()]. |
| 4069 | 4071 | */ |
| 4070 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt*); |
| 4072 | +SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt*); |
| 4071 | 4073 | |
| 4072 | 4074 | /* |
| 4073 | 4075 | ** CAPI3REF: Name Of A Host Parameter |
| 4074 | 4076 | ** METHOD: sqlite3_stmt |
| 4075 | 4077 | ** |
| | @@ -4093,11 +4095,11 @@ |
| 4093 | 4095 | ** |
| 4094 | 4096 | ** See also: [sqlite3_bind_blob|sqlite3_bind()], |
| 4095 | 4097 | ** [sqlite3_bind_parameter_count()], and |
| 4096 | 4098 | ** [sqlite3_bind_parameter_index()]. |
| 4097 | 4099 | */ |
| 4098 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt*, int); |
| 4100 | +SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt*, int); |
| 4099 | 4101 | |
| 4100 | 4102 | /* |
| 4101 | 4103 | ** CAPI3REF: Index Of A Parameter With A Given Name |
| 4102 | 4104 | ** METHOD: sqlite3_stmt |
| 4103 | 4105 | ** |
| | @@ -4110,21 +4112,21 @@ |
| 4110 | 4112 | ** |
| 4111 | 4113 | ** See also: [sqlite3_bind_blob|sqlite3_bind()], |
| 4112 | 4114 | ** [sqlite3_bind_parameter_count()], and |
| 4113 | 4115 | ** [sqlite3_bind_parameter_name()]. |
| 4114 | 4116 | */ |
| 4115 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName); |
| 4117 | +SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName); |
| 4116 | 4118 | |
| 4117 | 4119 | /* |
| 4118 | 4120 | ** CAPI3REF: Reset All Bindings On A Prepared Statement |
| 4119 | 4121 | ** METHOD: sqlite3_stmt |
| 4120 | 4122 | ** |
| 4121 | 4123 | ** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset |
| 4122 | 4124 | ** the [sqlite3_bind_blob | bindings] on a [prepared statement]. |
| 4123 | 4125 | ** ^Use this routine to reset all host parameters to NULL. |
| 4124 | 4126 | */ |
| 4125 | | -SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt*); |
| 4127 | +SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt*); |
| 4126 | 4128 | |
| 4127 | 4129 | /* |
| 4128 | 4130 | ** CAPI3REF: Number Of Columns In A Result Set |
| 4129 | 4131 | ** METHOD: sqlite3_stmt |
| 4130 | 4132 | ** |
| | @@ -4132,11 +4134,11 @@ |
| 4132 | 4134 | ** [prepared statement]. ^This routine returns 0 if pStmt is an SQL |
| 4133 | 4135 | ** statement that does not return data (for example an [UPDATE]). |
| 4134 | 4136 | ** |
| 4135 | 4137 | ** See also: [sqlite3_data_count()] |
| 4136 | 4138 | */ |
| 4137 | | -SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt); |
| 4139 | +SQLITE_API int sqlite3_column_count(sqlite3_stmt *pStmt); |
| 4138 | 4140 | |
| 4139 | 4141 | /* |
| 4140 | 4142 | ** CAPI3REF: Column Names In A Result Set |
| 4141 | 4143 | ** METHOD: sqlite3_stmt |
| 4142 | 4144 | ** |
| | @@ -4161,12 +4163,12 @@ |
| 4161 | 4163 | ** ^The name of a result column is the value of the "AS" clause for |
| 4162 | 4164 | ** that column, if there is an AS clause. If there is no AS clause |
| 4163 | 4165 | ** then the name of the column is unspecified and may change from |
| 4164 | 4166 | ** one release of SQLite to the next. |
| 4165 | 4167 | */ |
| 4166 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt*, int N); |
| 4167 | | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt*, int N); |
| 4168 | +SQLITE_API const char *sqlite3_column_name(sqlite3_stmt*, int N); |
| 4169 | +SQLITE_API const void *sqlite3_column_name16(sqlite3_stmt*, int N); |
| 4168 | 4170 | |
| 4169 | 4171 | /* |
| 4170 | 4172 | ** CAPI3REF: Source Of Data In A Query Result |
| 4171 | 4173 | ** METHOD: sqlite3_stmt |
| 4172 | 4174 | ** |
| | @@ -4210,16 +4212,16 @@ |
| 4210 | 4212 | ** If two or more threads call one or more |
| 4211 | 4213 | ** [sqlite3_column_database_name | column metadata interfaces] |
| 4212 | 4214 | ** for the same [prepared statement] and result column |
| 4213 | 4215 | ** at the same time then the results are undefined. |
| 4214 | 4216 | */ |
| 4215 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int); |
| 4216 | | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int); |
| 4217 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int); |
| 4218 | | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int); |
| 4219 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int); |
| 4220 | | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int); |
| 4217 | +SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt*,int); |
| 4218 | +SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt*,int); |
| 4219 | +SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt*,int); |
| 4220 | +SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt*,int); |
| 4221 | +SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt*,int); |
| 4222 | +SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt*,int); |
| 4221 | 4223 | |
| 4222 | 4224 | /* |
| 4223 | 4225 | ** CAPI3REF: Declared Datatype Of A Query Result |
| 4224 | 4226 | ** METHOD: sqlite3_stmt |
| 4225 | 4227 | ** |
| | @@ -4247,12 +4249,12 @@ |
| 4247 | 4249 | ** data stored in that column is of the declared type. SQLite is |
| 4248 | 4250 | ** strongly typed, but the typing is dynamic not static. ^Type |
| 4249 | 4251 | ** is associated with individual values, not with the containers |
| 4250 | 4252 | ** used to hold those values. |
| 4251 | 4253 | */ |
| 4252 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt*,int); |
| 4253 | | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt*,int); |
| 4254 | +SQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt*,int); |
| 4255 | +SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int); |
| 4254 | 4256 | |
| 4255 | 4257 | /* |
| 4256 | 4258 | ** CAPI3REF: Evaluate An SQL Statement |
| 4257 | 4259 | ** METHOD: sqlite3_stmt |
| 4258 | 4260 | ** |
| | @@ -4309,11 +4311,12 @@ |
| 4309 | 4311 | ** For all versions of SQLite up to and including 3.6.23.1, a call to |
| 4310 | 4312 | ** [sqlite3_reset()] was required after sqlite3_step() returned anything |
| 4311 | 4313 | ** other than [SQLITE_ROW] before any subsequent invocation of |
| 4312 | 4314 | ** sqlite3_step(). Failure to reset the prepared statement using |
| 4313 | 4315 | ** [sqlite3_reset()] would result in an [SQLITE_MISUSE] return from |
| 4314 | | -** sqlite3_step(). But after version 3.6.23.1, sqlite3_step() began |
| 4316 | +** sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1], |
| 4317 | +** sqlite3_step() began |
| 4315 | 4318 | ** calling [sqlite3_reset()] automatically in this circumstance rather |
| 4316 | 4319 | ** than returning [SQLITE_MISUSE]. This is not considered a compatibility |
| 4317 | 4320 | ** break because any application that ever receives an SQLITE_MISUSE error |
| 4318 | 4321 | ** is broken by definition. The [SQLITE_OMIT_AUTORESET] compile-time option |
| 4319 | 4322 | ** can be used to restore the legacy behavior. |
| | @@ -4328,11 +4331,11 @@ |
| 4328 | 4331 | ** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead |
| 4329 | 4332 | ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces, |
| 4330 | 4333 | ** then the more specific [error codes] are returned directly |
| 4331 | 4334 | ** by sqlite3_step(). The use of the "v2" interface is recommended. |
| 4332 | 4335 | */ |
| 4333 | | -SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt*); |
| 4336 | +SQLITE_API int sqlite3_step(sqlite3_stmt*); |
| 4334 | 4337 | |
| 4335 | 4338 | /* |
| 4336 | 4339 | ** CAPI3REF: Number of columns in a result set |
| 4337 | 4340 | ** METHOD: sqlite3_stmt |
| 4338 | 4341 | ** |
| | @@ -4349,11 +4352,11 @@ |
| 4349 | 4352 | ** where it always returns zero since each step of that multi-step |
| 4350 | 4353 | ** pragma returns 0 columns of data. |
| 4351 | 4354 | ** |
| 4352 | 4355 | ** See also: [sqlite3_column_count()] |
| 4353 | 4356 | */ |
| 4354 | | -SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt); |
| 4357 | +SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt); |
| 4355 | 4358 | |
| 4356 | 4359 | /* |
| 4357 | 4360 | ** CAPI3REF: Fundamental Datatypes |
| 4358 | 4361 | ** KEYWORDS: SQLITE_TEXT |
| 4359 | 4362 | ** |
| | @@ -4539,20 +4542,20 @@ |
| 4539 | 4542 | ** of these routines, a default value is returned. The default value |
| 4540 | 4543 | ** is either the integer 0, the floating point number 0.0, or a NULL |
| 4541 | 4544 | ** pointer. Subsequent calls to [sqlite3_errcode()] will return |
| 4542 | 4545 | ** [SQLITE_NOMEM].)^ |
| 4543 | 4546 | */ |
| 4544 | | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt*, int iCol); |
| 4545 | | -SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt*, int iCol); |
| 4546 | | -SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol); |
| 4547 | | -SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt*, int iCol); |
| 4548 | | -SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt*, int iCol); |
| 4549 | | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt*, int iCol); |
| 4550 | | -SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt*, int iCol); |
| 4551 | | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt*, int iCol); |
| 4552 | | -SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt*, int iCol); |
| 4553 | | -SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt*, int iCol); |
| 4547 | +SQLITE_API const void *sqlite3_column_blob(sqlite3_stmt*, int iCol); |
| 4548 | +SQLITE_API int sqlite3_column_bytes(sqlite3_stmt*, int iCol); |
| 4549 | +SQLITE_API int sqlite3_column_bytes16(sqlite3_stmt*, int iCol); |
| 4550 | +SQLITE_API double sqlite3_column_double(sqlite3_stmt*, int iCol); |
| 4551 | +SQLITE_API int sqlite3_column_int(sqlite3_stmt*, int iCol); |
| 4552 | +SQLITE_API sqlite3_int64 sqlite3_column_int64(sqlite3_stmt*, int iCol); |
| 4553 | +SQLITE_API const unsigned char *sqlite3_column_text(sqlite3_stmt*, int iCol); |
| 4554 | +SQLITE_API const void *sqlite3_column_text16(sqlite3_stmt*, int iCol); |
| 4555 | +SQLITE_API int sqlite3_column_type(sqlite3_stmt*, int iCol); |
| 4556 | +SQLITE_API sqlite3_value *sqlite3_column_value(sqlite3_stmt*, int iCol); |
| 4554 | 4557 | |
| 4555 | 4558 | /* |
| 4556 | 4559 | ** CAPI3REF: Destroy A Prepared Statement Object |
| 4557 | 4560 | ** DESTRUCTOR: sqlite3_stmt |
| 4558 | 4561 | ** |
| | @@ -4576,11 +4579,11 @@ |
| 4576 | 4579 | ** resource leaks. It is a grievous error for the application to try to use |
| 4577 | 4580 | ** a prepared statement after it has been finalized. Any use of a prepared |
| 4578 | 4581 | ** statement after it has been finalized can result in undefined and |
| 4579 | 4582 | ** undesirable behavior such as segfaults and heap corruption. |
| 4580 | 4583 | */ |
| 4581 | | -SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt); |
| 4584 | +SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt); |
| 4582 | 4585 | |
| 4583 | 4586 | /* |
| 4584 | 4587 | ** CAPI3REF: Reset A Prepared Statement Object |
| 4585 | 4588 | ** METHOD: sqlite3_stmt |
| 4586 | 4589 | ** |
| | @@ -4603,11 +4606,11 @@ |
| 4603 | 4606 | ** [sqlite3_reset(S)] returns an appropriate [error code]. |
| 4604 | 4607 | ** |
| 4605 | 4608 | ** ^The [sqlite3_reset(S)] interface does not change the values |
| 4606 | 4609 | ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S. |
| 4607 | 4610 | */ |
| 4608 | | -SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt); |
| 4611 | +SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt); |
| 4609 | 4612 | |
| 4610 | 4613 | /* |
| 4611 | 4614 | ** CAPI3REF: Create Or Redefine SQL Functions |
| 4612 | 4615 | ** KEYWORDS: {function creation routines} |
| 4613 | 4616 | ** KEYWORDS: {application-defined SQL function} |
| | @@ -4703,31 +4706,31 @@ |
| 4703 | 4706 | ** ^An application-defined function is permitted to call other |
| 4704 | 4707 | ** SQLite interfaces. However, such calls must not |
| 4705 | 4708 | ** close the database connection nor finalize or reset the prepared |
| 4706 | 4709 | ** statement in which the function is running. |
| 4707 | 4710 | */ |
| 4708 | | -SQLITE_API int SQLITE_STDCALL sqlite3_create_function( |
| 4711 | +SQLITE_API int sqlite3_create_function( |
| 4709 | 4712 | sqlite3 *db, |
| 4710 | 4713 | const char *zFunctionName, |
| 4711 | 4714 | int nArg, |
| 4712 | 4715 | int eTextRep, |
| 4713 | 4716 | void *pApp, |
| 4714 | 4717 | void (*xFunc)(sqlite3_context*,int,sqlite3_value**), |
| 4715 | 4718 | void (*xStep)(sqlite3_context*,int,sqlite3_value**), |
| 4716 | 4719 | void (*xFinal)(sqlite3_context*) |
| 4717 | 4720 | ); |
| 4718 | | -SQLITE_API int SQLITE_STDCALL sqlite3_create_function16( |
| 4721 | +SQLITE_API int sqlite3_create_function16( |
| 4719 | 4722 | sqlite3 *db, |
| 4720 | 4723 | const void *zFunctionName, |
| 4721 | 4724 | int nArg, |
| 4722 | 4725 | int eTextRep, |
| 4723 | 4726 | void *pApp, |
| 4724 | 4727 | void (*xFunc)(sqlite3_context*,int,sqlite3_value**), |
| 4725 | 4728 | void (*xStep)(sqlite3_context*,int,sqlite3_value**), |
| 4726 | 4729 | void (*xFinal)(sqlite3_context*) |
| 4727 | 4730 | ); |
| 4728 | | -SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2( |
| 4731 | +SQLITE_API int sqlite3_create_function_v2( |
| 4729 | 4732 | sqlite3 *db, |
| 4730 | 4733 | const char *zFunctionName, |
| 4731 | 4734 | int nArg, |
| 4732 | 4735 | int eTextRep, |
| 4733 | 4736 | void *pApp, |
| | @@ -4769,16 +4772,16 @@ |
| 4769 | 4772 | ** to be supported. However, new applications should avoid |
| 4770 | 4773 | ** the use of these functions. To encourage programmers to avoid |
| 4771 | 4774 | ** these functions, we will not explain what they do. |
| 4772 | 4775 | */ |
| 4773 | 4776 | #ifndef SQLITE_OMIT_DEPRECATED |
| 4774 | | -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context*); |
| 4775 | | -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt*); |
| 4776 | | -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*); |
| 4777 | | -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_global_recover(void); |
| 4778 | | -SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_thread_cleanup(void); |
| 4779 | | -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int), |
| 4777 | +SQLITE_API SQLITE_DEPRECATED int sqlite3_aggregate_count(sqlite3_context*); |
| 4778 | +SQLITE_API SQLITE_DEPRECATED int sqlite3_expired(sqlite3_stmt*); |
| 4779 | +SQLITE_API SQLITE_DEPRECATED int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*); |
| 4780 | +SQLITE_API SQLITE_DEPRECATED int sqlite3_global_recover(void); |
| 4781 | +SQLITE_API SQLITE_DEPRECATED void sqlite3_thread_cleanup(void); |
| 4782 | +SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int), |
| 4780 | 4783 | void*,sqlite3_int64); |
| 4781 | 4784 | #endif |
| 4782 | 4785 | |
| 4783 | 4786 | /* |
| 4784 | 4787 | ** CAPI3REF: Obtaining SQL Values |
| | @@ -4824,22 +4827,22 @@ |
| 4824 | 4827 | ** or [sqlite3_value_text16()]. |
| 4825 | 4828 | ** |
| 4826 | 4829 | ** These routines must be called from the same thread as |
| 4827 | 4830 | ** the SQL function that supplied the [sqlite3_value*] parameters. |
| 4828 | 4831 | */ |
| 4829 | | -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value*); |
| 4830 | | -SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value*); |
| 4831 | | -SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value*); |
| 4832 | | -SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value*); |
| 4833 | | -SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value*); |
| 4834 | | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value*); |
| 4835 | | -SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value*); |
| 4836 | | -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value*); |
| 4837 | | -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value*); |
| 4838 | | -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*); |
| 4839 | | -SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*); |
| 4840 | | -SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*); |
| 4832 | +SQLITE_API const void *sqlite3_value_blob(sqlite3_value*); |
| 4833 | +SQLITE_API int sqlite3_value_bytes(sqlite3_value*); |
| 4834 | +SQLITE_API int sqlite3_value_bytes16(sqlite3_value*); |
| 4835 | +SQLITE_API double sqlite3_value_double(sqlite3_value*); |
| 4836 | +SQLITE_API int sqlite3_value_int(sqlite3_value*); |
| 4837 | +SQLITE_API sqlite3_int64 sqlite3_value_int64(sqlite3_value*); |
| 4838 | +SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value*); |
| 4839 | +SQLITE_API const void *sqlite3_value_text16(sqlite3_value*); |
| 4840 | +SQLITE_API const void *sqlite3_value_text16le(sqlite3_value*); |
| 4841 | +SQLITE_API const void *sqlite3_value_text16be(sqlite3_value*); |
| 4842 | +SQLITE_API int sqlite3_value_type(sqlite3_value*); |
| 4843 | +SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*); |
| 4841 | 4844 | |
| 4842 | 4845 | /* |
| 4843 | 4846 | ** CAPI3REF: Finding The Subtype Of SQL Values |
| 4844 | 4847 | ** METHOD: sqlite3_value |
| 4845 | 4848 | ** |
| | @@ -4851,11 +4854,11 @@ |
| 4851 | 4854 | ** |
| 4852 | 4855 | ** SQLite makes no use of subtype itself. It merely passes the subtype |
| 4853 | 4856 | ** from the result of one [application-defined SQL function] into the |
| 4854 | 4857 | ** input of another. |
| 4855 | 4858 | */ |
| 4856 | | -SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value*); |
| 4859 | +SQLITE_API unsigned int sqlite3_value_subtype(sqlite3_value*); |
| 4857 | 4860 | |
| 4858 | 4861 | /* |
| 4859 | 4862 | ** CAPI3REF: Copy And Free SQL Values |
| 4860 | 4863 | ** METHOD: sqlite3_value |
| 4861 | 4864 | ** |
| | @@ -4867,12 +4870,12 @@ |
| 4867 | 4870 | ** |
| 4868 | 4871 | ** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object |
| 4869 | 4872 | ** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer |
| 4870 | 4873 | ** then sqlite3_value_free(V) is a harmless no-op. |
| 4871 | 4874 | */ |
| 4872 | | -SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value*); |
| 4873 | | -SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value*); |
| 4875 | +SQLITE_API sqlite3_value *sqlite3_value_dup(const sqlite3_value*); |
| 4876 | +SQLITE_API void sqlite3_value_free(sqlite3_value*); |
| 4874 | 4877 | |
| 4875 | 4878 | /* |
| 4876 | 4879 | ** CAPI3REF: Obtain Aggregate Function Context |
| 4877 | 4880 | ** METHOD: sqlite3_context |
| 4878 | 4881 | ** |
| | @@ -4913,11 +4916,11 @@ |
| 4913 | 4916 | ** function. |
| 4914 | 4917 | ** |
| 4915 | 4918 | ** This routine must be called from the same thread in which |
| 4916 | 4919 | ** the aggregate SQL function is running. |
| 4917 | 4920 | */ |
| 4918 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context*, int nBytes); |
| 4921 | +SQLITE_API void *sqlite3_aggregate_context(sqlite3_context*, int nBytes); |
| 4919 | 4922 | |
| 4920 | 4923 | /* |
| 4921 | 4924 | ** CAPI3REF: User Data For Functions |
| 4922 | 4925 | ** METHOD: sqlite3_context |
| 4923 | 4926 | ** |
| | @@ -4928,11 +4931,11 @@ |
| 4928 | 4931 | ** registered the application defined function. |
| 4929 | 4932 | ** |
| 4930 | 4933 | ** This routine must be called from the same thread in which |
| 4931 | 4934 | ** the application-defined function is running. |
| 4932 | 4935 | */ |
| 4933 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context*); |
| 4936 | +SQLITE_API void *sqlite3_user_data(sqlite3_context*); |
| 4934 | 4937 | |
| 4935 | 4938 | /* |
| 4936 | 4939 | ** CAPI3REF: Database Connection For Functions |
| 4937 | 4940 | ** METHOD: sqlite3_context |
| 4938 | 4941 | ** |
| | @@ -4940,11 +4943,11 @@ |
| 4940 | 4943 | ** the pointer to the [database connection] (the 1st parameter) |
| 4941 | 4944 | ** of the [sqlite3_create_function()] |
| 4942 | 4945 | ** and [sqlite3_create_function16()] routines that originally |
| 4943 | 4946 | ** registered the application defined function. |
| 4944 | 4947 | */ |
| 4945 | | -SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context*); |
| 4948 | +SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context*); |
| 4946 | 4949 | |
| 4947 | 4950 | /* |
| 4948 | 4951 | ** CAPI3REF: Function Auxiliary Data |
| 4949 | 4952 | ** METHOD: sqlite3_context |
| 4950 | 4953 | ** |
| | @@ -4994,12 +4997,12 @@ |
| 4994 | 4997 | ** values and [parameters] and expressions composed from the same.)^ |
| 4995 | 4998 | ** |
| 4996 | 4999 | ** These routines must be called from the same thread in which |
| 4997 | 5000 | ** the SQL function is running. |
| 4998 | 5001 | */ |
| 4999 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context*, int N); |
| 5000 | | -SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*)); |
| 5002 | +SQLITE_API void *sqlite3_get_auxdata(sqlite3_context*, int N); |
| 5003 | +SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*)); |
| 5001 | 5004 | |
| 5002 | 5005 | |
| 5003 | 5006 | /* |
| 5004 | 5007 | ** CAPI3REF: Constants Defining Special Destructor Behavior |
| 5005 | 5008 | ** |
| | @@ -5131,31 +5134,31 @@ |
| 5131 | 5134 | ** |
| 5132 | 5135 | ** If these routines are called from within the different thread |
| 5133 | 5136 | ** than the one containing the application-defined function that received |
| 5134 | 5137 | ** the [sqlite3_context] pointer, the results are undefined. |
| 5135 | 5138 | */ |
| 5136 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*)); |
| 5137 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(sqlite3_context*,const void*, |
| 5139 | +SQLITE_API void sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*)); |
| 5140 | +SQLITE_API void sqlite3_result_blob64(sqlite3_context*,const void*, |
| 5138 | 5141 | sqlite3_uint64,void(*)(void*)); |
| 5139 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context*, double); |
| 5140 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context*, const char*, int); |
| 5141 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context*, const void*, int); |
| 5142 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context*); |
| 5143 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context*); |
| 5144 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context*, int); |
| 5145 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context*, int); |
| 5146 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64); |
| 5147 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context*); |
| 5148 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*)); |
| 5149 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64, |
| 5142 | +SQLITE_API void sqlite3_result_double(sqlite3_context*, double); |
| 5143 | +SQLITE_API void sqlite3_result_error(sqlite3_context*, const char*, int); |
| 5144 | +SQLITE_API void sqlite3_result_error16(sqlite3_context*, const void*, int); |
| 5145 | +SQLITE_API void sqlite3_result_error_toobig(sqlite3_context*); |
| 5146 | +SQLITE_API void sqlite3_result_error_nomem(sqlite3_context*); |
| 5147 | +SQLITE_API void sqlite3_result_error_code(sqlite3_context*, int); |
| 5148 | +SQLITE_API void sqlite3_result_int(sqlite3_context*, int); |
| 5149 | +SQLITE_API void sqlite3_result_int64(sqlite3_context*, sqlite3_int64); |
| 5150 | +SQLITE_API void sqlite3_result_null(sqlite3_context*); |
| 5151 | +SQLITE_API void sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*)); |
| 5152 | +SQLITE_API void sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64, |
| 5150 | 5153 | void(*)(void*), unsigned char encoding); |
| 5151 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*)); |
| 5152 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*)); |
| 5153 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*)); |
| 5154 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*); |
| 5155 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n); |
| 5156 | | -SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n); |
| 5154 | +SQLITE_API void sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*)); |
| 5155 | +SQLITE_API void sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*)); |
| 5156 | +SQLITE_API void sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*)); |
| 5157 | +SQLITE_API void sqlite3_result_value(sqlite3_context*, sqlite3_value*); |
| 5158 | +SQLITE_API void sqlite3_result_zeroblob(sqlite3_context*, int n); |
| 5159 | +SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n); |
| 5157 | 5160 | |
| 5158 | 5161 | |
| 5159 | 5162 | /* |
| 5160 | 5163 | ** CAPI3REF: Setting The Subtype Of An SQL Function |
| 5161 | 5164 | ** METHOD: sqlite3_context |
| | @@ -5166,11 +5169,11 @@ |
| 5166 | 5169 | ** of the subtype T are preserved in current versions of SQLite; |
| 5167 | 5170 | ** higher order bits are discarded. |
| 5168 | 5171 | ** The number of subtype bytes preserved by SQLite might increase |
| 5169 | 5172 | ** in future releases of SQLite. |
| 5170 | 5173 | */ |
| 5171 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context*,unsigned int); |
| 5174 | +SQLITE_API void sqlite3_result_subtype(sqlite3_context*,unsigned int); |
| 5172 | 5175 | |
| 5173 | 5176 | /* |
| 5174 | 5177 | ** CAPI3REF: Define New Collating Sequences |
| 5175 | 5178 | ** METHOD: sqlite3 |
| 5176 | 5179 | ** |
| | @@ -5248,26 +5251,26 @@ |
| 5248 | 5251 | ** is unfortunate but cannot be changed without breaking backwards |
| 5249 | 5252 | ** compatibility. |
| 5250 | 5253 | ** |
| 5251 | 5254 | ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()]. |
| 5252 | 5255 | */ |
| 5253 | | -SQLITE_API int SQLITE_STDCALL sqlite3_create_collation( |
| 5256 | +SQLITE_API int sqlite3_create_collation( |
| 5254 | 5257 | sqlite3*, |
| 5255 | 5258 | const char *zName, |
| 5256 | 5259 | int eTextRep, |
| 5257 | 5260 | void *pArg, |
| 5258 | 5261 | int(*xCompare)(void*,int,const void*,int,const void*) |
| 5259 | 5262 | ); |
| 5260 | | -SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2( |
| 5263 | +SQLITE_API int sqlite3_create_collation_v2( |
| 5261 | 5264 | sqlite3*, |
| 5262 | 5265 | const char *zName, |
| 5263 | 5266 | int eTextRep, |
| 5264 | 5267 | void *pArg, |
| 5265 | 5268 | int(*xCompare)(void*,int,const void*,int,const void*), |
| 5266 | 5269 | void(*xDestroy)(void*) |
| 5267 | 5270 | ); |
| 5268 | | -SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16( |
| 5271 | +SQLITE_API int sqlite3_create_collation16( |
| 5269 | 5272 | sqlite3*, |
| 5270 | 5273 | const void *zName, |
| 5271 | 5274 | int eTextRep, |
| 5272 | 5275 | void *pArg, |
| 5273 | 5276 | int(*xCompare)(void*,int,const void*,int,const void*) |
| | @@ -5298,16 +5301,16 @@ |
| 5298 | 5301 | ** |
| 5299 | 5302 | ** The callback function should register the desired collation using |
| 5300 | 5303 | ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or |
| 5301 | 5304 | ** [sqlite3_create_collation_v2()]. |
| 5302 | 5305 | */ |
| 5303 | | -SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed( |
| 5306 | +SQLITE_API int sqlite3_collation_needed( |
| 5304 | 5307 | sqlite3*, |
| 5305 | 5308 | void*, |
| 5306 | 5309 | void(*)(void*,sqlite3*,int eTextRep,const char*) |
| 5307 | 5310 | ); |
| 5308 | | -SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16( |
| 5311 | +SQLITE_API int sqlite3_collation_needed16( |
| 5309 | 5312 | sqlite3*, |
| 5310 | 5313 | void*, |
| 5311 | 5314 | void(*)(void*,sqlite3*,int eTextRep,const void*) |
| 5312 | 5315 | ); |
| 5313 | 5316 | |
| | @@ -5317,15 +5320,15 @@ |
| 5317 | 5320 | ** called right after sqlite3_open(). |
| 5318 | 5321 | ** |
| 5319 | 5322 | ** The code to implement this API is not available in the public release |
| 5320 | 5323 | ** of SQLite. |
| 5321 | 5324 | */ |
| 5322 | | -SQLITE_API int SQLITE_STDCALL sqlite3_key( |
| 5325 | +SQLITE_API int sqlite3_key( |
| 5323 | 5326 | sqlite3 *db, /* Database to be rekeyed */ |
| 5324 | 5327 | const void *pKey, int nKey /* The key */ |
| 5325 | 5328 | ); |
| 5326 | | -SQLITE_API int SQLITE_STDCALL sqlite3_key_v2( |
| 5329 | +SQLITE_API int sqlite3_key_v2( |
| 5327 | 5330 | sqlite3 *db, /* Database to be rekeyed */ |
| 5328 | 5331 | const char *zDbName, /* Name of the database */ |
| 5329 | 5332 | const void *pKey, int nKey /* The key */ |
| 5330 | 5333 | ); |
| 5331 | 5334 | |
| | @@ -5335,35 +5338,35 @@ |
| 5335 | 5338 | ** database is decrypted. |
| 5336 | 5339 | ** |
| 5337 | 5340 | ** The code to implement this API is not available in the public release |
| 5338 | 5341 | ** of SQLite. |
| 5339 | 5342 | */ |
| 5340 | | -SQLITE_API int SQLITE_STDCALL sqlite3_rekey( |
| 5343 | +SQLITE_API int sqlite3_rekey( |
| 5341 | 5344 | sqlite3 *db, /* Database to be rekeyed */ |
| 5342 | 5345 | const void *pKey, int nKey /* The new key */ |
| 5343 | 5346 | ); |
| 5344 | | -SQLITE_API int SQLITE_STDCALL sqlite3_rekey_v2( |
| 5347 | +SQLITE_API int sqlite3_rekey_v2( |
| 5345 | 5348 | sqlite3 *db, /* Database to be rekeyed */ |
| 5346 | 5349 | const char *zDbName, /* Name of the database */ |
| 5347 | 5350 | const void *pKey, int nKey /* The new key */ |
| 5348 | 5351 | ); |
| 5349 | 5352 | |
| 5350 | 5353 | /* |
| 5351 | 5354 | ** Specify the activation key for a SEE database. Unless |
| 5352 | 5355 | ** activated, none of the SEE routines will work. |
| 5353 | 5356 | */ |
| 5354 | | -SQLITE_API void SQLITE_STDCALL sqlite3_activate_see( |
| 5357 | +SQLITE_API void sqlite3_activate_see( |
| 5355 | 5358 | const char *zPassPhrase /* Activation phrase */ |
| 5356 | 5359 | ); |
| 5357 | 5360 | #endif |
| 5358 | 5361 | |
| 5359 | 5362 | #ifdef SQLITE_ENABLE_CEROD |
| 5360 | 5363 | /* |
| 5361 | 5364 | ** Specify the activation key for a CEROD database. Unless |
| 5362 | 5365 | ** activated, none of the CEROD routines will work. |
| 5363 | 5366 | */ |
| 5364 | | -SQLITE_API void SQLITE_STDCALL sqlite3_activate_cerod( |
| 5367 | +SQLITE_API void sqlite3_activate_cerod( |
| 5365 | 5368 | const char *zPassPhrase /* Activation phrase */ |
| 5366 | 5369 | ); |
| 5367 | 5370 | #endif |
| 5368 | 5371 | |
| 5369 | 5372 | /* |
| | @@ -5381,11 +5384,11 @@ |
| 5381 | 5384 | ** method of the default [sqlite3_vfs] object. If the xSleep() method |
| 5382 | 5385 | ** of the default VFS is not implemented correctly, or not implemented at |
| 5383 | 5386 | ** all, then the behavior of sqlite3_sleep() may deviate from the description |
| 5384 | 5387 | ** in the previous paragraphs. |
| 5385 | 5388 | */ |
| 5386 | | -SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int); |
| 5389 | +SQLITE_API int sqlite3_sleep(int); |
| 5387 | 5390 | |
| 5388 | 5391 | /* |
| 5389 | 5392 | ** CAPI3REF: Name Of The Folder Holding Temporary Files |
| 5390 | 5393 | ** |
| 5391 | 5394 | ** ^(If this global variable is made to point to a string which is |
| | @@ -5500,11 +5503,11 @@ |
| 5500 | 5503 | ** |
| 5501 | 5504 | ** If another thread changes the autocommit status of the database |
| 5502 | 5505 | ** connection while this routine is running, then the return value |
| 5503 | 5506 | ** is undefined. |
| 5504 | 5507 | */ |
| 5505 | | -SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3*); |
| 5508 | +SQLITE_API int sqlite3_get_autocommit(sqlite3*); |
| 5506 | 5509 | |
| 5507 | 5510 | /* |
| 5508 | 5511 | ** CAPI3REF: Find The Database Handle Of A Prepared Statement |
| 5509 | 5512 | ** METHOD: sqlite3_stmt |
| 5510 | 5513 | ** |
| | @@ -5513,11 +5516,11 @@ |
| 5513 | 5516 | ** returned by sqlite3_db_handle is the same [database connection] |
| 5514 | 5517 | ** that was the first argument |
| 5515 | 5518 | ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to |
| 5516 | 5519 | ** create the statement in the first place. |
| 5517 | 5520 | */ |
| 5518 | | -SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt*); |
| 5521 | +SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*); |
| 5519 | 5522 | |
| 5520 | 5523 | /* |
| 5521 | 5524 | ** CAPI3REF: Return The Filename For A Database Connection |
| 5522 | 5525 | ** METHOD: sqlite3 |
| 5523 | 5526 | ** |
| | @@ -5530,21 +5533,21 @@ |
| 5530 | 5533 | ** ^The filename returned by this function is the output of the |
| 5531 | 5534 | ** xFullPathname method of the [VFS]. ^In other words, the filename |
| 5532 | 5535 | ** will be an absolute pathname, even if the filename used |
| 5533 | 5536 | ** to open the database originally was a URI or relative pathname. |
| 5534 | 5537 | */ |
| 5535 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName); |
| 5538 | +SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName); |
| 5536 | 5539 | |
| 5537 | 5540 | /* |
| 5538 | 5541 | ** CAPI3REF: Determine if a database is read-only |
| 5539 | 5542 | ** METHOD: sqlite3 |
| 5540 | 5543 | ** |
| 5541 | 5544 | ** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N |
| 5542 | 5545 | ** of connection D is read-only, 0 if it is read/write, or -1 if N is not |
| 5543 | 5546 | ** the name of a database on connection D. |
| 5544 | 5547 | */ |
| 5545 | | -SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName); |
| 5548 | +SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName); |
| 5546 | 5549 | |
| 5547 | 5550 | /* |
| 5548 | 5551 | ** CAPI3REF: Find the next prepared statement |
| 5549 | 5552 | ** METHOD: sqlite3 |
| 5550 | 5553 | ** |
| | @@ -5556,11 +5559,11 @@ |
| 5556 | 5559 | ** |
| 5557 | 5560 | ** The [database connection] pointer D in a call to |
| 5558 | 5561 | ** [sqlite3_next_stmt(D,S)] must refer to an open database |
| 5559 | 5562 | ** connection and in particular must not be a NULL pointer. |
| 5560 | 5563 | */ |
| 5561 | | -SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt); |
| 5564 | +SQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt); |
| 5562 | 5565 | |
| 5563 | 5566 | /* |
| 5564 | 5567 | ** CAPI3REF: Commit And Rollback Notification Callbacks |
| 5565 | 5568 | ** METHOD: sqlite3 |
| 5566 | 5569 | ** |
| | @@ -5605,12 +5608,12 @@ |
| 5605 | 5608 | ** ^The rollback callback is not invoked if a transaction is |
| 5606 | 5609 | ** automatically rolled back because the database connection is closed. |
| 5607 | 5610 | ** |
| 5608 | 5611 | ** See also the [sqlite3_update_hook()] interface. |
| 5609 | 5612 | */ |
| 5610 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(sqlite3*, int(*)(void*), void*); |
| 5611 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*); |
| 5613 | +SQLITE_API void *sqlite3_commit_hook(sqlite3*, int(*)(void*), void*); |
| 5614 | +SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*); |
| 5612 | 5615 | |
| 5613 | 5616 | /* |
| 5614 | 5617 | ** CAPI3REF: Data Change Notification Callbacks |
| 5615 | 5618 | ** METHOD: sqlite3 |
| 5616 | 5619 | ** |
| | @@ -5657,11 +5660,11 @@ |
| 5657 | 5660 | ** the first call on D. |
| 5658 | 5661 | ** |
| 5659 | 5662 | ** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()], |
| 5660 | 5663 | ** and [sqlite3_preupdate_hook()] interfaces. |
| 5661 | 5664 | */ |
| 5662 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook( |
| 5665 | +SQLITE_API void *sqlite3_update_hook( |
| 5663 | 5666 | sqlite3*, |
| 5664 | 5667 | void(*)(void *,int ,char const *,char const *,sqlite3_int64), |
| 5665 | 5668 | void* |
| 5666 | 5669 | ); |
| 5667 | 5670 | |
| | @@ -5672,11 +5675,12 @@ |
| 5672 | 5675 | ** and schema data structures between [database connection | connections] |
| 5673 | 5676 | ** to the same database. Sharing is enabled if the argument is true |
| 5674 | 5677 | ** and disabled if the argument is false.)^ |
| 5675 | 5678 | ** |
| 5676 | 5679 | ** ^Cache sharing is enabled and disabled for an entire process. |
| 5677 | | -** This is a change as of SQLite version 3.5.0. In prior versions of SQLite, |
| 5680 | +** This is a change as of SQLite [version 3.5.0] ([dateof:3.5.0]). |
| 5681 | +** In prior versions of SQLite, |
| 5678 | 5682 | ** sharing was enabled or disabled for each thread separately. |
| 5679 | 5683 | ** |
| 5680 | 5684 | ** ^(The cache sharing mode set by this interface effects all subsequent |
| 5681 | 5685 | ** calls to [sqlite3_open()], [sqlite3_open_v2()], and [sqlite3_open16()]. |
| 5682 | 5686 | ** Existing database connections continue use the sharing mode |
| | @@ -5697,11 +5701,11 @@ |
| 5697 | 5701 | ** This interface is threadsafe on processors where writing a |
| 5698 | 5702 | ** 32-bit integer is atomic. |
| 5699 | 5703 | ** |
| 5700 | 5704 | ** See Also: [SQLite Shared-Cache Mode] |
| 5701 | 5705 | */ |
| 5702 | | -SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int); |
| 5706 | +SQLITE_API int sqlite3_enable_shared_cache(int); |
| 5703 | 5707 | |
| 5704 | 5708 | /* |
| 5705 | 5709 | ** CAPI3REF: Attempt To Free Heap Memory |
| 5706 | 5710 | ** |
| 5707 | 5711 | ** ^The sqlite3_release_memory() interface attempts to free N bytes |
| | @@ -5713,11 +5717,11 @@ |
| 5713 | 5717 | ** ^The sqlite3_release_memory() routine is a no-op returning zero |
| 5714 | 5718 | ** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT]. |
| 5715 | 5719 | ** |
| 5716 | 5720 | ** See also: [sqlite3_db_release_memory()] |
| 5717 | 5721 | */ |
| 5718 | | -SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int); |
| 5722 | +SQLITE_API int sqlite3_release_memory(int); |
| 5719 | 5723 | |
| 5720 | 5724 | /* |
| 5721 | 5725 | ** CAPI3REF: Free Memory Used By A Database Connection |
| 5722 | 5726 | ** METHOD: sqlite3 |
| 5723 | 5727 | ** |
| | @@ -5727,11 +5731,11 @@ |
| 5727 | 5731 | ** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is |
| 5728 | 5732 | ** omitted. |
| 5729 | 5733 | ** |
| 5730 | 5734 | ** See also: [sqlite3_release_memory()] |
| 5731 | 5735 | */ |
| 5732 | | -SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3*); |
| 5736 | +SQLITE_API int sqlite3_db_release_memory(sqlite3*); |
| 5733 | 5737 | |
| 5734 | 5738 | /* |
| 5735 | 5739 | ** CAPI3REF: Impose A Limit On Heap Size |
| 5736 | 5740 | ** |
| 5737 | 5741 | ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the |
| | @@ -5766,11 +5770,12 @@ |
| 5766 | 5770 | ** <li> The page cache allocates from its own memory pool supplied |
| 5767 | 5771 | ** by [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],...) rather than |
| 5768 | 5772 | ** from the heap. |
| 5769 | 5773 | ** </ul>)^ |
| 5770 | 5774 | ** |
| 5771 | | -** Beginning with SQLite version 3.7.3, the soft heap limit is enforced |
| 5775 | +** Beginning with SQLite [version 3.7.3] ([dateof:3.7.3]), |
| 5776 | +** the soft heap limit is enforced |
| 5772 | 5777 | ** regardless of whether or not the [SQLITE_ENABLE_MEMORY_MANAGEMENT] |
| 5773 | 5778 | ** compile-time option is invoked. With [SQLITE_ENABLE_MEMORY_MANAGEMENT], |
| 5774 | 5779 | ** the soft heap limit is enforced on every memory allocation. Without |
| 5775 | 5780 | ** [SQLITE_ENABLE_MEMORY_MANAGEMENT], the soft heap limit is only enforced |
| 5776 | 5781 | ** when memory is allocated by the page cache. Testing suggests that because |
| | @@ -5779,11 +5784,11 @@ |
| 5779 | 5784 | ** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT]. |
| 5780 | 5785 | ** |
| 5781 | 5786 | ** The circumstances under which SQLite will enforce the soft heap limit may |
| 5782 | 5787 | ** changes in future releases of SQLite. |
| 5783 | 5788 | */ |
| 5784 | | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 N); |
| 5789 | +SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 N); |
| 5785 | 5790 | |
| 5786 | 5791 | /* |
| 5787 | 5792 | ** CAPI3REF: Deprecated Soft Heap Limit Interface |
| 5788 | 5793 | ** DEPRECATED |
| 5789 | 5794 | ** |
| | @@ -5790,11 +5795,11 @@ |
| 5790 | 5795 | ** This is a deprecated version of the [sqlite3_soft_heap_limit64()] |
| 5791 | 5796 | ** interface. This routine is provided for historical compatibility |
| 5792 | 5797 | ** only. All new applications should use the |
| 5793 | 5798 | ** [sqlite3_soft_heap_limit64()] interface rather than this one. |
| 5794 | 5799 | */ |
| 5795 | | -SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_soft_heap_limit(int N); |
| 5800 | +SQLITE_API SQLITE_DEPRECATED void sqlite3_soft_heap_limit(int N); |
| 5796 | 5801 | |
| 5797 | 5802 | |
| 5798 | 5803 | /* |
| 5799 | 5804 | ** CAPI3REF: Extract Metadata About A Column Of A Table |
| 5800 | 5805 | ** METHOD: sqlite3 |
| | @@ -5860,11 +5865,11 @@ |
| 5860 | 5865 | ** |
| 5861 | 5866 | ** ^This function causes all database schemas to be read from disk and |
| 5862 | 5867 | ** parsed, if that has not already been done, and returns an error if |
| 5863 | 5868 | ** any errors are encountered while loading the schema. |
| 5864 | 5869 | */ |
| 5865 | | -SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata( |
| 5870 | +SQLITE_API int sqlite3_table_column_metadata( |
| 5866 | 5871 | sqlite3 *db, /* Connection handle */ |
| 5867 | 5872 | const char *zDbName, /* Database name or NULL */ |
| 5868 | 5873 | const char *zTableName, /* Table name */ |
| 5869 | 5874 | const char *zColumnName, /* Column name */ |
| 5870 | 5875 | char const **pzDataType, /* OUTPUT: Declared data type */ |
| | @@ -5916,11 +5921,11 @@ |
| 5916 | 5921 | ** disabled and prevent SQL injections from giving attackers |
| 5917 | 5922 | ** access to extension loading capabilities. |
| 5918 | 5923 | ** |
| 5919 | 5924 | ** See also the [load_extension() SQL function]. |
| 5920 | 5925 | */ |
| 5921 | | -SQLITE_API int SQLITE_STDCALL sqlite3_load_extension( |
| 5926 | +SQLITE_API int sqlite3_load_extension( |
| 5922 | 5927 | sqlite3 *db, /* Load the extension into this database connection */ |
| 5923 | 5928 | const char *zFile, /* Name of the shared library containing extension */ |
| 5924 | 5929 | const char *zProc, /* Entry point. Derived from zFile if 0 */ |
| 5925 | 5930 | char **pzErrMsg /* Put error message here if not 0 */ |
| 5926 | 5931 | ); |
| | @@ -5948,11 +5953,11 @@ |
| 5948 | 5953 | ** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method |
| 5949 | 5954 | ** rather than this interface, so the [load_extension()] SQL function |
| 5950 | 5955 | ** remains disabled. This will prevent SQL injections from giving attackers |
| 5951 | 5956 | ** access to extension loading capabilities. |
| 5952 | 5957 | */ |
| 5953 | | -SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff); |
| 5958 | +SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff); |
| 5954 | 5959 | |
| 5955 | 5960 | /* |
| 5956 | 5961 | ** CAPI3REF: Automatically Load Statically Linked Extensions |
| 5957 | 5962 | ** |
| 5958 | 5963 | ** ^This interface causes the xEntryPoint() function to be invoked for |
| | @@ -5986,11 +5991,11 @@ |
| 5986 | 5991 | ** will be called more than once for each database connection that is opened. |
| 5987 | 5992 | ** |
| 5988 | 5993 | ** See also: [sqlite3_reset_auto_extension()] |
| 5989 | 5994 | ** and [sqlite3_cancel_auto_extension()] |
| 5990 | 5995 | */ |
| 5991 | | -SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void(*xEntryPoint)(void)); |
| 5996 | +SQLITE_API int sqlite3_auto_extension(void(*xEntryPoint)(void)); |
| 5992 | 5997 | |
| 5993 | 5998 | /* |
| 5994 | 5999 | ** CAPI3REF: Cancel Automatic Extension Loading |
| 5995 | 6000 | ** |
| 5996 | 6001 | ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the |
| | @@ -5998,19 +6003,19 @@ |
| 5998 | 6003 | ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)] |
| 5999 | 6004 | ** routine returns 1 if initialization routine X was successfully |
| 6000 | 6005 | ** unregistered and it returns 0 if X was not on the list of initialization |
| 6001 | 6006 | ** routines. |
| 6002 | 6007 | */ |
| 6003 | | -SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void(*xEntryPoint)(void)); |
| 6008 | +SQLITE_API int sqlite3_cancel_auto_extension(void(*xEntryPoint)(void)); |
| 6004 | 6009 | |
| 6005 | 6010 | /* |
| 6006 | 6011 | ** CAPI3REF: Reset Automatic Extension Loading |
| 6007 | 6012 | ** |
| 6008 | 6013 | ** ^This interface disables all automatic extensions previously |
| 6009 | 6014 | ** registered using [sqlite3_auto_extension()]. |
| 6010 | 6015 | */ |
| 6011 | | -SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void); |
| 6016 | +SQLITE_API void sqlite3_reset_auto_extension(void); |
| 6012 | 6017 | |
| 6013 | 6018 | /* |
| 6014 | 6019 | ** The interface to the virtual-table mechanism is currently considered |
| 6015 | 6020 | ** to be experimental. The interface might change in incompatible ways. |
| 6016 | 6021 | ** If this is a problem for you, do not use the interface at this time. |
| | @@ -6160,17 +6165,19 @@ |
| 6160 | 6165 | ** before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not |
| 6161 | 6166 | ** set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by |
| 6162 | 6167 | ** the xUpdate method are automatically rolled back by SQLite. |
| 6163 | 6168 | ** |
| 6164 | 6169 | ** IMPORTANT: The estimatedRows field was added to the sqlite3_index_info |
| 6165 | | -** structure for SQLite version 3.8.2. If a virtual table extension is |
| 6170 | +** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). |
| 6171 | +** If a virtual table extension is |
| 6166 | 6172 | ** used with an SQLite version earlier than 3.8.2, the results of attempting |
| 6167 | 6173 | ** to read or write the estimatedRows field are undefined (but are likely |
| 6168 | 6174 | ** to included crashing the application). The estimatedRows field should |
| 6169 | 6175 | ** therefore only be used if [sqlite3_libversion_number()] returns a |
| 6170 | 6176 | ** value greater than or equal to 3008002. Similarly, the idxFlags field |
| 6171 | | -** was added for version 3.9.0. It may therefore only be used if |
| 6177 | +** was added for [version 3.9.0] ([dateof:3.9.0]). |
| 6178 | +** It may therefore only be used if |
| 6172 | 6179 | ** sqlite3_libversion_number() returns a value greater than or equal to |
| 6173 | 6180 | ** 3009000. |
| 6174 | 6181 | */ |
| 6175 | 6182 | struct sqlite3_index_info { |
| 6176 | 6183 | /* Inputs */ |
| | @@ -6251,17 +6258,17 @@ |
| 6251 | 6258 | ** be invoked if the call to sqlite3_create_module_v2() fails. |
| 6252 | 6259 | ** ^The sqlite3_create_module() |
| 6253 | 6260 | ** interface is equivalent to sqlite3_create_module_v2() with a NULL |
| 6254 | 6261 | ** destructor. |
| 6255 | 6262 | */ |
| 6256 | | -SQLITE_API int SQLITE_STDCALL sqlite3_create_module( |
| 6263 | +SQLITE_API int sqlite3_create_module( |
| 6257 | 6264 | sqlite3 *db, /* SQLite connection to register module with */ |
| 6258 | 6265 | const char *zName, /* Name of the module */ |
| 6259 | 6266 | const sqlite3_module *p, /* Methods for the module */ |
| 6260 | 6267 | void *pClientData /* Client data for xCreate/xConnect */ |
| 6261 | 6268 | ); |
| 6262 | | -SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2( |
| 6269 | +SQLITE_API int sqlite3_create_module_v2( |
| 6263 | 6270 | sqlite3 *db, /* SQLite connection to register module with */ |
| 6264 | 6271 | const char *zName, /* Name of the module */ |
| 6265 | 6272 | const sqlite3_module *p, /* Methods for the module */ |
| 6266 | 6273 | void *pClientData, /* Client data for xCreate/xConnect */ |
| 6267 | 6274 | void(*xDestroy)(void*) /* Module destructor function */ |
| | @@ -6320,11 +6327,11 @@ |
| 6320 | 6327 | ** ^The [xCreate] and [xConnect] methods of a |
| 6321 | 6328 | ** [virtual table module] call this interface |
| 6322 | 6329 | ** to declare the format (the names and datatypes of the columns) of |
| 6323 | 6330 | ** the virtual tables they implement. |
| 6324 | 6331 | */ |
| 6325 | | -SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3*, const char *zSQL); |
| 6332 | +SQLITE_API int sqlite3_declare_vtab(sqlite3*, const char *zSQL); |
| 6326 | 6333 | |
| 6327 | 6334 | /* |
| 6328 | 6335 | ** CAPI3REF: Overload A Function For A Virtual Table |
| 6329 | 6336 | ** METHOD: sqlite3 |
| 6330 | 6337 | ** |
| | @@ -6339,11 +6346,11 @@ |
| 6339 | 6346 | ** of the new function always causes an exception to be thrown. So |
| 6340 | 6347 | ** the new function is not good for anything by itself. Its only |
| 6341 | 6348 | ** purpose is to be a placeholder function that can be overloaded |
| 6342 | 6349 | ** by a [virtual table]. |
| 6343 | 6350 | */ |
| 6344 | | -SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg); |
| 6351 | +SQLITE_API int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg); |
| 6345 | 6352 | |
| 6346 | 6353 | /* |
| 6347 | 6354 | ** The interface to the virtual-table mechanism defined above (back up |
| 6348 | 6355 | ** to a comment remarkably similar to this one) is currently considered |
| 6349 | 6356 | ** to be experimental. The interface might change in incompatible ways. |
| | @@ -6438,11 +6445,11 @@ |
| 6438 | 6445 | ** zero-filled blob to read or write using the incremental-blob interface. |
| 6439 | 6446 | ** |
| 6440 | 6447 | ** To avoid a resource leak, every open [BLOB handle] should eventually |
| 6441 | 6448 | ** be released by a call to [sqlite3_blob_close()]. |
| 6442 | 6449 | */ |
| 6443 | | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_open( |
| 6450 | +SQLITE_API int sqlite3_blob_open( |
| 6444 | 6451 | sqlite3*, |
| 6445 | 6452 | const char *zDb, |
| 6446 | 6453 | const char *zTable, |
| 6447 | 6454 | const char *zColumn, |
| 6448 | 6455 | sqlite3_int64 iRow, |
| | @@ -6471,11 +6478,11 @@ |
| 6471 | 6478 | ** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle |
| 6472 | 6479 | ** always returns zero. |
| 6473 | 6480 | ** |
| 6474 | 6481 | ** ^This function sets the database handle error code and message. |
| 6475 | 6482 | */ |
| 6476 | | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64); |
| 6483 | +SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64); |
| 6477 | 6484 | |
| 6478 | 6485 | /* |
| 6479 | 6486 | ** CAPI3REF: Close A BLOB Handle |
| 6480 | 6487 | ** DESTRUCTOR: sqlite3_blob |
| 6481 | 6488 | ** |
| | @@ -6494,11 +6501,11 @@ |
| 6494 | 6501 | ** with a null pointer (such as would be returned by a failed call to |
| 6495 | 6502 | ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function |
| 6496 | 6503 | ** is passed a valid open blob handle, the values returned by the |
| 6497 | 6504 | ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning. |
| 6498 | 6505 | */ |
| 6499 | | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *); |
| 6506 | +SQLITE_API int sqlite3_blob_close(sqlite3_blob *); |
| 6500 | 6507 | |
| 6501 | 6508 | /* |
| 6502 | 6509 | ** CAPI3REF: Return The Size Of An Open BLOB |
| 6503 | 6510 | ** METHOD: sqlite3_blob |
| 6504 | 6511 | ** |
| | @@ -6510,11 +6517,11 @@ |
| 6510 | 6517 | ** This routine only works on a [BLOB handle] which has been created |
| 6511 | 6518 | ** by a prior successful call to [sqlite3_blob_open()] and which has not |
| 6512 | 6519 | ** been closed by [sqlite3_blob_close()]. Passing any other pointer in |
| 6513 | 6520 | ** to this routine results in undefined and probably undesirable behavior. |
| 6514 | 6521 | */ |
| 6515 | | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *); |
| 6522 | +SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *); |
| 6516 | 6523 | |
| 6517 | 6524 | /* |
| 6518 | 6525 | ** CAPI3REF: Read Data From A BLOB Incrementally |
| 6519 | 6526 | ** METHOD: sqlite3_blob |
| 6520 | 6527 | ** |
| | @@ -6539,11 +6546,11 @@ |
| 6539 | 6546 | ** been closed by [sqlite3_blob_close()]. Passing any other pointer in |
| 6540 | 6547 | ** to this routine results in undefined and probably undesirable behavior. |
| 6541 | 6548 | ** |
| 6542 | 6549 | ** See also: [sqlite3_blob_write()]. |
| 6543 | 6550 | */ |
| 6544 | | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); |
| 6551 | +SQLITE_API int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); |
| 6545 | 6552 | |
| 6546 | 6553 | /* |
| 6547 | 6554 | ** CAPI3REF: Write Data Into A BLOB Incrementally |
| 6548 | 6555 | ** METHOD: sqlite3_blob |
| 6549 | 6556 | ** |
| | @@ -6581,11 +6588,11 @@ |
| 6581 | 6588 | ** been closed by [sqlite3_blob_close()]. Passing any other pointer in |
| 6582 | 6589 | ** to this routine results in undefined and probably undesirable behavior. |
| 6583 | 6590 | ** |
| 6584 | 6591 | ** See also: [sqlite3_blob_read()]. |
| 6585 | 6592 | */ |
| 6586 | | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset); |
| 6593 | +SQLITE_API int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset); |
| 6587 | 6594 | |
| 6588 | 6595 | /* |
| 6589 | 6596 | ** CAPI3REF: Virtual File System Objects |
| 6590 | 6597 | ** |
| 6591 | 6598 | ** A virtual filesystem (VFS) is an [sqlite3_vfs] object |
| | @@ -6612,13 +6619,13 @@ |
| 6612 | 6619 | ** |
| 6613 | 6620 | ** ^Unregister a VFS with the sqlite3_vfs_unregister() interface. |
| 6614 | 6621 | ** ^(If the default VFS is unregistered, another VFS is chosen as |
| 6615 | 6622 | ** the default. The choice for the new VFS is arbitrary.)^ |
| 6616 | 6623 | */ |
| 6617 | | -SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfsName); |
| 6618 | | -SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt); |
| 6619 | | -SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs*); |
| 6624 | +SQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfsName); |
| 6625 | +SQLITE_API int sqlite3_vfs_register(sqlite3_vfs*, int makeDflt); |
| 6626 | +SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*); |
| 6620 | 6627 | |
| 6621 | 6628 | /* |
| 6622 | 6629 | ** CAPI3REF: Mutexes |
| 6623 | 6630 | ** |
| 6624 | 6631 | ** The SQLite core uses these routines for thread |
| | @@ -6730,15 +6737,15 @@ |
| 6730 | 6737 | ** sqlite3_mutex_leave() is a NULL pointer, then all three routines |
| 6731 | 6738 | ** behave as no-ops. |
| 6732 | 6739 | ** |
| 6733 | 6740 | ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. |
| 6734 | 6741 | */ |
| 6735 | | -SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int); |
| 6736 | | -SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*); |
| 6737 | | -SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*); |
| 6738 | | -SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*); |
| 6739 | | -SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*); |
| 6742 | +SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int); |
| 6743 | +SQLITE_API void sqlite3_mutex_free(sqlite3_mutex*); |
| 6744 | +SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex*); |
| 6745 | +SQLITE_API int sqlite3_mutex_try(sqlite3_mutex*); |
| 6746 | +SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex*); |
| 6740 | 6747 | |
| 6741 | 6748 | /* |
| 6742 | 6749 | ** CAPI3REF: Mutex Methods Object |
| 6743 | 6750 | ** |
| 6744 | 6751 | ** An instance of this structure defines the low-level routines |
| | @@ -6844,12 +6851,12 @@ |
| 6844 | 6851 | ** call to sqlite3_mutex_held() to fail, so a non-zero return is |
| 6845 | 6852 | ** the appropriate thing to do. The sqlite3_mutex_notheld() |
| 6846 | 6853 | ** interface should also return 1 when given a NULL pointer. |
| 6847 | 6854 | */ |
| 6848 | 6855 | #ifndef NDEBUG |
| 6849 | | -SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex*); |
| 6850 | | -SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex*); |
| 6856 | +SQLITE_API int sqlite3_mutex_held(sqlite3_mutex*); |
| 6857 | +SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex*); |
| 6851 | 6858 | #endif |
| 6852 | 6859 | |
| 6853 | 6860 | /* |
| 6854 | 6861 | ** CAPI3REF: Mutex Types |
| 6855 | 6862 | ** |
| | @@ -6864,11 +6871,11 @@ |
| 6864 | 6871 | #define SQLITE_MUTEX_RECURSIVE 1 |
| 6865 | 6872 | #define SQLITE_MUTEX_STATIC_MASTER 2 |
| 6866 | 6873 | #define SQLITE_MUTEX_STATIC_MEM 3 /* sqlite3_malloc() */ |
| 6867 | 6874 | #define SQLITE_MUTEX_STATIC_MEM2 4 /* NOT USED */ |
| 6868 | 6875 | #define SQLITE_MUTEX_STATIC_OPEN 4 /* sqlite3BtreeOpen() */ |
| 6869 | | -#define SQLITE_MUTEX_STATIC_PRNG 5 /* sqlite3_random() */ |
| 6876 | +#define SQLITE_MUTEX_STATIC_PRNG 5 /* sqlite3_randomness() */ |
| 6870 | 6877 | #define SQLITE_MUTEX_STATIC_LRU 6 /* lru page list */ |
| 6871 | 6878 | #define SQLITE_MUTEX_STATIC_LRU2 7 /* NOT USED */ |
| 6872 | 6879 | #define SQLITE_MUTEX_STATIC_PMEM 7 /* sqlite3PageMalloc() */ |
| 6873 | 6880 | #define SQLITE_MUTEX_STATIC_APP1 8 /* For use by application */ |
| 6874 | 6881 | #define SQLITE_MUTEX_STATIC_APP2 9 /* For use by application */ |
| | @@ -6885,11 +6892,11 @@ |
| 6885 | 6892 | ** serializes access to the [database connection] given in the argument |
| 6886 | 6893 | ** when the [threading mode] is Serialized. |
| 6887 | 6894 | ** ^If the [threading mode] is Single-thread or Multi-thread then this |
| 6888 | 6895 | ** routine returns a NULL pointer. |
| 6889 | 6896 | */ |
| 6890 | | -SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3*); |
| 6897 | +SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3*); |
| 6891 | 6898 | |
| 6892 | 6899 | /* |
| 6893 | 6900 | ** CAPI3REF: Low-Level Control Of Database Files |
| 6894 | 6901 | ** METHOD: sqlite3 |
| 6895 | 6902 | ** |
| | @@ -6920,11 +6927,11 @@ |
| 6920 | 6927 | ** an incorrect zDbName and an SQLITE_ERROR return from the underlying |
| 6921 | 6928 | ** xFileControl method. |
| 6922 | 6929 | ** |
| 6923 | 6930 | ** See also: [SQLITE_FCNTL_LOCKSTATE] |
| 6924 | 6931 | */ |
| 6925 | | -SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*); |
| 6932 | +SQLITE_API int sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*); |
| 6926 | 6933 | |
| 6927 | 6934 | /* |
| 6928 | 6935 | ** CAPI3REF: Testing Interface |
| 6929 | 6936 | ** |
| 6930 | 6937 | ** ^The sqlite3_test_control() interface is used to read out internal |
| | @@ -6939,11 +6946,11 @@ |
| 6939 | 6946 | ** The details of the operation codes, their meanings, the parameters |
| 6940 | 6947 | ** they take, and what they do are all subject to change without notice. |
| 6941 | 6948 | ** Unlike most of the SQLite API, this function is not guaranteed to |
| 6942 | 6949 | ** operate consistently from one release to the next. |
| 6943 | 6950 | */ |
| 6944 | | -SQLITE_API int SQLITE_CDECL sqlite3_test_control(int op, ...); |
| 6951 | +SQLITE_API int sqlite3_test_control(int op, ...); |
| 6945 | 6952 | |
| 6946 | 6953 | /* |
| 6947 | 6954 | ** CAPI3REF: Testing Interface Operation Codes |
| 6948 | 6955 | ** |
| 6949 | 6956 | ** These constants are the valid operation code parameters used |
| | @@ -6968,10 +6975,11 @@ |
| 6968 | 6975 | #define SQLITE_TESTCTRL_OPTIMIZATIONS 15 |
| 6969 | 6976 | #define SQLITE_TESTCTRL_ISKEYWORD 16 |
| 6970 | 6977 | #define SQLITE_TESTCTRL_SCRATCHMALLOC 17 |
| 6971 | 6978 | #define SQLITE_TESTCTRL_LOCALTIME_FAULT 18 |
| 6972 | 6979 | #define SQLITE_TESTCTRL_EXPLAIN_STMT 19 /* NOT USED */ |
| 6980 | +#define SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD 19 |
| 6973 | 6981 | #define SQLITE_TESTCTRL_NEVER_CORRUPT 20 |
| 6974 | 6982 | #define SQLITE_TESTCTRL_VDBE_COVERAGE 21 |
| 6975 | 6983 | #define SQLITE_TESTCTRL_BYTEORDER 22 |
| 6976 | 6984 | #define SQLITE_TESTCTRL_ISINIT 23 |
| 6977 | 6985 | #define SQLITE_TESTCTRL_SORTER_MMAP 24 |
| | @@ -7002,12 +7010,12 @@ |
| 7002 | 7010 | ** be represented by a 32-bit integer, then the values returned by |
| 7003 | 7011 | ** sqlite3_status() are undefined. |
| 7004 | 7012 | ** |
| 7005 | 7013 | ** See also: [sqlite3_db_status()] |
| 7006 | 7014 | */ |
| 7007 | | -SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag); |
| 7008 | | -SQLITE_API int SQLITE_STDCALL sqlite3_status64( |
| 7015 | +SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag); |
| 7016 | +SQLITE_API int sqlite3_status64( |
| 7009 | 7017 | int op, |
| 7010 | 7018 | sqlite3_int64 *pCurrent, |
| 7011 | 7019 | sqlite3_int64 *pHighwater, |
| 7012 | 7020 | int resetFlag |
| 7013 | 7021 | ); |
| | @@ -7128,11 +7136,11 @@ |
| 7128 | 7136 | ** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a |
| 7129 | 7137 | ** non-zero [error code] on failure. |
| 7130 | 7138 | ** |
| 7131 | 7139 | ** See also: [sqlite3_status()] and [sqlite3_stmt_status()]. |
| 7132 | 7140 | */ |
| 7133 | | -SQLITE_API int SQLITE_STDCALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); |
| 7141 | +SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); |
| 7134 | 7142 | |
| 7135 | 7143 | /* |
| 7136 | 7144 | ** CAPI3REF: Status Parameters for database connections |
| 7137 | 7145 | ** KEYWORDS: {SQLITE_DBSTATUS options} |
| 7138 | 7146 | ** |
| | @@ -7271,11 +7279,11 @@ |
| 7271 | 7279 | ** ^If the resetFlg is true, then the counter is reset to zero after this |
| 7272 | 7280 | ** interface call returns. |
| 7273 | 7281 | ** |
| 7274 | 7282 | ** See also: [sqlite3_status()] and [sqlite3_db_status()]. |
| 7275 | 7283 | */ |
| 7276 | | -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); |
| 7284 | +SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); |
| 7277 | 7285 | |
| 7278 | 7286 | /* |
| 7279 | 7287 | ** CAPI3REF: Status Parameters for prepared statements |
| 7280 | 7288 | ** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters} |
| 7281 | 7289 | ** |
| | @@ -7740,20 +7748,20 @@ |
| 7740 | 7748 | ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount() |
| 7741 | 7749 | ** APIs are not strictly speaking threadsafe. If they are invoked at the |
| 7742 | 7750 | ** same time as another thread is invoking sqlite3_backup_step() it is |
| 7743 | 7751 | ** possible that they return invalid values. |
| 7744 | 7752 | */ |
| 7745 | | -SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init( |
| 7753 | +SQLITE_API sqlite3_backup *sqlite3_backup_init( |
| 7746 | 7754 | sqlite3 *pDest, /* Destination database handle */ |
| 7747 | 7755 | const char *zDestName, /* Destination database name */ |
| 7748 | 7756 | sqlite3 *pSource, /* Source database handle */ |
| 7749 | 7757 | const char *zSourceName /* Source database name */ |
| 7750 | 7758 | ); |
| 7751 | | -SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage); |
| 7752 | | -SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p); |
| 7753 | | -SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p); |
| 7754 | | -SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p); |
| 7759 | +SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage); |
| 7760 | +SQLITE_API int sqlite3_backup_finish(sqlite3_backup *p); |
| 7761 | +SQLITE_API int sqlite3_backup_remaining(sqlite3_backup *p); |
| 7762 | +SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); |
| 7755 | 7763 | |
| 7756 | 7764 | /* |
| 7757 | 7765 | ** CAPI3REF: Unlock Notification |
| 7758 | 7766 | ** METHOD: sqlite3 |
| 7759 | 7767 | ** |
| | @@ -7866,11 +7874,11 @@ |
| 7866 | 7874 | ** by an sqlite3_step() call. ^(If there is a blocking connection, then the |
| 7867 | 7875 | ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in |
| 7868 | 7876 | ** the special "DROP TABLE/INDEX" case, the extended error code is just |
| 7869 | 7877 | ** SQLITE_LOCKED.)^ |
| 7870 | 7878 | */ |
| 7871 | | -SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify( |
| 7879 | +SQLITE_API int sqlite3_unlock_notify( |
| 7872 | 7880 | sqlite3 *pBlocked, /* Waiting connection */ |
| 7873 | 7881 | void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */ |
| 7874 | 7882 | void *pNotifyArg /* Argument to pass to xNotify */ |
| 7875 | 7883 | ); |
| 7876 | 7884 | |
| | @@ -7881,12 +7889,12 @@ |
| 7881 | 7889 | ** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications |
| 7882 | 7890 | ** and extensions to compare the contents of two buffers containing UTF-8 |
| 7883 | 7891 | ** strings in a case-independent fashion, using the same definition of "case |
| 7884 | 7892 | ** independence" that SQLite uses internally when comparing identifiers. |
| 7885 | 7893 | */ |
| 7886 | | -SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *, const char *); |
| 7887 | | -SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *, const char *, int); |
| 7894 | +SQLITE_API int sqlite3_stricmp(const char *, const char *); |
| 7895 | +SQLITE_API int sqlite3_strnicmp(const char *, const char *, int); |
| 7888 | 7896 | |
| 7889 | 7897 | /* |
| 7890 | 7898 | ** CAPI3REF: String Globbing |
| 7891 | 7899 | * |
| 7892 | 7900 | ** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if |
| | @@ -7899,11 +7907,11 @@ |
| 7899 | 7907 | ** Note that this routine returns zero on a match and non-zero if the strings |
| 7900 | 7908 | ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()]. |
| 7901 | 7909 | ** |
| 7902 | 7910 | ** See also: [sqlite3_strlike()]. |
| 7903 | 7911 | */ |
| 7904 | | -SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlob, const char *zStr); |
| 7912 | +SQLITE_API int sqlite3_strglob(const char *zGlob, const char *zStr); |
| 7905 | 7913 | |
| 7906 | 7914 | /* |
| 7907 | 7915 | ** CAPI3REF: String LIKE Matching |
| 7908 | 7916 | * |
| 7909 | 7917 | ** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if |
| | @@ -7922,11 +7930,11 @@ |
| 7922 | 7930 | ** Note that this routine returns zero on a match and non-zero if the strings |
| 7923 | 7931 | ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()]. |
| 7924 | 7932 | ** |
| 7925 | 7933 | ** See also: [sqlite3_strglob()]. |
| 7926 | 7934 | */ |
| 7927 | | -SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc); |
| 7935 | +SQLITE_API int sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc); |
| 7928 | 7936 | |
| 7929 | 7937 | /* |
| 7930 | 7938 | ** CAPI3REF: Error Logging Interface |
| 7931 | 7939 | ** |
| 7932 | 7940 | ** ^The [sqlite3_log()] interface writes a message into the [error log] |
| | @@ -7945,11 +7953,11 @@ |
| 7945 | 7953 | ** will not use dynamically allocated memory. The log message is stored in |
| 7946 | 7954 | ** a fixed-length buffer on the stack. If the log message is longer than |
| 7947 | 7955 | ** a few hundred characters, it will be truncated to the length of the |
| 7948 | 7956 | ** buffer. |
| 7949 | 7957 | */ |
| 7950 | | -SQLITE_API void SQLITE_CDECL sqlite3_log(int iErrCode, const char *zFormat, ...); |
| 7958 | +SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...); |
| 7951 | 7959 | |
| 7952 | 7960 | /* |
| 7953 | 7961 | ** CAPI3REF: Write-Ahead Log Commit Hook |
| 7954 | 7962 | ** METHOD: sqlite3 |
| 7955 | 7963 | ** |
| | @@ -7981,11 +7989,11 @@ |
| 7981 | 7989 | ** previously registered write-ahead log callback. ^Note that the |
| 7982 | 7990 | ** [sqlite3_wal_autocheckpoint()] interface and the |
| 7983 | 7991 | ** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will |
| 7984 | 7992 | ** overwrite any prior [sqlite3_wal_hook()] settings. |
| 7985 | 7993 | */ |
| 7986 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook( |
| 7994 | +SQLITE_API void *sqlite3_wal_hook( |
| 7987 | 7995 | sqlite3*, |
| 7988 | 7996 | int(*)(void *,sqlite3*,const char*,int), |
| 7989 | 7997 | void* |
| 7990 | 7998 | ); |
| 7991 | 7999 | |
| | @@ -8016,11 +8024,11 @@ |
| 8016 | 8024 | ** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT] |
| 8017 | 8025 | ** pages. The use of this interface |
| 8018 | 8026 | ** is only necessary if the default setting is found to be suboptimal |
| 8019 | 8027 | ** for a particular application. |
| 8020 | 8028 | */ |
| 8021 | | -SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N); |
| 8029 | +SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int N); |
| 8022 | 8030 | |
| 8023 | 8031 | /* |
| 8024 | 8032 | ** CAPI3REF: Checkpoint a database |
| 8025 | 8033 | ** METHOD: sqlite3 |
| 8026 | 8034 | ** |
| | @@ -8038,11 +8046,11 @@ |
| 8038 | 8046 | ** interface was added. This interface is retained for backwards |
| 8039 | 8047 | ** compatibility and as a convenience for applications that need to manually |
| 8040 | 8048 | ** start a callback but which do not need the full power (and corresponding |
| 8041 | 8049 | ** complication) of [sqlite3_wal_checkpoint_v2()]. |
| 8042 | 8050 | */ |
| 8043 | | -SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); |
| 8051 | +SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); |
| 8044 | 8052 | |
| 8045 | 8053 | /* |
| 8046 | 8054 | ** CAPI3REF: Checkpoint a database |
| 8047 | 8055 | ** METHOD: sqlite3 |
| 8048 | 8056 | ** |
| | @@ -8132,11 +8140,11 @@ |
| 8132 | 8140 | ** [sqlite3_errcode()] and [sqlite3_errmsg()]. |
| 8133 | 8141 | ** |
| 8134 | 8142 | ** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface |
| 8135 | 8143 | ** from SQL. |
| 8136 | 8144 | */ |
| 8137 | | -SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2( |
| 8145 | +SQLITE_API int sqlite3_wal_checkpoint_v2( |
| 8138 | 8146 | sqlite3 *db, /* Database handle */ |
| 8139 | 8147 | const char *zDb, /* Name of attached database (or NULL) */ |
| 8140 | 8148 | int eMode, /* SQLITE_CHECKPOINT_* value */ |
| 8141 | 8149 | int *pnLog, /* OUT: Size of WAL log in frames */ |
| 8142 | 8150 | int *pnCkpt /* OUT: Total number of frames checkpointed */ |
| | @@ -8168,11 +8176,11 @@ |
| 8168 | 8176 | ** |
| 8169 | 8177 | ** At present, there is only one option that may be configured using |
| 8170 | 8178 | ** this function. (See [SQLITE_VTAB_CONSTRAINT_SUPPORT].) Further options |
| 8171 | 8179 | ** may be added in the future. |
| 8172 | 8180 | */ |
| 8173 | | -SQLITE_API int SQLITE_CDECL sqlite3_vtab_config(sqlite3*, int op, ...); |
| 8181 | +SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); |
| 8174 | 8182 | |
| 8175 | 8183 | /* |
| 8176 | 8184 | ** CAPI3REF: Virtual Table Configuration Options |
| 8177 | 8185 | ** |
| 8178 | 8186 | ** These macros define the various options to the |
| | @@ -8221,11 +8229,11 @@ |
| 8221 | 8229 | ** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL], |
| 8222 | 8230 | ** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode |
| 8223 | 8231 | ** of the SQL statement that triggered the call to the [xUpdate] method of the |
| 8224 | 8232 | ** [virtual table]. |
| 8225 | 8233 | */ |
| 8226 | | -SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *); |
| 8234 | +SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *); |
| 8227 | 8235 | |
| 8228 | 8236 | /* |
| 8229 | 8237 | ** CAPI3REF: Conflict resolution modes |
| 8230 | 8238 | ** KEYWORDS: {conflict resolution mode} |
| 8231 | 8239 | ** |
| | @@ -8326,11 +8334,11 @@ |
| 8326 | 8334 | ** as if the loop did not exist - it returns non-zero and leave the variable |
| 8327 | 8335 | ** that pOut points to unchanged. |
| 8328 | 8336 | ** |
| 8329 | 8337 | ** See also: [sqlite3_stmt_scanstatus_reset()] |
| 8330 | 8338 | */ |
| 8331 | | -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus( |
| 8339 | +SQLITE_API int sqlite3_stmt_scanstatus( |
| 8332 | 8340 | sqlite3_stmt *pStmt, /* Prepared statement for which info desired */ |
| 8333 | 8341 | int idx, /* Index of loop to report on */ |
| 8334 | 8342 | int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */ |
| 8335 | 8343 | void *pOut /* Result written here */ |
| 8336 | 8344 | ); |
| | @@ -8342,11 +8350,11 @@ |
| 8342 | 8350 | ** ^Zero all [sqlite3_stmt_scanstatus()] related event counters. |
| 8343 | 8351 | ** |
| 8344 | 8352 | ** This API is only available if the library is built with pre-processor |
| 8345 | 8353 | ** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined. |
| 8346 | 8354 | */ |
| 8347 | | -SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*); |
| 8355 | +SQLITE_API void sqlite3_stmt_scanstatus_reset(sqlite3_stmt*); |
| 8348 | 8356 | |
| 8349 | 8357 | /* |
| 8350 | 8358 | ** CAPI3REF: Flush caches to disk mid-transaction |
| 8351 | 8359 | ** |
| 8352 | 8360 | ** ^If a write-transaction is open on [database connection] D when the |
| | @@ -8374,11 +8382,11 @@ |
| 8374 | 8382 | ** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK. |
| 8375 | 8383 | ** |
| 8376 | 8384 | ** ^This function does not set the database handle error code or message |
| 8377 | 8385 | ** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions. |
| 8378 | 8386 | */ |
| 8379 | | -SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3*); |
| 8387 | +SQLITE_API int sqlite3_db_cacheflush(sqlite3*); |
| 8380 | 8388 | |
| 8381 | 8389 | /* |
| 8382 | 8390 | ** CAPI3REF: The pre-update hook. |
| 8383 | 8391 | ** |
| 8384 | 8392 | ** ^These interfaces are only available if SQLite is compiled using the |
| | @@ -8454,11 +8462,11 @@ |
| 8454 | 8462 | ** triggers; or 2 for changes resulting from triggers called by top-level |
| 8455 | 8463 | ** triggers; and so forth. |
| 8456 | 8464 | ** |
| 8457 | 8465 | ** See also: [sqlite3_update_hook()] |
| 8458 | 8466 | */ |
| 8459 | | -SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_STDCALL sqlite3_preupdate_hook( |
| 8467 | +SQLITE_API SQLITE_EXPERIMENTAL void *sqlite3_preupdate_hook( |
| 8460 | 8468 | sqlite3 *db, |
| 8461 | 8469 | void(*xPreUpdate)( |
| 8462 | 8470 | void *pCtx, /* Copy of third arg to preupdate_hook() */ |
| 8463 | 8471 | sqlite3 *db, /* Database handle */ |
| 8464 | 8472 | int op, /* SQLITE_UPDATE, DELETE or INSERT */ |
| | @@ -8467,14 +8475,14 @@ |
| 8467 | 8475 | sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */ |
| 8468 | 8476 | sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */ |
| 8469 | 8477 | ), |
| 8470 | 8478 | void* |
| 8471 | 8479 | ); |
| 8472 | | -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **); |
| 8473 | | -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *); |
| 8474 | | -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *); |
| 8475 | | -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **); |
| 8480 | +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **); |
| 8481 | +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_preupdate_count(sqlite3 *); |
| 8482 | +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_preupdate_depth(sqlite3 *); |
| 8483 | +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **); |
| 8476 | 8484 | |
| 8477 | 8485 | /* |
| 8478 | 8486 | ** CAPI3REF: Low-level system error code |
| 8479 | 8487 | ** |
| 8480 | 8488 | ** ^Attempt to return the underlying operating system error code or error |
| | @@ -8482,11 +8490,11 @@ |
| 8482 | 8490 | ** The return value is OS-dependent. For example, on unix systems, after |
| 8483 | 8491 | ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be |
| 8484 | 8492 | ** called to get back the underlying "errno" that caused the problem, such |
| 8485 | 8493 | ** as ENOSPC, EAUTH, EISDIR, and so forth. |
| 8486 | 8494 | */ |
| 8487 | | -SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3*); |
| 8495 | +SQLITE_API int sqlite3_system_errno(sqlite3*); |
| 8488 | 8496 | |
| 8489 | 8497 | /* |
| 8490 | 8498 | ** CAPI3REF: Database Snapshot |
| 8491 | 8499 | ** KEYWORDS: {snapshot} |
| 8492 | 8500 | ** EXPERIMENTAL |
| | @@ -8532,11 +8540,11 @@ |
| 8532 | 8540 | ** to avoid a memory leak. |
| 8533 | 8541 | ** |
| 8534 | 8542 | ** The [sqlite3_snapshot_get()] interface is only available when the |
| 8535 | 8543 | ** SQLITE_ENABLE_SNAPSHOT compile-time option is used. |
| 8536 | 8544 | */ |
| 8537 | | -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_get( |
| 8545 | +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_get( |
| 8538 | 8546 | sqlite3 *db, |
| 8539 | 8547 | const char *zSchema, |
| 8540 | 8548 | sqlite3_snapshot **ppSnapshot |
| 8541 | 8549 | ); |
| 8542 | 8550 | |
| | @@ -8570,11 +8578,11 @@ |
| 8570 | 8578 | ** database connection in order to make it ready to use snapshots.) |
| 8571 | 8579 | ** |
| 8572 | 8580 | ** The [sqlite3_snapshot_open()] interface is only available when the |
| 8573 | 8581 | ** SQLITE_ENABLE_SNAPSHOT compile-time option is used. |
| 8574 | 8582 | */ |
| 8575 | | -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_open( |
| 8583 | +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_open( |
| 8576 | 8584 | sqlite3 *db, |
| 8577 | 8585 | const char *zSchema, |
| 8578 | 8586 | sqlite3_snapshot *pSnapshot |
| 8579 | 8587 | ); |
| 8580 | 8588 | |
| | @@ -8587,11 +8595,11 @@ |
| 8587 | 8595 | ** using this routine to avoid a memory leak. |
| 8588 | 8596 | ** |
| 8589 | 8597 | ** The [sqlite3_snapshot_free()] interface is only available when the |
| 8590 | 8598 | ** SQLITE_ENABLE_SNAPSHOT compile-time option is used. |
| 8591 | 8599 | */ |
| 8592 | | -SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot*); |
| 8600 | +SQLITE_API SQLITE_EXPERIMENTAL void sqlite3_snapshot_free(sqlite3_snapshot*); |
| 8593 | 8601 | |
| 8594 | 8602 | /* |
| 8595 | 8603 | ** CAPI3REF: Compare the ages of two snapshot handles. |
| 8596 | 8604 | ** EXPERIMENTAL |
| 8597 | 8605 | ** |
| | @@ -8611,11 +8619,11 @@ |
| 8611 | 8619 | ** |
| 8612 | 8620 | ** Otherwise, this API returns a negative value if P1 refers to an older |
| 8613 | 8621 | ** snapshot than P2, zero if the two handles refer to the same database |
| 8614 | 8622 | ** snapshot, and a positive value if P1 is a newer snapshot than P2. |
| 8615 | 8623 | */ |
| 8616 | | -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_cmp( |
| 8624 | +SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_cmp( |
| 8617 | 8625 | sqlite3_snapshot *p1, |
| 8618 | 8626 | sqlite3_snapshot *p2 |
| 8619 | 8627 | ); |
| 8620 | 8628 | |
| 8621 | 8629 | /* |
| | @@ -8669,11 +8677,11 @@ |
| 8669 | 8677 | ** Register a geometry callback named zGeom that can be used as part of an |
| 8670 | 8678 | ** R-Tree geometry query as follows: |
| 8671 | 8679 | ** |
| 8672 | 8680 | ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...) |
| 8673 | 8681 | */ |
| 8674 | | -SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback( |
| 8682 | +SQLITE_API int sqlite3_rtree_geometry_callback( |
| 8675 | 8683 | sqlite3 *db, |
| 8676 | 8684 | const char *zGeom, |
| 8677 | 8685 | int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*), |
| 8678 | 8686 | void *pContext |
| 8679 | 8687 | ); |
| | @@ -8695,11 +8703,11 @@ |
| 8695 | 8703 | ** Register a 2nd-generation geometry callback named zScore that can be |
| 8696 | 8704 | ** used as part of an R-Tree geometry query as follows: |
| 8697 | 8705 | ** |
| 8698 | 8706 | ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...) |
| 8699 | 8707 | */ |
| 8700 | | -SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback( |
| 8708 | +SQLITE_API int sqlite3_rtree_query_callback( |
| 8701 | 8709 | sqlite3 *db, |
| 8702 | 8710 | const char *zQueryFunc, |
| 8703 | 8711 | int (*xQueryFunc)(sqlite3_rtree_query_info*), |
| 8704 | 8712 | void *pContext, |
| 8705 | 8713 | void (*xDestructor)(void*) |
| | @@ -11916,12 +11924,12 @@ |
| 11916 | 11924 | */ |
| 11917 | 11925 | #ifdef SQLITE_OMIT_WSD |
| 11918 | 11926 | #define SQLITE_WSD const |
| 11919 | 11927 | #define GLOBAL(t,v) (*(t*)sqlite3_wsd_find((void*)&(v), sizeof(v))) |
| 11920 | 11928 | #define sqlite3GlobalConfig GLOBAL(struct Sqlite3Config, sqlite3Config) |
| 11921 | | -SQLITE_API int SQLITE_STDCALL sqlite3_wsd_init(int N, int J); |
| 11922 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_wsd_find(void *K, int L); |
| 11929 | +SQLITE_API int sqlite3_wsd_init(int N, int J); |
| 11930 | +SQLITE_API void *sqlite3_wsd_find(void *K, int L); |
| 11923 | 11931 | #else |
| 11924 | 11932 | #define SQLITE_WSD |
| 11925 | 11933 | #define GLOBAL(t,v) v |
| 11926 | 11934 | #define sqlite3GlobalConfig sqlite3Config |
| 11927 | 11935 | #endif |
| | @@ -12462,11 +12470,10 @@ |
| 12462 | 12470 | struct SubProgram { |
| 12463 | 12471 | VdbeOp *aOp; /* Array of opcodes for sub-program */ |
| 12464 | 12472 | int nOp; /* Elements in aOp[] */ |
| 12465 | 12473 | int nMem; /* Number of memory cells required */ |
| 12466 | 12474 | int nCsr; /* Number of cursors required */ |
| 12467 | | - int nOnce; /* Number of OP_Once instructions */ |
| 12468 | 12475 | void *token; /* id that may be used to recursive triggers */ |
| 12469 | 12476 | SubProgram *pNext; /* Next sub-program already visited */ |
| 12470 | 12477 | }; |
| 12471 | 12478 | |
| 12472 | 12479 | /* |
| | @@ -15514,11 +15521,10 @@ |
| 15514 | 15521 | int iRangeReg; /* First register in temporary register block */ |
| 15515 | 15522 | int nErr; /* Number of errors seen */ |
| 15516 | 15523 | int nTab; /* Number of previously allocated VDBE cursors */ |
| 15517 | 15524 | int nMem; /* Number of memory cells used so far */ |
| 15518 | 15525 | int nSet; /* Number of sets used so far */ |
| 15519 | | - int nOnce; /* Number of OP_Once instructions so far */ |
| 15520 | 15526 | int nOpAlloc; /* Number of slots allocated for Vdbe.aOp[] */ |
| 15521 | 15527 | int szOpAlloc; /* Bytes of memory space allocated for Vdbe.aOp[] */ |
| 15522 | 15528 | int iFixedOp; /* Never back out opcodes iFixedOp-1 or earlier */ |
| 15523 | 15529 | int ckBase; /* Base register of data during check constraints */ |
| 15524 | 15530 | int iSelfTab; /* Table of an index whose exprs are being coded */ |
| | @@ -15848,10 +15854,11 @@ |
| 15848 | 15854 | #endif |
| 15849 | 15855 | #ifndef SQLITE_OMIT_BUILTIN_TEST |
| 15850 | 15856 | int (*xTestCallback)(int); /* Invoked by sqlite3FaultSim() */ |
| 15851 | 15857 | #endif |
| 15852 | 15858 | int bLocaltimeFault; /* True to fail localtime() calls */ |
| 15859 | + int iOnceResetThreshold; /* When to reset OP_Once counters */ |
| 15853 | 15860 | }; |
| 15854 | 15861 | |
| 15855 | 15862 | /* |
| 15856 | 15863 | ** This macro is used inside of assert() statements to indicate that |
| 15857 | 15864 | ** the assert is only valid on a well-formed database. Instead of: |
| | @@ -16201,11 +16208,10 @@ |
| 16201 | 16208 | SQLITE_PRIVATE void sqlite3AddCollateType(Parse*, Token*); |
| 16202 | 16209 | SQLITE_PRIVATE void sqlite3EndTable(Parse*,Token*,Token*,u8,Select*); |
| 16203 | 16210 | SQLITE_PRIVATE int sqlite3ParseUri(const char*,const char*,unsigned int*, |
| 16204 | 16211 | sqlite3_vfs**,char**,char **); |
| 16205 | 16212 | SQLITE_PRIVATE Btree *sqlite3DbNameToBtree(sqlite3*,const char*); |
| 16206 | | -SQLITE_PRIVATE int sqlite3CodeOnce(Parse *); |
| 16207 | 16213 | |
| 16208 | 16214 | #ifdef SQLITE_OMIT_BUILTIN_TEST |
| 16209 | 16215 | # define sqlite3FaultSim(X) SQLITE_OK |
| 16210 | 16216 | #else |
| 16211 | 16217 | SQLITE_PRIVATE int sqlite3FaultSim(int); |
| | @@ -17129,11 +17135,12 @@ |
| 17129 | 17135 | 0, /* pVbeBranchArg */ |
| 17130 | 17136 | #endif |
| 17131 | 17137 | #ifndef SQLITE_OMIT_BUILTIN_TEST |
| 17132 | 17138 | 0, /* xTestCallback */ |
| 17133 | 17139 | #endif |
| 17134 | | - 0 /* bLocaltimeFault */ |
| 17140 | + 0, /* bLocaltimeFault */ |
| 17141 | + 0x7ffffffe /* iOnceResetThreshold */ |
| 17135 | 17142 | }; |
| 17136 | 17143 | |
| 17137 | 17144 | /* |
| 17138 | 17145 | ** Hash table for global functions - functions common to all |
| 17139 | 17146 | ** database connections. After initialization, this table is |
| | @@ -17601,11 +17608,11 @@ |
| 17601 | 17608 | ** was used and false if not. |
| 17602 | 17609 | ** |
| 17603 | 17610 | ** The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix |
| 17604 | 17611 | ** is not required for a match. |
| 17605 | 17612 | */ |
| 17606 | | -SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName){ |
| 17613 | +SQLITE_API int sqlite3_compileoption_used(const char *zOptName){ |
| 17607 | 17614 | int i, n; |
| 17608 | 17615 | |
| 17609 | 17616 | #if SQLITE_ENABLE_API_ARMOR |
| 17610 | 17617 | if( zOptName==0 ){ |
| 17611 | 17618 | (void)SQLITE_MISUSE_BKPT; |
| | @@ -17629,11 +17636,11 @@ |
| 17629 | 17636 | |
| 17630 | 17637 | /* |
| 17631 | 17638 | ** Return the N-th compile-time option string. If N is out of range, |
| 17632 | 17639 | ** return a NULL pointer. |
| 17633 | 17640 | */ |
| 17634 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N){ |
| 17641 | +SQLITE_API const char *sqlite3_compileoption_get(int N){ |
| 17635 | 17642 | if( N>=0 && N<ArraySize(azCompileOpt) ){ |
| 17636 | 17643 | return azCompileOpt[N]; |
| 17637 | 17644 | } |
| 17638 | 17645 | return 0; |
| 17639 | 17646 | } |
| | @@ -17817,20 +17824,18 @@ |
| 17817 | 17824 | Vdbe *v; /* VM this frame belongs to */ |
| 17818 | 17825 | VdbeFrame *pParent; /* Parent of this frame, or NULL if parent is main */ |
| 17819 | 17826 | Op *aOp; /* Program instructions for parent frame */ |
| 17820 | 17827 | i64 *anExec; /* Event counters from parent frame */ |
| 17821 | 17828 | Mem *aMem; /* Array of memory cells for parent frame */ |
| 17822 | | - u8 *aOnceFlag; /* Array of OP_Once flags for parent frame */ |
| 17823 | 17829 | VdbeCursor **apCsr; /* Array of Vdbe cursors for parent frame */ |
| 17824 | 17830 | void *token; /* Copy of SubProgram.token */ |
| 17825 | 17831 | i64 lastRowid; /* Last insert rowid (sqlite3.lastRowid) */ |
| 17826 | 17832 | AuxData *pAuxData; /* Linked list of auxdata allocations */ |
| 17827 | 17833 | int nCursor; /* Number of entries in apCsr */ |
| 17828 | 17834 | int pc; /* Program Counter in parent (calling) frame */ |
| 17829 | 17835 | int nOp; /* Size of aOp array */ |
| 17830 | 17836 | int nMem; /* Number of entries in aMem */ |
| 17831 | | - int nOnceFlag; /* Number of entries in aOnceFlag */ |
| 17832 | 17837 | int nChildMem; /* Number of memory cells for child frame */ |
| 17833 | 17838 | int nChildCsr; /* Number of cursors for child frame */ |
| 17834 | 17839 | int nChange; /* Statement changes (Vdbe.nChange) */ |
| 17835 | 17840 | int nDbChange; /* Value of db->nChange */ |
| 17836 | 17841 | }; |
| | @@ -18070,12 +18075,10 @@ |
| 18070 | 18075 | VdbeFrame *pFrame; /* Parent frame */ |
| 18071 | 18076 | VdbeFrame *pDelFrame; /* List of frame objects to free on VM reset */ |
| 18072 | 18077 | int nFrame; /* Number of frames in pFrame list */ |
| 18073 | 18078 | u32 expmask; /* Binding to these vars invalidates VM */ |
| 18074 | 18079 | SubProgram *pProgram; /* Linked list of all sub-programs used by VM */ |
| 18075 | | - int nOnceFlag; /* Size of array aOnceFlag[] */ |
| 18076 | | - u8 *aOnceFlag; /* Flags for OP_Once */ |
| 18077 | 18080 | AuxData *pAuxData; /* Linked list of auxdata allocations */ |
| 18078 | 18081 | #ifdef SQLITE_ENABLE_STMT_SCANSTATUS |
| 18079 | 18082 | i64 *anExec; /* Number of times each op has been executed */ |
| 18080 | 18083 | int nScan; /* Entries in aScan[] */ |
| 18081 | 18084 | ScanStatus *aScan; /* Scan definitions for sqlite3_stmt_scanstatus() */ |
| | @@ -18339,11 +18342,11 @@ |
| 18339 | 18342 | } |
| 18340 | 18343 | |
| 18341 | 18344 | /* |
| 18342 | 18345 | ** Query status information. |
| 18343 | 18346 | */ |
| 18344 | | -SQLITE_API int SQLITE_STDCALL sqlite3_status64( |
| 18347 | +SQLITE_API int sqlite3_status64( |
| 18345 | 18348 | int op, |
| 18346 | 18349 | sqlite3_int64 *pCurrent, |
| 18347 | 18350 | sqlite3_int64 *pHighwater, |
| 18348 | 18351 | int resetFlag |
| 18349 | 18352 | ){ |
| | @@ -18364,11 +18367,11 @@ |
| 18364 | 18367 | } |
| 18365 | 18368 | sqlite3_mutex_leave(pMutex); |
| 18366 | 18369 | (void)pMutex; /* Prevent warning when SQLITE_THREADSAFE=0 */ |
| 18367 | 18370 | return SQLITE_OK; |
| 18368 | 18371 | } |
| 18369 | | -SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){ |
| 18372 | +SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){ |
| 18370 | 18373 | sqlite3_int64 iCur = 0, iHwtr = 0; |
| 18371 | 18374 | int rc; |
| 18372 | 18375 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 18373 | 18376 | if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT; |
| 18374 | 18377 | #endif |
| | @@ -18381,11 +18384,11 @@ |
| 18381 | 18384 | } |
| 18382 | 18385 | |
| 18383 | 18386 | /* |
| 18384 | 18387 | ** Query status information for a single database connection |
| 18385 | 18388 | */ |
| 18386 | | -SQLITE_API int SQLITE_STDCALL sqlite3_db_status( |
| 18389 | +SQLITE_API int sqlite3_db_status( |
| 18387 | 18390 | sqlite3 *db, /* The database connection whose status is desired */ |
| 18388 | 18391 | int op, /* Status verb */ |
| 18389 | 18392 | int *pCurrent, /* Write current value here */ |
| 18390 | 18393 | int *pHighwater, /* Write high-water mark here */ |
| 18391 | 18394 | int resetFlag /* Reset high-water mark if true */ |
| | @@ -20058,11 +20061,11 @@ |
| 20058 | 20061 | |
| 20059 | 20062 | /* |
| 20060 | 20063 | ** Locate a VFS by name. If no name is given, simply return the |
| 20061 | 20064 | ** first VFS on the list. |
| 20062 | 20065 | */ |
| 20063 | | -SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfs){ |
| 20066 | +SQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfs){ |
| 20064 | 20067 | sqlite3_vfs *pVfs = 0; |
| 20065 | 20068 | #if SQLITE_THREADSAFE |
| 20066 | 20069 | sqlite3_mutex *mutex; |
| 20067 | 20070 | #endif |
| 20068 | 20071 | #ifndef SQLITE_OMIT_AUTOINIT |
| | @@ -20104,11 +20107,11 @@ |
| 20104 | 20107 | /* |
| 20105 | 20108 | ** Register a VFS with the system. It is harmless to register the same |
| 20106 | 20109 | ** VFS multiple times. The new VFS becomes the default if makeDflt is |
| 20107 | 20110 | ** true. |
| 20108 | 20111 | */ |
| 20109 | | -SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){ |
| 20112 | +SQLITE_API int sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){ |
| 20110 | 20113 | MUTEX_LOGIC(sqlite3_mutex *mutex;) |
| 20111 | 20114 | #ifndef SQLITE_OMIT_AUTOINIT |
| 20112 | 20115 | int rc = sqlite3_initialize(); |
| 20113 | 20116 | if( rc ) return rc; |
| 20114 | 20117 | #endif |
| | @@ -20132,11 +20135,11 @@ |
| 20132 | 20135 | } |
| 20133 | 20136 | |
| 20134 | 20137 | /* |
| 20135 | 20138 | ** Unregister a VFS so that it is no longer accessible. |
| 20136 | 20139 | */ |
| 20137 | | -SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs *pVfs){ |
| 20140 | +SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs *pVfs){ |
| 20138 | 20141 | #if SQLITE_THREADSAFE |
| 20139 | 20142 | sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); |
| 20140 | 20143 | #endif |
| 20141 | 20144 | sqlite3_mutex_enter(mutex); |
| 20142 | 20145 | vfsUnlink(pVfs); |
| | @@ -22483,11 +22486,11 @@ |
| 22483 | 22486 | } |
| 22484 | 22487 | |
| 22485 | 22488 | /* |
| 22486 | 22489 | ** Retrieve a pointer to a static mutex or allocate a new dynamic one. |
| 22487 | 22490 | */ |
| 22488 | | -SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int id){ |
| 22491 | +SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int id){ |
| 22489 | 22492 | #ifndef SQLITE_OMIT_AUTOINIT |
| 22490 | 22493 | if( id<=SQLITE_MUTEX_RECURSIVE && sqlite3_initialize() ) return 0; |
| 22491 | 22494 | if( id>SQLITE_MUTEX_RECURSIVE && sqlite3MutexInit() ) return 0; |
| 22492 | 22495 | #endif |
| 22493 | 22496 | assert( sqlite3GlobalConfig.mutex.xMutexAlloc ); |
| | @@ -22504,11 +22507,11 @@ |
| 22504 | 22507 | } |
| 22505 | 22508 | |
| 22506 | 22509 | /* |
| 22507 | 22510 | ** Free a dynamic mutex. |
| 22508 | 22511 | */ |
| 22509 | | -SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex *p){ |
| 22512 | +SQLITE_API void sqlite3_mutex_free(sqlite3_mutex *p){ |
| 22510 | 22513 | if( p ){ |
| 22511 | 22514 | assert( sqlite3GlobalConfig.mutex.xMutexFree ); |
| 22512 | 22515 | sqlite3GlobalConfig.mutex.xMutexFree(p); |
| 22513 | 22516 | } |
| 22514 | 22517 | } |
| | @@ -22515,11 +22518,11 @@ |
| 22515 | 22518 | |
| 22516 | 22519 | /* |
| 22517 | 22520 | ** Obtain the mutex p. If some other thread already has the mutex, block |
| 22518 | 22521 | ** until it can be obtained. |
| 22519 | 22522 | */ |
| 22520 | | -SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex *p){ |
| 22523 | +SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex *p){ |
| 22521 | 22524 | if( p ){ |
| 22522 | 22525 | assert( sqlite3GlobalConfig.mutex.xMutexEnter ); |
| 22523 | 22526 | sqlite3GlobalConfig.mutex.xMutexEnter(p); |
| 22524 | 22527 | } |
| 22525 | 22528 | } |
| | @@ -22526,11 +22529,11 @@ |
| 22526 | 22529 | |
| 22527 | 22530 | /* |
| 22528 | 22531 | ** Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another |
| 22529 | 22532 | ** thread holds the mutex and it cannot be obtained, return SQLITE_BUSY. |
| 22530 | 22533 | */ |
| 22531 | | -SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex *p){ |
| 22534 | +SQLITE_API int sqlite3_mutex_try(sqlite3_mutex *p){ |
| 22532 | 22535 | int rc = SQLITE_OK; |
| 22533 | 22536 | if( p ){ |
| 22534 | 22537 | assert( sqlite3GlobalConfig.mutex.xMutexTry ); |
| 22535 | 22538 | return sqlite3GlobalConfig.mutex.xMutexTry(p); |
| 22536 | 22539 | } |
| | @@ -22541,11 +22544,11 @@ |
| 22541 | 22544 | ** The sqlite3_mutex_leave() routine exits a mutex that was previously |
| 22542 | 22545 | ** entered by the same thread. The behavior is undefined if the mutex |
| 22543 | 22546 | ** is not currently entered. If a NULL pointer is passed as an argument |
| 22544 | 22547 | ** this function is a no-op. |
| 22545 | 22548 | */ |
| 22546 | | -SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex *p){ |
| 22549 | +SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex *p){ |
| 22547 | 22550 | if( p ){ |
| 22548 | 22551 | assert( sqlite3GlobalConfig.mutex.xMutexLeave ); |
| 22549 | 22552 | sqlite3GlobalConfig.mutex.xMutexLeave(p); |
| 22550 | 22553 | } |
| 22551 | 22554 | } |
| | @@ -22553,15 +22556,15 @@ |
| 22553 | 22556 | #ifndef NDEBUG |
| 22554 | 22557 | /* |
| 22555 | 22558 | ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are |
| 22556 | 22559 | ** intended for use inside assert() statements. |
| 22557 | 22560 | */ |
| 22558 | | -SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex *p){ |
| 22561 | +SQLITE_API int sqlite3_mutex_held(sqlite3_mutex *p){ |
| 22559 | 22562 | assert( p==0 || sqlite3GlobalConfig.mutex.xMutexHeld ); |
| 22560 | 22563 | return p==0 || sqlite3GlobalConfig.mutex.xMutexHeld(p); |
| 22561 | 22564 | } |
| 22562 | | -SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex *p){ |
| 22565 | +SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex *p){ |
| 22563 | 22566 | assert( p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld ); |
| 22564 | 22567 | return p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld(p); |
| 22565 | 22568 | } |
| 22566 | 22569 | #endif |
| 22567 | 22570 | |
| | @@ -23589,12 +23592,12 @@ |
| 23589 | 23592 | ** of the sqlite3_initialize() and sqlite3_shutdown() processing, the |
| 23590 | 23593 | ** "interlocked" magic used here is probably not strictly necessary. |
| 23591 | 23594 | */ |
| 23592 | 23595 | static LONG SQLITE_WIN32_VOLATILE winMutex_lock = 0; |
| 23593 | 23596 | |
| 23594 | | -SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void); /* os_win.c */ |
| 23595 | | -SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */ |
| 23597 | +SQLITE_API int sqlite3_win32_is_nt(void); /* os_win.c */ |
| 23598 | +SQLITE_API void sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */ |
| 23596 | 23599 | |
| 23597 | 23600 | static int winMutexInit(void){ |
| 23598 | 23601 | /* The first to increment to 1 does actual initialization */ |
| 23599 | 23602 | if( InterlockedCompareExchange(&winMutex_lock, 1, 0)==0 ){ |
| 23600 | 23603 | int i; |
| | @@ -23890,11 +23893,11 @@ |
| 23890 | 23893 | /* |
| 23891 | 23894 | ** Attempt to release up to n bytes of non-essential memory currently |
| 23892 | 23895 | ** held by SQLite. An example of non-essential memory is memory used to |
| 23893 | 23896 | ** cache database pages that are not currently in use. |
| 23894 | 23897 | */ |
| 23895 | | -SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int n){ |
| 23898 | +SQLITE_API int sqlite3_release_memory(int n){ |
| 23896 | 23899 | #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT |
| 23897 | 23900 | return sqlite3PcacheReleaseMemory(n); |
| 23898 | 23901 | #else |
| 23899 | 23902 | /* IMPLEMENTATION-OF: R-34391-24921 The sqlite3_release_memory() routine |
| 23900 | 23903 | ** is a no-op returning zero if SQLite is not compiled with |
| | @@ -23949,11 +23952,11 @@ |
| 23949 | 23952 | /* |
| 23950 | 23953 | ** Deprecated external interface. It used to set an alarm callback |
| 23951 | 23954 | ** that was invoked when memory usage grew too large. Now it is a |
| 23952 | 23955 | ** no-op. |
| 23953 | 23956 | */ |
| 23954 | | -SQLITE_API int SQLITE_STDCALL sqlite3_memory_alarm( |
| 23957 | +SQLITE_API int sqlite3_memory_alarm( |
| 23955 | 23958 | void(*xCallback)(void *pArg, sqlite3_int64 used,int N), |
| 23956 | 23959 | void *pArg, |
| 23957 | 23960 | sqlite3_int64 iThreshold |
| 23958 | 23961 | ){ |
| 23959 | 23962 | (void)xCallback; |
| | @@ -23965,11 +23968,11 @@ |
| 23965 | 23968 | |
| 23966 | 23969 | /* |
| 23967 | 23970 | ** Set the soft heap-size limit for the library. Passing a zero or |
| 23968 | 23971 | ** negative value indicates no limit. |
| 23969 | 23972 | */ |
| 23970 | | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 n){ |
| 23973 | +SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 n){ |
| 23971 | 23974 | sqlite3_int64 priorLimit; |
| 23972 | 23975 | sqlite3_int64 excess; |
| 23973 | 23976 | sqlite3_int64 nUsed; |
| 23974 | 23977 | #ifndef SQLITE_OMIT_AUTOINIT |
| 23975 | 23978 | int rc = sqlite3_initialize(); |
| | @@ -23987,11 +23990,11 @@ |
| 23987 | 23990 | sqlite3_mutex_leave(mem0.mutex); |
| 23988 | 23991 | excess = sqlite3_memory_used() - n; |
| 23989 | 23992 | if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff)); |
| 23990 | 23993 | return priorLimit; |
| 23991 | 23994 | } |
| 23992 | | -SQLITE_API void SQLITE_STDCALL sqlite3_soft_heap_limit(int n){ |
| 23995 | +SQLITE_API void sqlite3_soft_heap_limit(int n){ |
| 23993 | 23996 | if( n<0 ) n = 0; |
| 23994 | 23997 | sqlite3_soft_heap_limit64(n); |
| 23995 | 23998 | } |
| 23996 | 23999 | |
| 23997 | 24000 | /* |
| | @@ -24056,11 +24059,11 @@ |
| 24056 | 24059 | } |
| 24057 | 24060 | |
| 24058 | 24061 | /* |
| 24059 | 24062 | ** Return the amount of memory currently checked out. |
| 24060 | 24063 | */ |
| 24061 | | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void){ |
| 24064 | +SQLITE_API sqlite3_int64 sqlite3_memory_used(void){ |
| 24062 | 24065 | sqlite3_int64 res, mx; |
| 24063 | 24066 | sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, 0); |
| 24064 | 24067 | return res; |
| 24065 | 24068 | } |
| 24066 | 24069 | |
| | @@ -24067,11 +24070,11 @@ |
| 24067 | 24070 | /* |
| 24068 | 24071 | ** Return the maximum amount of memory that has ever been |
| 24069 | 24072 | ** checked out since either the beginning of this process |
| 24070 | 24073 | ** or since the most recent reset. |
| 24071 | 24074 | */ |
| 24072 | | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag){ |
| 24075 | +SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag){ |
| 24073 | 24076 | sqlite3_int64 res, mx; |
| 24074 | 24077 | sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, resetFlag); |
| 24075 | 24078 | return mx; |
| 24076 | 24079 | } |
| 24077 | 24080 | |
| | @@ -24147,17 +24150,17 @@ |
| 24147 | 24150 | /* |
| 24148 | 24151 | ** This version of the memory allocation is for use by the application. |
| 24149 | 24152 | ** First make sure the memory subsystem is initialized, then do the |
| 24150 | 24153 | ** allocation. |
| 24151 | 24154 | */ |
| 24152 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int n){ |
| 24155 | +SQLITE_API void *sqlite3_malloc(int n){ |
| 24153 | 24156 | #ifndef SQLITE_OMIT_AUTOINIT |
| 24154 | 24157 | if( sqlite3_initialize() ) return 0; |
| 24155 | 24158 | #endif |
| 24156 | 24159 | return n<=0 ? 0 : sqlite3Malloc(n); |
| 24157 | 24160 | } |
| 24158 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64 n){ |
| 24161 | +SQLITE_API void *sqlite3_malloc64(sqlite3_uint64 n){ |
| 24159 | 24162 | #ifndef SQLITE_OMIT_AUTOINIT |
| 24160 | 24163 | if( sqlite3_initialize() ) return 0; |
| 24161 | 24164 | #endif |
| 24162 | 24165 | return sqlite3Malloc(n); |
| 24163 | 24166 | } |
| | @@ -24296,20 +24299,20 @@ |
| 24296 | 24299 | }else{ |
| 24297 | 24300 | assert( sqlite3_mutex_held(db->mutex) ); |
| 24298 | 24301 | return db->lookaside.sz; |
| 24299 | 24302 | } |
| 24300 | 24303 | } |
| 24301 | | -SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void *p){ |
| 24304 | +SQLITE_API sqlite3_uint64 sqlite3_msize(void *p){ |
| 24302 | 24305 | assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) ); |
| 24303 | 24306 | assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) ); |
| 24304 | 24307 | return p ? sqlite3GlobalConfig.m.xSize(p) : 0; |
| 24305 | 24308 | } |
| 24306 | 24309 | |
| 24307 | 24310 | /* |
| 24308 | 24311 | ** Free memory previously obtained from sqlite3Malloc(). |
| 24309 | 24312 | */ |
| 24310 | | -SQLITE_API void SQLITE_STDCALL sqlite3_free(void *p){ |
| 24313 | +SQLITE_API void sqlite3_free(void *p){ |
| 24311 | 24314 | if( p==0 ) return; /* IMP: R-49053-54554 */ |
| 24312 | 24315 | assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) ); |
| 24313 | 24316 | assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) ); |
| 24314 | 24317 | if( sqlite3GlobalConfig.bMemstat ){ |
| 24315 | 24318 | sqlite3_mutex_enter(mem0.mutex); |
| | @@ -24414,18 +24417,18 @@ |
| 24414 | 24417 | |
| 24415 | 24418 | /* |
| 24416 | 24419 | ** The public interface to sqlite3Realloc. Make sure that the memory |
| 24417 | 24420 | ** subsystem is initialized prior to invoking sqliteRealloc. |
| 24418 | 24421 | */ |
| 24419 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void *pOld, int n){ |
| 24422 | +SQLITE_API void *sqlite3_realloc(void *pOld, int n){ |
| 24420 | 24423 | #ifndef SQLITE_OMIT_AUTOINIT |
| 24421 | 24424 | if( sqlite3_initialize() ) return 0; |
| 24422 | 24425 | #endif |
| 24423 | 24426 | if( n<0 ) n = 0; /* IMP: R-26507-47431 */ |
| 24424 | 24427 | return sqlite3Realloc(pOld, n); |
| 24425 | 24428 | } |
| 24426 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void *pOld, sqlite3_uint64 n){ |
| 24429 | +SQLITE_API void *sqlite3_realloc64(void *pOld, sqlite3_uint64 n){ |
| 24427 | 24430 | #ifndef SQLITE_OMIT_AUTOINIT |
| 24428 | 24431 | if( sqlite3_initialize() ) return 0; |
| 24429 | 24432 | #endif |
| 24430 | 24433 | return sqlite3Realloc(pOld, n); |
| 24431 | 24434 | } |
| | @@ -25648,11 +25651,11 @@ |
| 25648 | 25651 | |
| 25649 | 25652 | /* |
| 25650 | 25653 | ** Print into memory obtained from sqlite3_malloc(). Omit the internal |
| 25651 | 25654 | ** %-conversion extensions. |
| 25652 | 25655 | */ |
| 25653 | | -SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char *zFormat, va_list ap){ |
| 25656 | +SQLITE_API char *sqlite3_vmprintf(const char *zFormat, va_list ap){ |
| 25654 | 25657 | char *z; |
| 25655 | 25658 | char zBase[SQLITE_PRINT_BUF_SIZE]; |
| 25656 | 25659 | StrAccum acc; |
| 25657 | 25660 | |
| 25658 | 25661 | #ifdef SQLITE_ENABLE_API_ARMOR |
| | @@ -25672,11 +25675,11 @@ |
| 25672 | 25675 | |
| 25673 | 25676 | /* |
| 25674 | 25677 | ** Print into memory obtained from sqlite3_malloc()(). Omit the internal |
| 25675 | 25678 | ** %-conversion extensions. |
| 25676 | 25679 | */ |
| 25677 | | -SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char *zFormat, ...){ |
| 25680 | +SQLITE_API char *sqlite3_mprintf(const char *zFormat, ...){ |
| 25678 | 25681 | va_list ap; |
| 25679 | 25682 | char *z; |
| 25680 | 25683 | #ifndef SQLITE_OMIT_AUTOINIT |
| 25681 | 25684 | if( sqlite3_initialize() ) return 0; |
| 25682 | 25685 | #endif |
| | @@ -25697,11 +25700,11 @@ |
| 25697 | 25700 | ** this without breaking compatibility, so we just have to live with the |
| 25698 | 25701 | ** mistake. |
| 25699 | 25702 | ** |
| 25700 | 25703 | ** sqlite3_vsnprintf() is the varargs version. |
| 25701 | 25704 | */ |
| 25702 | | -SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int n, char *zBuf, const char *zFormat, va_list ap){ |
| 25705 | +SQLITE_API char *sqlite3_vsnprintf(int n, char *zBuf, const char *zFormat, va_list ap){ |
| 25703 | 25706 | StrAccum acc; |
| 25704 | 25707 | if( n<=0 ) return zBuf; |
| 25705 | 25708 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 25706 | 25709 | if( zBuf==0 || zFormat==0 ) { |
| 25707 | 25710 | (void)SQLITE_MISUSE_BKPT; |
| | @@ -25711,11 +25714,11 @@ |
| 25711 | 25714 | #endif |
| 25712 | 25715 | sqlite3StrAccumInit(&acc, 0, zBuf, n, 0); |
| 25713 | 25716 | sqlite3VXPrintf(&acc, zFormat, ap); |
| 25714 | 25717 | return sqlite3StrAccumFinish(&acc); |
| 25715 | 25718 | } |
| 25716 | | -SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){ |
| 25719 | +SQLITE_API char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){ |
| 25717 | 25720 | char *z; |
| 25718 | 25721 | va_list ap; |
| 25719 | 25722 | va_start(ap,zFormat); |
| 25720 | 25723 | z = sqlite3_vsnprintf(n, zBuf, zFormat, ap); |
| 25721 | 25724 | va_end(ap); |
| | @@ -25747,11 +25750,11 @@ |
| 25747 | 25750 | } |
| 25748 | 25751 | |
| 25749 | 25752 | /* |
| 25750 | 25753 | ** Format and write a message to the log if logging is enabled. |
| 25751 | 25754 | */ |
| 25752 | | -SQLITE_API void SQLITE_CDECL sqlite3_log(int iErrCode, const char *zFormat, ...){ |
| 25755 | +SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...){ |
| 25753 | 25756 | va_list ap; /* Vararg list */ |
| 25754 | 25757 | if( sqlite3GlobalConfig.xLog ){ |
| 25755 | 25758 | va_start(ap, zFormat); |
| 25756 | 25759 | renderLogMsg(iErrCode, zFormat, ap); |
| 25757 | 25760 | va_end(ap); |
| | @@ -26341,11 +26344,11 @@ |
| 26341 | 26344 | } sqlite3Prng; |
| 26342 | 26345 | |
| 26343 | 26346 | /* |
| 26344 | 26347 | ** Return N random bytes. |
| 26345 | 26348 | */ |
| 26346 | | -SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *pBuf){ |
| 26349 | +SQLITE_API void sqlite3_randomness(int N, void *pBuf){ |
| 26347 | 26350 | unsigned char t; |
| 26348 | 26351 | unsigned char *zBuf = pBuf; |
| 26349 | 26352 | |
| 26350 | 26353 | /* The "wsdPrng" macro will resolve to the pseudo-random number generator |
| 26351 | 26354 | ** state vector. If writable static data is unsupported on the target, |
| | @@ -27544,11 +27547,11 @@ |
| 27544 | 27547 | ** sqlite3_strnicmp() APIs allow applications and extensions to compare |
| 27545 | 27548 | ** the contents of two buffers containing UTF-8 strings in a |
| 27546 | 27549 | ** case-independent fashion, using the same definition of "case |
| 27547 | 27550 | ** independence" that SQLite uses internally when comparing identifiers. |
| 27548 | 27551 | */ |
| 27549 | | -SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *zLeft, const char *zRight){ |
| 27552 | +SQLITE_API int sqlite3_stricmp(const char *zLeft, const char *zRight){ |
| 27550 | 27553 | if( zLeft==0 ){ |
| 27551 | 27554 | return zRight ? -1 : 0; |
| 27552 | 27555 | }else if( zRight==0 ){ |
| 27553 | 27556 | return 1; |
| 27554 | 27557 | } |
| | @@ -27565,11 +27568,11 @@ |
| 27565 | 27568 | a++; |
| 27566 | 27569 | b++; |
| 27567 | 27570 | } |
| 27568 | 27571 | return c; |
| 27569 | 27572 | } |
| 27570 | | -SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){ |
| 27573 | +SQLITE_API int sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){ |
| 27571 | 27574 | register unsigned char *a, *b; |
| 27572 | 27575 | if( zLeft==0 ){ |
| 27573 | 27576 | return zRight ? -1 : 0; |
| 27574 | 27577 | }else if( zRight==0 ){ |
| 27575 | 27578 | return 1; |
| | @@ -28563,40 +28566,25 @@ |
| 28563 | 28566 | return 0; |
| 28564 | 28567 | }else{ |
| 28565 | 28568 | return sqlite3AddInt64(pA, -iB); |
| 28566 | 28569 | } |
| 28567 | 28570 | } |
| 28568 | | -#define TWOPOWER32 (((i64)1)<<32) |
| 28569 | | -#define TWOPOWER31 (((i64)1)<<31) |
| 28570 | 28571 | SQLITE_PRIVATE int sqlite3MulInt64(i64 *pA, i64 iB){ |
| 28571 | 28572 | i64 iA = *pA; |
| 28572 | | - i64 iA1, iA0, iB1, iB0, r; |
| 28573 | | - |
| 28574 | | - iA1 = iA/TWOPOWER32; |
| 28575 | | - iA0 = iA % TWOPOWER32; |
| 28576 | | - iB1 = iB/TWOPOWER32; |
| 28577 | | - iB0 = iB % TWOPOWER32; |
| 28578 | | - if( iA1==0 ){ |
| 28579 | | - if( iB1==0 ){ |
| 28580 | | - *pA *= iB; |
| 28581 | | - return 0; |
| 28582 | | - } |
| 28583 | | - r = iA0*iB1; |
| 28584 | | - }else if( iB1==0 ){ |
| 28585 | | - r = iA1*iB0; |
| 28586 | | - }else{ |
| 28587 | | - /* If both iA1 and iB1 are non-zero, overflow will result */ |
| 28588 | | - return 1; |
| 28589 | | - } |
| 28590 | | - testcase( r==(-TWOPOWER31)-1 ); |
| 28591 | | - testcase( r==(-TWOPOWER31) ); |
| 28592 | | - testcase( r==TWOPOWER31 ); |
| 28593 | | - testcase( r==TWOPOWER31-1 ); |
| 28594 | | - if( r<(-TWOPOWER31) || r>=TWOPOWER31 ) return 1; |
| 28595 | | - r *= TWOPOWER32; |
| 28596 | | - if( sqlite3AddInt64(&r, iA0*iB0) ) return 1; |
| 28597 | | - *pA = r; |
| 28573 | + if( iB>0 ){ |
| 28574 | + if( iA>LARGEST_INT64/iB ) return 1; |
| 28575 | + if( iA<SMALLEST_INT64/iB ) return 1; |
| 28576 | + }else if( iB<0 ){ |
| 28577 | + if( iA>0 ){ |
| 28578 | + if( iB<SMALLEST_INT64/iA ) return 1; |
| 28579 | + }else if( iA<0 ){ |
| 28580 | + if( iB==SMALLEST_INT64 ) return 1; |
| 28581 | + if( iA==SMALLEST_INT64 ) return 1; |
| 28582 | + if( -iA>LARGEST_INT64/-iB ) return 1; |
| 28583 | + } |
| 28584 | + } |
| 28585 | + *pA = iA*iB; |
| 28598 | 28586 | return 0; |
| 28599 | 28587 | } |
| 28600 | 28588 | |
| 28601 | 28589 | /* |
| 28602 | 28590 | ** Compute the absolute value of a 32-bit signed integer, of possible. Or |
| | @@ -36888,11 +36876,11 @@ |
| 36888 | 36876 | ** This routine is called once during SQLite initialization and by a |
| 36889 | 36877 | ** single thread. The memory allocation and mutex subsystems have not |
| 36890 | 36878 | ** necessarily been initialized when this routine is called, and so they |
| 36891 | 36879 | ** should not be used. |
| 36892 | 36880 | */ |
| 36893 | | -SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void){ |
| 36881 | +SQLITE_API int sqlite3_os_init(void){ |
| 36894 | 36882 | /* |
| 36895 | 36883 | ** The following macro defines an initializer for an sqlite3_vfs object. |
| 36896 | 36884 | ** The name of the VFS is NAME. The pAppData is a pointer to a pointer |
| 36897 | 36885 | ** to the "finder" function. (pAppData is a pointer to a pointer because |
| 36898 | 36886 | ** silly C90 rules prohibit a void* from being cast to a function pointer |
| | @@ -36987,11 +36975,11 @@ |
| 36987 | 36975 | ** |
| 36988 | 36976 | ** Some operating systems might need to do some cleanup in this routine, |
| 36989 | 36977 | ** to release dynamically allocated objects. But not on unix. |
| 36990 | 36978 | ** This routine is a no-op for unix. |
| 36991 | 36979 | */ |
| 36992 | | -SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void){ |
| 36980 | +SQLITE_API int sqlite3_os_end(void){ |
| 36993 | 36981 | return SQLITE_OK; |
| 36994 | 36982 | } |
| 36995 | 36983 | |
| 36996 | 36984 | #endif /* SQLITE_OS_UNIX */ |
| 36997 | 36985 | |
| | @@ -38422,11 +38410,11 @@ |
| 38422 | 38410 | ** compact it. Upon success, SQLITE_OK will be returned. Upon failure, one |
| 38423 | 38411 | ** of SQLITE_NOMEM, SQLITE_ERROR, or SQLITE_NOTFOUND will be returned. The |
| 38424 | 38412 | ** "pnLargest" argument, if non-zero, will be used to return the size of the |
| 38425 | 38413 | ** largest committed free block in the heap, in bytes. |
| 38426 | 38414 | */ |
| 38427 | | -SQLITE_API int SQLITE_STDCALL sqlite3_win32_compact_heap(LPUINT pnLargest){ |
| 38415 | +SQLITE_API int sqlite3_win32_compact_heap(LPUINT pnLargest){ |
| 38428 | 38416 | int rc = SQLITE_OK; |
| 38429 | 38417 | UINT nLargest = 0; |
| 38430 | 38418 | HANDLE hHeap; |
| 38431 | 38419 | |
| 38432 | 38420 | winMemAssertMagic(); |
| | @@ -38462,11 +38450,11 @@ |
| 38462 | 38450 | ** If a Win32 native heap has been configured, this function will attempt to |
| 38463 | 38451 | ** destroy and recreate it. If the Win32 native heap is not isolated and/or |
| 38464 | 38452 | ** the sqlite3_memory_used() function does not return zero, SQLITE_BUSY will |
| 38465 | 38453 | ** be returned and no changes will be made to the Win32 native heap. |
| 38466 | 38454 | */ |
| 38467 | | -SQLITE_API int SQLITE_STDCALL sqlite3_win32_reset_heap(){ |
| 38455 | +SQLITE_API int sqlite3_win32_reset_heap(){ |
| 38468 | 38456 | int rc; |
| 38469 | 38457 | MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */ |
| 38470 | 38458 | MUTEX_LOGIC( sqlite3_mutex *pMem; ) /* The memsys static mutex */ |
| 38471 | 38459 | MUTEX_LOGIC( pMaster = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); ) |
| 38472 | 38460 | MUTEX_LOGIC( pMem = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM); ) |
| | @@ -38507,11 +38495,11 @@ |
| 38507 | 38495 | /* |
| 38508 | 38496 | ** This function outputs the specified (ANSI) string to the Win32 debugger |
| 38509 | 38497 | ** (if available). |
| 38510 | 38498 | */ |
| 38511 | 38499 | |
| 38512 | | -SQLITE_API void SQLITE_STDCALL sqlite3_win32_write_debug(const char *zBuf, int nBuf){ |
| 38500 | +SQLITE_API void sqlite3_win32_write_debug(const char *zBuf, int nBuf){ |
| 38513 | 38501 | char zDbgBuf[SQLITE_WIN32_DBG_BUF_SIZE]; |
| 38514 | 38502 | int nMin = MIN(nBuf, (SQLITE_WIN32_DBG_BUF_SIZE - 1)); /* may be negative. */ |
| 38515 | 38503 | if( nMin<-1 ) nMin = -1; /* all negative values become -1. */ |
| 38516 | 38504 | assert( nMin==-1 || nMin==0 || nMin<SQLITE_WIN32_DBG_BUF_SIZE ); |
| 38517 | 38505 | #ifdef SQLITE_ENABLE_API_ARMOR |
| | @@ -38553,11 +38541,11 @@ |
| 38553 | 38541 | */ |
| 38554 | 38542 | #if SQLITE_OS_WINRT |
| 38555 | 38543 | static HANDLE sleepObj = NULL; |
| 38556 | 38544 | #endif |
| 38557 | 38545 | |
| 38558 | | -SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds){ |
| 38546 | +SQLITE_API void sqlite3_win32_sleep(DWORD milliseconds){ |
| 38559 | 38547 | #if SQLITE_OS_WINRT |
| 38560 | 38548 | if ( sleepObj==NULL ){ |
| 38561 | 38549 | sleepObj = osCreateEventExW(NULL, NULL, CREATE_EVENT_MANUAL_RESET, |
| 38562 | 38550 | SYNCHRONIZE); |
| 38563 | 38551 | } |
| | @@ -38602,11 +38590,11 @@ |
| 38602 | 38590 | |
| 38603 | 38591 | /* |
| 38604 | 38592 | ** This function determines if the machine is running a version of Windows |
| 38605 | 38593 | ** based on the NT kernel. |
| 38606 | 38594 | */ |
| 38607 | | -SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void){ |
| 38595 | +SQLITE_API int sqlite3_win32_is_nt(void){ |
| 38608 | 38596 | #if SQLITE_OS_WINRT |
| 38609 | 38597 | /* |
| 38610 | 38598 | ** NOTE: The WinRT sub-platform is always assumed to be based on the NT |
| 38611 | 38599 | ** kernel. |
| 38612 | 38600 | */ |
| | @@ -38990,11 +38978,11 @@ |
| 38990 | 38978 | } |
| 38991 | 38979 | |
| 38992 | 38980 | /* |
| 38993 | 38981 | ** This is a public wrapper for the winUtf8ToUnicode() function. |
| 38994 | 38982 | */ |
| 38995 | | -SQLITE_API LPWSTR SQLITE_STDCALL sqlite3_win32_utf8_to_unicode(const char *zText){ |
| 38983 | +SQLITE_API LPWSTR sqlite3_win32_utf8_to_unicode(const char *zText){ |
| 38996 | 38984 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 38997 | 38985 | if( !zText ){ |
| 38998 | 38986 | (void)SQLITE_MISUSE_BKPT; |
| 38999 | 38987 | return 0; |
| 39000 | 38988 | } |
| | @@ -39006,11 +38994,11 @@ |
| 39006 | 38994 | } |
| 39007 | 38995 | |
| 39008 | 38996 | /* |
| 39009 | 38997 | ** This is a public wrapper for the winUnicodeToUtf8() function. |
| 39010 | 38998 | */ |
| 39011 | | -SQLITE_API char *SQLITE_STDCALL sqlite3_win32_unicode_to_utf8(LPCWSTR zWideText){ |
| 38999 | +SQLITE_API char *sqlite3_win32_unicode_to_utf8(LPCWSTR zWideText){ |
| 39012 | 39000 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 39013 | 39001 | if( !zWideText ){ |
| 39014 | 39002 | (void)SQLITE_MISUSE_BKPT; |
| 39015 | 39003 | return 0; |
| 39016 | 39004 | } |
| | @@ -39022,11 +39010,11 @@ |
| 39022 | 39010 | } |
| 39023 | 39011 | |
| 39024 | 39012 | /* |
| 39025 | 39013 | ** This is a public wrapper for the winMbcsToUtf8() function. |
| 39026 | 39014 | */ |
| 39027 | | -SQLITE_API char *SQLITE_STDCALL sqlite3_win32_mbcs_to_utf8(const char *zText){ |
| 39015 | +SQLITE_API char *sqlite3_win32_mbcs_to_utf8(const char *zText){ |
| 39028 | 39016 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 39029 | 39017 | if( !zText ){ |
| 39030 | 39018 | (void)SQLITE_MISUSE_BKPT; |
| 39031 | 39019 | return 0; |
| 39032 | 39020 | } |
| | @@ -39038,11 +39026,11 @@ |
| 39038 | 39026 | } |
| 39039 | 39027 | |
| 39040 | 39028 | /* |
| 39041 | 39029 | ** This is a public wrapper for the winMbcsToUtf8() function. |
| 39042 | 39030 | */ |
| 39043 | | -SQLITE_API char *SQLITE_STDCALL sqlite3_win32_mbcs_to_utf8_v2(const char *zText, int useAnsi){ |
| 39031 | +SQLITE_API char *sqlite3_win32_mbcs_to_utf8_v2(const char *zText, int useAnsi){ |
| 39044 | 39032 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 39045 | 39033 | if( !zText ){ |
| 39046 | 39034 | (void)SQLITE_MISUSE_BKPT; |
| 39047 | 39035 | return 0; |
| 39048 | 39036 | } |
| | @@ -39054,11 +39042,11 @@ |
| 39054 | 39042 | } |
| 39055 | 39043 | |
| 39056 | 39044 | /* |
| 39057 | 39045 | ** This is a public wrapper for the winUtf8ToMbcs() function. |
| 39058 | 39046 | */ |
| 39059 | | -SQLITE_API char *SQLITE_STDCALL sqlite3_win32_utf8_to_mbcs(const char *zText){ |
| 39047 | +SQLITE_API char *sqlite3_win32_utf8_to_mbcs(const char *zText){ |
| 39060 | 39048 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 39061 | 39049 | if( !zText ){ |
| 39062 | 39050 | (void)SQLITE_MISUSE_BKPT; |
| 39063 | 39051 | return 0; |
| 39064 | 39052 | } |
| | @@ -39070,11 +39058,11 @@ |
| 39070 | 39058 | } |
| 39071 | 39059 | |
| 39072 | 39060 | /* |
| 39073 | 39061 | ** This is a public wrapper for the winUtf8ToMbcs() function. |
| 39074 | 39062 | */ |
| 39075 | | -SQLITE_API char *SQLITE_STDCALL sqlite3_win32_utf8_to_mbcs_v2(const char *zText, int useAnsi){ |
| 39063 | +SQLITE_API char *sqlite3_win32_utf8_to_mbcs_v2(const char *zText, int useAnsi){ |
| 39076 | 39064 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 39077 | 39065 | if( !zText ){ |
| 39078 | 39066 | (void)SQLITE_MISUSE_BKPT; |
| 39079 | 39067 | return 0; |
| 39080 | 39068 | } |
| | @@ -39090,11 +39078,11 @@ |
| 39090 | 39078 | ** the provided arguments. The type argument must be 1 in order to set the |
| 39091 | 39079 | ** data directory or 2 in order to set the temporary directory. The zValue |
| 39092 | 39080 | ** argument is the name of the directory to use. The return value will be |
| 39093 | 39081 | ** SQLITE_OK if successful. |
| 39094 | 39082 | */ |
| 39095 | | -SQLITE_API int SQLITE_STDCALL sqlite3_win32_set_directory(DWORD type, LPCWSTR zValue){ |
| 39083 | +SQLITE_API int sqlite3_win32_set_directory(DWORD type, LPCWSTR zValue){ |
| 39096 | 39084 | char **ppDirectory = 0; |
| 39097 | 39085 | #ifndef SQLITE_OMIT_AUTOINIT |
| 39098 | 39086 | int rc = sqlite3_initialize(); |
| 39099 | 39087 | if( rc ) return rc; |
| 39100 | 39088 | #endif |
| | @@ -43008,11 +42996,11 @@ |
| 43008 | 42996 | } |
| 43009 | 42997 | |
| 43010 | 42998 | /* |
| 43011 | 42999 | ** Initialize and deinitialize the operating system interface. |
| 43012 | 43000 | */ |
| 43013 | | -SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void){ |
| 43001 | +SQLITE_API int sqlite3_os_init(void){ |
| 43014 | 43002 | static sqlite3_vfs winVfs = { |
| 43015 | 43003 | 3, /* iVersion */ |
| 43016 | 43004 | sizeof(winFile), /* szOsFile */ |
| 43017 | 43005 | SQLITE_WIN32_MAX_PATH_BYTES, /* mxPathname */ |
| 43018 | 43006 | 0, /* pNext */ |
| | @@ -43139,11 +43127,11 @@ |
| 43139 | 43127 | #endif |
| 43140 | 43128 | |
| 43141 | 43129 | return SQLITE_OK; |
| 43142 | 43130 | } |
| 43143 | 43131 | |
| 43144 | | -SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void){ |
| 43132 | +SQLITE_API int sqlite3_os_end(void){ |
| 43145 | 43133 | #if SQLITE_OS_WINRT |
| 43146 | 43134 | if( sleepObj!=NULL ){ |
| 43147 | 43135 | osCloseHandle(sleepObj); |
| 43148 | 43136 | sleepObj = NULL; |
| 43149 | 43137 | } |
| | @@ -57182,11 +57170,11 @@ |
| 57182 | 57170 | |
| 57183 | 57171 | /* |
| 57184 | 57172 | ** Return a +ve value if snapshot p1 is newer than p2. A -ve value if |
| 57185 | 57173 | ** p1 is older than p2 and zero if p1 and p2 are the same snapshot. |
| 57186 | 57174 | */ |
| 57187 | | -SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_cmp(sqlite3_snapshot *p1, sqlite3_snapshot *p2){ |
| 57175 | +SQLITE_API int sqlite3_snapshot_cmp(sqlite3_snapshot *p1, sqlite3_snapshot *p2){ |
| 57188 | 57176 | WalIndexHdr *pHdr1 = (WalIndexHdr*)p1; |
| 57189 | 57177 | WalIndexHdr *pHdr2 = (WalIndexHdr*)p2; |
| 57190 | 57178 | |
| 57191 | 57179 | /* aSalt[0] is a copy of the value stored in the wal file header. It |
| 57192 | 57180 | ** is incremented each time the wal file is restarted. */ |
| | @@ -58319,11 +58307,11 @@ |
| 58319 | 58307 | ** |
| 58320 | 58308 | ** This routine has no effect on existing database connections. |
| 58321 | 58309 | ** The shared cache setting effects only future calls to |
| 58322 | 58310 | ** sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2(). |
| 58323 | 58311 | */ |
| 58324 | | -SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int enable){ |
| 58312 | +SQLITE_API int sqlite3_enable_shared_cache(int enable){ |
| 58325 | 58313 | sqlite3GlobalConfig.sharedCacheEnabled = enable; |
| 58326 | 58314 | return SQLITE_OK; |
| 58327 | 58315 | } |
| 58328 | 58316 | #endif |
| 58329 | 58317 | |
| | @@ -59838,12 +59826,15 @@ |
| 59838 | 59826 | hdr = pPage->hdrOffset; |
| 59839 | 59827 | iPtr = hdr + 1; |
| 59840 | 59828 | if( data[iPtr+1]==0 && data[iPtr]==0 ){ |
| 59841 | 59829 | iFreeBlk = 0; /* Shortcut for the case when the freelist is empty */ |
| 59842 | 59830 | }else{ |
| 59843 | | - while( (iFreeBlk = get2byte(&data[iPtr]))>0 && iFreeBlk<iStart ){ |
| 59844 | | - if( iFreeBlk<iPtr+4 ) return SQLITE_CORRUPT_BKPT; |
| 59831 | + while( (iFreeBlk = get2byte(&data[iPtr]))<iStart ){ |
| 59832 | + if( iFreeBlk<iPtr+4 ){ |
| 59833 | + if( iFreeBlk==0 ) break; |
| 59834 | + return SQLITE_CORRUPT_BKPT; |
| 59835 | + } |
| 59845 | 59836 | iPtr = iFreeBlk; |
| 59846 | 59837 | } |
| 59847 | 59838 | if( iFreeBlk>iLast ) return SQLITE_CORRUPT_BKPT; |
| 59848 | 59839 | assert( iFreeBlk>iPtr || iFreeBlk==0 ); |
| 59849 | 59840 | |
| | @@ -68092,11 +68083,11 @@ |
| 68092 | 68083 | ** a pointer to the new sqlite3_backup object. |
| 68093 | 68084 | ** |
| 68094 | 68085 | ** If an error occurs, NULL is returned and an error code and error message |
| 68095 | 68086 | ** stored in database handle pDestDb. |
| 68096 | 68087 | */ |
| 68097 | | -SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init( |
| 68088 | +SQLITE_API sqlite3_backup *sqlite3_backup_init( |
| 68098 | 68089 | sqlite3* pDestDb, /* Database to write to */ |
| 68099 | 68090 | const char *zDestDb, /* Name of database within pDestDb */ |
| 68100 | 68091 | sqlite3* pSrcDb, /* Database connection to read from */ |
| 68101 | 68092 | const char *zSrcDb /* Name of database within pSrcDb */ |
| 68102 | 68093 | ){ |
| | @@ -68299,11 +68290,11 @@ |
| 68299 | 68290 | } |
| 68300 | 68291 | |
| 68301 | 68292 | /* |
| 68302 | 68293 | ** Copy nPage pages from the source b-tree to the destination. |
| 68303 | 68294 | */ |
| 68304 | | -SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage){ |
| 68295 | +SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage){ |
| 68305 | 68296 | int rc; |
| 68306 | 68297 | int destMode; /* Destination journal mode */ |
| 68307 | 68298 | int pgszSrc = 0; /* Source page size */ |
| 68308 | 68299 | int pgszDest = 0; /* Destination page size */ |
| 68309 | 68300 | |
| | @@ -68553,11 +68544,11 @@ |
| 68553 | 68544 | } |
| 68554 | 68545 | |
| 68555 | 68546 | /* |
| 68556 | 68547 | ** Release all resources associated with an sqlite3_backup* handle. |
| 68557 | 68548 | */ |
| 68558 | | -SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p){ |
| 68549 | +SQLITE_API int sqlite3_backup_finish(sqlite3_backup *p){ |
| 68559 | 68550 | sqlite3_backup **pp; /* Ptr to head of pagers backup list */ |
| 68560 | 68551 | sqlite3 *pSrcDb; /* Source database connection */ |
| 68561 | 68552 | int rc; /* Value to return */ |
| 68562 | 68553 | |
| 68563 | 68554 | /* Enter the mutexes */ |
| | @@ -68605,11 +68596,11 @@ |
| 68605 | 68596 | |
| 68606 | 68597 | /* |
| 68607 | 68598 | ** Return the number of pages still to be backed up as of the most recent |
| 68608 | 68599 | ** call to sqlite3_backup_step(). |
| 68609 | 68600 | */ |
| 68610 | | -SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p){ |
| 68601 | +SQLITE_API int sqlite3_backup_remaining(sqlite3_backup *p){ |
| 68611 | 68602 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 68612 | 68603 | if( p==0 ){ |
| 68613 | 68604 | (void)SQLITE_MISUSE_BKPT; |
| 68614 | 68605 | return 0; |
| 68615 | 68606 | } |
| | @@ -68619,11 +68610,11 @@ |
| 68619 | 68610 | |
| 68620 | 68611 | /* |
| 68621 | 68612 | ** Return the total number of pages in the source database as of the most |
| 68622 | 68613 | ** recent call to sqlite3_backup_step(). |
| 68623 | 68614 | */ |
| 68624 | | -SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p){ |
| 68615 | +SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p){ |
| 68625 | 68616 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 68626 | 68617 | if( p==0 ){ |
| 68627 | 68618 | (void)SQLITE_MISUSE_BKPT; |
| 68628 | 68619 | return 0; |
| 68629 | 68620 | } |
| | @@ -68946,22 +68937,22 @@ |
| 68946 | 68937 | ** MEM.zMalloc, where it can be safely written. |
| 68947 | 68938 | ** |
| 68948 | 68939 | ** Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails. |
| 68949 | 68940 | */ |
| 68950 | 68941 | SQLITE_PRIVATE int sqlite3VdbeMemMakeWriteable(Mem *pMem){ |
| 68951 | | - int f; |
| 68952 | 68942 | assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) ); |
| 68953 | 68943 | assert( (pMem->flags&MEM_RowSet)==0 ); |
| 68954 | | - (void)ExpandBlob(pMem); |
| 68955 | | - f = pMem->flags; |
| 68956 | | - if( (f&(MEM_Str|MEM_Blob)) && (pMem->szMalloc==0 || pMem->z!=pMem->zMalloc) ){ |
| 68957 | | - if( sqlite3VdbeMemGrow(pMem, pMem->n + 2, 1) ){ |
| 68958 | | - return SQLITE_NOMEM_BKPT; |
| 68959 | | - } |
| 68960 | | - pMem->z[pMem->n] = 0; |
| 68961 | | - pMem->z[pMem->n+1] = 0; |
| 68962 | | - pMem->flags |= MEM_Term; |
| 68944 | + if( (pMem->flags & (MEM_Str|MEM_Blob))!=0 ){ |
| 68945 | + if( ExpandBlob(pMem) ) return SQLITE_NOMEM; |
| 68946 | + if( pMem->szMalloc==0 || pMem->z!=pMem->zMalloc ){ |
| 68947 | + if( sqlite3VdbeMemGrow(pMem, pMem->n + 2, 1) ){ |
| 68948 | + return SQLITE_NOMEM_BKPT; |
| 68949 | + } |
| 68950 | + pMem->z[pMem->n] = 0; |
| 68951 | + pMem->z[pMem->n+1] = 0; |
| 68952 | + pMem->flags |= MEM_Term; |
| 68953 | + } |
| 68963 | 68954 | } |
| 68964 | 68955 | pMem->flags &= ~MEM_Ephem; |
| 68965 | 68956 | #ifdef SQLITE_DEBUG |
| 68966 | 68957 | pMem->pScopyFrom = 0; |
| 68967 | 68958 | #endif |
| | @@ -68973,29 +68964,28 @@ |
| 68973 | 68964 | ** If the given Mem* has a zero-filled tail, turn it into an ordinary |
| 68974 | 68965 | ** blob stored in dynamically allocated space. |
| 68975 | 68966 | */ |
| 68976 | 68967 | #ifndef SQLITE_OMIT_INCRBLOB |
| 68977 | 68968 | SQLITE_PRIVATE int sqlite3VdbeMemExpandBlob(Mem *pMem){ |
| 68978 | | - if( pMem->flags & MEM_Zero ){ |
| 68979 | | - int nByte; |
| 68980 | | - assert( pMem->flags&MEM_Blob ); |
| 68981 | | - assert( (pMem->flags&MEM_RowSet)==0 ); |
| 68982 | | - assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) ); |
| 68983 | | - |
| 68984 | | - /* Set nByte to the number of bytes required to store the expanded blob. */ |
| 68985 | | - nByte = pMem->n + pMem->u.nZero; |
| 68986 | | - if( nByte<=0 ){ |
| 68987 | | - nByte = 1; |
| 68988 | | - } |
| 68989 | | - if( sqlite3VdbeMemGrow(pMem, nByte, 1) ){ |
| 68990 | | - return SQLITE_NOMEM_BKPT; |
| 68991 | | - } |
| 68992 | | - |
| 68993 | | - memset(&pMem->z[pMem->n], 0, pMem->u.nZero); |
| 68994 | | - pMem->n += pMem->u.nZero; |
| 68995 | | - pMem->flags &= ~(MEM_Zero|MEM_Term); |
| 68996 | | - } |
| 68969 | + int nByte; |
| 68970 | + assert( pMem->flags & MEM_Zero ); |
| 68971 | + assert( pMem->flags&MEM_Blob ); |
| 68972 | + assert( (pMem->flags&MEM_RowSet)==0 ); |
| 68973 | + assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) ); |
| 68974 | + |
| 68975 | + /* Set nByte to the number of bytes required to store the expanded blob. */ |
| 68976 | + nByte = pMem->n + pMem->u.nZero; |
| 68977 | + if( nByte<=0 ){ |
| 68978 | + nByte = 1; |
| 68979 | + } |
| 68980 | + if( sqlite3VdbeMemGrow(pMem, nByte, 1) ){ |
| 68981 | + return SQLITE_NOMEM_BKPT; |
| 68982 | + } |
| 68983 | + |
| 68984 | + memset(&pMem->z[pMem->n], 0, pMem->u.nZero); |
| 68985 | + pMem->n += pMem->u.nZero; |
| 68986 | + pMem->flags &= ~(MEM_Zero|MEM_Term); |
| 68997 | 68987 | return SQLITE_OK; |
| 68998 | 68988 | } |
| 68999 | 68989 | #endif |
| 69000 | 68990 | |
| 69001 | 68991 | /* |
| | @@ -72345,11 +72335,10 @@ |
| 72345 | 72335 | sqlite3 *db; /* The database connection */ |
| 72346 | 72336 | int nVar; /* Number of parameters */ |
| 72347 | 72337 | int nMem; /* Number of VM memory registers */ |
| 72348 | 72338 | int nCursor; /* Number of cursors required */ |
| 72349 | 72339 | int nArg; /* Number of arguments in subprograms */ |
| 72350 | | - int nOnce; /* Number of OP_Once instructions */ |
| 72351 | 72340 | int n; /* Loop counter */ |
| 72352 | 72341 | struct ReusableSpace x; /* Reusable bulk memory */ |
| 72353 | 72342 | |
| 72354 | 72343 | assert( p!=0 ); |
| 72355 | 72344 | assert( p->nOp>0 ); |
| | @@ -72360,12 +72349,10 @@ |
| 72360 | 72349 | assert( db->mallocFailed==0 ); |
| 72361 | 72350 | nVar = pParse->nVar; |
| 72362 | 72351 | nMem = pParse->nMem; |
| 72363 | 72352 | nCursor = pParse->nTab; |
| 72364 | 72353 | nArg = pParse->nMaxArg; |
| 72365 | | - nOnce = pParse->nOnce; |
| 72366 | | - if( nOnce==0 ) nOnce = 1; /* Ensure at least one byte in p->aOnceFlag[] */ |
| 72367 | 72354 | |
| 72368 | 72355 | /* Each cursor uses a memory cell. The first cursor (cursor 0) can |
| 72369 | 72356 | ** use aMem[0] which is not otherwise used by the VDBE program. Allocate |
| 72370 | 72357 | ** space at the end of aMem[] for cursors 1 and greater. |
| 72371 | 72358 | ** See also: allocateCursor(). |
| | @@ -72408,21 +72395,19 @@ |
| 72408 | 72395 | x.nNeeded = 0; |
| 72409 | 72396 | p->aMem = allocSpace(&x, p->aMem, nMem*sizeof(Mem)); |
| 72410 | 72397 | p->aVar = allocSpace(&x, p->aVar, nVar*sizeof(Mem)); |
| 72411 | 72398 | p->apArg = allocSpace(&x, p->apArg, nArg*sizeof(Mem*)); |
| 72412 | 72399 | p->apCsr = allocSpace(&x, p->apCsr, nCursor*sizeof(VdbeCursor*)); |
| 72413 | | - p->aOnceFlag = allocSpace(&x, p->aOnceFlag, nOnce); |
| 72414 | 72400 | #ifdef SQLITE_ENABLE_STMT_SCANSTATUS |
| 72415 | 72401 | p->anExec = allocSpace(&x, p->anExec, p->nOp*sizeof(i64)); |
| 72416 | 72402 | #endif |
| 72417 | 72403 | if( x.nNeeded==0 ) break; |
| 72418 | 72404 | x.pSpace = p->pFree = sqlite3DbMallocZero(db, x.nNeeded); |
| 72419 | 72405 | x.nFree = x.nNeeded; |
| 72420 | 72406 | }while( !db->mallocFailed ); |
| 72421 | 72407 | |
| 72422 | 72408 | p->nCursor = nCursor; |
| 72423 | | - p->nOnceFlag = nOnce; |
| 72424 | 72409 | if( p->aVar ){ |
| 72425 | 72410 | p->nVar = (ynVar)nVar; |
| 72426 | 72411 | for(n=0; n<nVar; n++){ |
| 72427 | 72412 | p->aVar[n].flags = MEM_Null; |
| 72428 | 72413 | p->aVar[n].db = db; |
| | @@ -72506,12 +72491,10 @@ |
| 72506 | 72491 | Vdbe *v = pFrame->v; |
| 72507 | 72492 | closeCursorsInFrame(v); |
| 72508 | 72493 | #ifdef SQLITE_ENABLE_STMT_SCANSTATUS |
| 72509 | 72494 | v->anExec = pFrame->anExec; |
| 72510 | 72495 | #endif |
| 72511 | | - v->aOnceFlag = pFrame->aOnceFlag; |
| 72512 | | - v->nOnceFlag = pFrame->nOnceFlag; |
| 72513 | 72496 | v->aOp = pFrame->aOp; |
| 72514 | 72497 | v->nOp = pFrame->nOp; |
| 72515 | 72498 | v->aMem = pFrame->aMem; |
| 72516 | 72499 | v->nMem = pFrame->nMem; |
| 72517 | 72500 | v->apCsr = pFrame->apCsr; |
| | @@ -73048,11 +73031,10 @@ |
| 73048 | 73031 | */ |
| 73049 | 73032 | |
| 73050 | 73033 | if( db->mallocFailed ){ |
| 73051 | 73034 | p->rc = SQLITE_NOMEM_BKPT; |
| 73052 | 73035 | } |
| 73053 | | - if( p->aOnceFlag ) memset(p->aOnceFlag, 0, p->nOnceFlag); |
| 73054 | 73036 | closeAllCursors(p); |
| 73055 | 73037 | if( p->magic!=VDBE_MAGIC_RUN ){ |
| 73056 | 73038 | return SQLITE_OK; |
| 73057 | 73039 | } |
| 73058 | 73040 | checkActiveVdbeCnt(db); |
| | @@ -74196,14 +74178,16 @@ |
| 74196 | 74178 | |
| 74197 | 74179 | /* |
| 74198 | 74180 | ** The input pBlob is guaranteed to be a Blob that is not marked |
| 74199 | 74181 | ** with MEM_Zero. Return true if it could be a zero-blob. |
| 74200 | 74182 | */ |
| 74201 | | -static int isZeroBlob(const Mem *pBlob){ |
| 74183 | +static int isAllZero(const char *z, int n){ |
| 74202 | 74184 | int i; |
| 74203 | | - for(i=0; i<pBlob->n && pBlob->z[i]==0; i++){} |
| 74204 | | - return i==pBlob->n; |
| 74185 | + for(i=0; i<n; i++){ |
| 74186 | + if( z[i] ) return 0; |
| 74187 | + } |
| 74188 | + return 1; |
| 74205 | 74189 | } |
| 74206 | 74190 | |
| 74207 | 74191 | /* |
| 74208 | 74192 | ** Compare two blobs. Return negative, zero, or positive if the first |
| 74209 | 74193 | ** is less than, equal to, or greater than the second, respectively. |
| | @@ -74223,14 +74207,14 @@ |
| 74223 | 74207 | |
| 74224 | 74208 | if( (pB1->flags|pB2->flags) & MEM_Zero ){ |
| 74225 | 74209 | if( pB1->flags & pB2->flags & MEM_Zero ){ |
| 74226 | 74210 | return pB1->u.nZero - pB2->u.nZero; |
| 74227 | 74211 | }else if( pB1->flags & MEM_Zero ){ |
| 74228 | | - if( !isZeroBlob(pB2) ) return -1; |
| 74212 | + if( !isAllZero(pB2->z, pB2->n) ) return -1; |
| 74229 | 74213 | return pB1->u.nZero - n2; |
| 74230 | 74214 | }else{ |
| 74231 | | - if( !isZeroBlob(pB1) ) return +1; |
| 74215 | + if( !isAllZero(pB1->z, pB1->n) ) return +1; |
| 74232 | 74216 | return n1 - pB2->u.nZero; |
| 74233 | 74217 | } |
| 74234 | 74218 | } |
| 74235 | 74219 | c = memcmp(pB1->z, pB2->z, n1>n2 ? n2 : n1); |
| 74236 | 74220 | if( c ) return c; |
| | @@ -74538,10 +74522,11 @@ |
| 74538 | 74522 | } |
| 74539 | 74523 | } |
| 74540 | 74524 | |
| 74541 | 74525 | /* RHS is a blob */ |
| 74542 | 74526 | else if( pRhs->flags & MEM_Blob ){ |
| 74527 | + assert( (pRhs->flags & MEM_Zero)==0 || pRhs->n==0 ); |
| 74543 | 74528 | getVarint32(&aKey1[idx1], serial_type); |
| 74544 | 74529 | testcase( serial_type==12 ); |
| 74545 | 74530 | if( serial_type<12 || (serial_type & 0x01) ){ |
| 74546 | 74531 | rc = -1; |
| 74547 | 74532 | }else{ |
| | @@ -74549,10 +74534,16 @@ |
| 74549 | 74534 | testcase( (d1+nStr)==(unsigned)nKey1 ); |
| 74550 | 74535 | testcase( (d1+nStr+1)==(unsigned)nKey1 ); |
| 74551 | 74536 | if( (d1+nStr) > (unsigned)nKey1 ){ |
| 74552 | 74537 | pPKey2->errCode = (u8)SQLITE_CORRUPT_BKPT; |
| 74553 | 74538 | return 0; /* Corruption */ |
| 74539 | + }else if( pRhs->flags & MEM_Zero ){ |
| 74540 | + if( !isAllZero((const char*)&aKey1[d1],nStr) ){ |
| 74541 | + rc = 1; |
| 74542 | + }else{ |
| 74543 | + rc = nStr - pRhs->u.nZero; |
| 74544 | + } |
| 74554 | 74545 | }else{ |
| 74555 | 74546 | int nCmp = MIN(nStr, pRhs->n); |
| 74556 | 74547 | rc = memcmp(&aKey1[d1], pRhs->z, nCmp); |
| 74557 | 74548 | if( rc==0 ) rc = nStr - pRhs->n; |
| 74558 | 74549 | } |
| | @@ -74619,11 +74610,11 @@ |
| 74619 | 74610 | const u8 *aKey = &((const u8*)pKey1)[*(const u8*)pKey1 & 0x3F]; |
| 74620 | 74611 | int serial_type = ((const u8*)pKey1)[1]; |
| 74621 | 74612 | int res; |
| 74622 | 74613 | u32 y; |
| 74623 | 74614 | u64 x; |
| 74624 | | - i64 v = pPKey2->aMem[0].u.i; |
| 74615 | + i64 v; |
| 74625 | 74616 | i64 lhs; |
| 74626 | 74617 | |
| 74627 | 74618 | vdbeAssertFieldCountWithinLimits(nKey1, pKey1, pPKey2->pKeyInfo); |
| 74628 | 74619 | assert( (*(u8*)pKey1)<=0x3F || CORRUPT_DB ); |
| 74629 | 74620 | switch( serial_type ){ |
| | @@ -74678,10 +74669,11 @@ |
| 74678 | 74669 | |
| 74679 | 74670 | default: |
| 74680 | 74671 | return sqlite3VdbeRecordCompare(nKey1, pKey1, pPKey2); |
| 74681 | 74672 | } |
| 74682 | 74673 | |
| 74674 | + v = pPKey2->aMem[0].u.i; |
| 74683 | 74675 | if( v>lhs ){ |
| 74684 | 74676 | res = pPKey2->r1; |
| 74685 | 74677 | }else if( v<lhs ){ |
| 74686 | 74678 | res = pPKey2->r2; |
| 74687 | 74679 | }else if( pPKey2->nField>1 ){ |
| | @@ -75128,11 +75120,11 @@ |
| 75128 | 75120 | ** execution environment changes in a way that would alter the program |
| 75129 | 75121 | ** that sqlite3_prepare() generates. For example, if new functions or |
| 75130 | 75122 | ** collating sequences are registered or if an authorizer function is |
| 75131 | 75123 | ** added or changed. |
| 75132 | 75124 | */ |
| 75133 | | -SQLITE_API int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt *pStmt){ |
| 75125 | +SQLITE_API int sqlite3_expired(sqlite3_stmt *pStmt){ |
| 75134 | 75126 | Vdbe *p = (Vdbe*)pStmt; |
| 75135 | 75127 | return p==0 || p->expired; |
| 75136 | 75128 | } |
| 75137 | 75129 | #endif |
| 75138 | 75130 | |
| | @@ -75197,11 +75189,11 @@ |
| 75197 | 75189 | ** machine. |
| 75198 | 75190 | ** |
| 75199 | 75191 | ** This routine sets the error code and string returned by |
| 75200 | 75192 | ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16(). |
| 75201 | 75193 | */ |
| 75202 | | -SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt){ |
| 75194 | +SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt){ |
| 75203 | 75195 | int rc; |
| 75204 | 75196 | if( pStmt==0 ){ |
| 75205 | 75197 | /* IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL |
| 75206 | 75198 | ** pointer is a harmless no-op. */ |
| 75207 | 75199 | rc = SQLITE_OK; |
| | @@ -75224,11 +75216,11 @@ |
| 75224 | 75216 | ** the prior execution is returned. |
| 75225 | 75217 | ** |
| 75226 | 75218 | ** This routine sets the error code and string returned by |
| 75227 | 75219 | ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16(). |
| 75228 | 75220 | */ |
| 75229 | | -SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt){ |
| 75221 | +SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt){ |
| 75230 | 75222 | int rc; |
| 75231 | 75223 | if( pStmt==0 ){ |
| 75232 | 75224 | rc = SQLITE_OK; |
| 75233 | 75225 | }else{ |
| 75234 | 75226 | Vdbe *v = (Vdbe*)pStmt; |
| | @@ -75245,11 +75237,11 @@ |
| 75245 | 75237 | } |
| 75246 | 75238 | |
| 75247 | 75239 | /* |
| 75248 | 75240 | ** Set all the parameters in the compiled SQL statement to NULL. |
| 75249 | 75241 | */ |
| 75250 | | -SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt *pStmt){ |
| 75242 | +SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt *pStmt){ |
| 75251 | 75243 | int i; |
| 75252 | 75244 | int rc = SQLITE_OK; |
| 75253 | 75245 | Vdbe *p = (Vdbe*)pStmt; |
| 75254 | 75246 | #if SQLITE_THREADSAFE |
| 75255 | 75247 | sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex; |
| | @@ -75269,61 +75261,61 @@ |
| 75269 | 75261 | |
| 75270 | 75262 | /**************************** sqlite3_value_ ******************************* |
| 75271 | 75263 | ** The following routines extract information from a Mem or sqlite3_value |
| 75272 | 75264 | ** structure. |
| 75273 | 75265 | */ |
| 75274 | | -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value *pVal){ |
| 75266 | +SQLITE_API const void *sqlite3_value_blob(sqlite3_value *pVal){ |
| 75275 | 75267 | Mem *p = (Mem*)pVal; |
| 75276 | 75268 | if( p->flags & (MEM_Blob|MEM_Str) ){ |
| 75277 | | - if( sqlite3VdbeMemExpandBlob(p)!=SQLITE_OK ){ |
| 75269 | + if( ExpandBlob(p)!=SQLITE_OK ){ |
| 75278 | 75270 | assert( p->flags==MEM_Null && p->z==0 ); |
| 75279 | 75271 | return 0; |
| 75280 | 75272 | } |
| 75281 | 75273 | p->flags |= MEM_Blob; |
| 75282 | 75274 | return p->n ? p->z : 0; |
| 75283 | 75275 | }else{ |
| 75284 | 75276 | return sqlite3_value_text(pVal); |
| 75285 | 75277 | } |
| 75286 | 75278 | } |
| 75287 | | -SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value *pVal){ |
| 75279 | +SQLITE_API int sqlite3_value_bytes(sqlite3_value *pVal){ |
| 75288 | 75280 | return sqlite3ValueBytes(pVal, SQLITE_UTF8); |
| 75289 | 75281 | } |
| 75290 | | -SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value *pVal){ |
| 75282 | +SQLITE_API int sqlite3_value_bytes16(sqlite3_value *pVal){ |
| 75291 | 75283 | return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE); |
| 75292 | 75284 | } |
| 75293 | | -SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value *pVal){ |
| 75285 | +SQLITE_API double sqlite3_value_double(sqlite3_value *pVal){ |
| 75294 | 75286 | return sqlite3VdbeRealValue((Mem*)pVal); |
| 75295 | 75287 | } |
| 75296 | | -SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value *pVal){ |
| 75288 | +SQLITE_API int sqlite3_value_int(sqlite3_value *pVal){ |
| 75297 | 75289 | return (int)sqlite3VdbeIntValue((Mem*)pVal); |
| 75298 | 75290 | } |
| 75299 | | -SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value *pVal){ |
| 75291 | +SQLITE_API sqlite_int64 sqlite3_value_int64(sqlite3_value *pVal){ |
| 75300 | 75292 | return sqlite3VdbeIntValue((Mem*)pVal); |
| 75301 | 75293 | } |
| 75302 | | -SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value *pVal){ |
| 75294 | +SQLITE_API unsigned int sqlite3_value_subtype(sqlite3_value *pVal){ |
| 75303 | 75295 | Mem *pMem = (Mem*)pVal; |
| 75304 | 75296 | return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0); |
| 75305 | 75297 | } |
| 75306 | | -SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value *pVal){ |
| 75298 | +SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value *pVal){ |
| 75307 | 75299 | return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8); |
| 75308 | 75300 | } |
| 75309 | 75301 | #ifndef SQLITE_OMIT_UTF16 |
| 75310 | | -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value* pVal){ |
| 75302 | +SQLITE_API const void *sqlite3_value_text16(sqlite3_value* pVal){ |
| 75311 | 75303 | return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE); |
| 75312 | 75304 | } |
| 75313 | | -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value *pVal){ |
| 75305 | +SQLITE_API const void *sqlite3_value_text16be(sqlite3_value *pVal){ |
| 75314 | 75306 | return sqlite3ValueText(pVal, SQLITE_UTF16BE); |
| 75315 | 75307 | } |
| 75316 | | -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value *pVal){ |
| 75308 | +SQLITE_API const void *sqlite3_value_text16le(sqlite3_value *pVal){ |
| 75317 | 75309 | return sqlite3ValueText(pVal, SQLITE_UTF16LE); |
| 75318 | 75310 | } |
| 75319 | 75311 | #endif /* SQLITE_OMIT_UTF16 */ |
| 75320 | 75312 | /* EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five |
| 75321 | 75313 | ** fundamental datatypes: 64-bit signed integer 64-bit IEEE floating |
| 75322 | 75314 | ** point number string BLOB NULL |
| 75323 | 75315 | */ |
| 75324 | | -SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value* pVal){ |
| 75316 | +SQLITE_API int sqlite3_value_type(sqlite3_value* pVal){ |
| 75325 | 75317 | static const u8 aType[] = { |
| 75326 | 75318 | SQLITE_BLOB, /* 0x00 */ |
| 75327 | 75319 | SQLITE_NULL, /* 0x01 */ |
| 75328 | 75320 | SQLITE_TEXT, /* 0x02 */ |
| 75329 | 75321 | SQLITE_NULL, /* 0x03 */ |
| | @@ -75359,11 +75351,11 @@ |
| 75359 | 75351 | return aType[pVal->flags&MEM_AffMask]; |
| 75360 | 75352 | } |
| 75361 | 75353 | |
| 75362 | 75354 | /* Make a copy of an sqlite3_value object |
| 75363 | 75355 | */ |
| 75364 | | -SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value *pOrig){ |
| 75356 | +SQLITE_API sqlite3_value *sqlite3_value_dup(const sqlite3_value *pOrig){ |
| 75365 | 75357 | sqlite3_value *pNew; |
| 75366 | 75358 | if( pOrig==0 ) return 0; |
| 75367 | 75359 | pNew = sqlite3_malloc( sizeof(*pNew) ); |
| 75368 | 75360 | if( pNew==0 ) return 0; |
| 75369 | 75361 | memset(pNew, 0, sizeof(*pNew)); |
| | @@ -75382,11 +75374,11 @@ |
| 75382 | 75374 | } |
| 75383 | 75375 | |
| 75384 | 75376 | /* Destroy an sqlite3_value object previously obtained from |
| 75385 | 75377 | ** sqlite3_value_dup(). |
| 75386 | 75378 | */ |
| 75387 | | -SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value *pOld){ |
| 75379 | +SQLITE_API void sqlite3_value_free(sqlite3_value *pOld){ |
| 75388 | 75380 | sqlite3ValueFree(pOld); |
| 75389 | 75381 | } |
| 75390 | 75382 | |
| 75391 | 75383 | |
| 75392 | 75384 | /**************************** sqlite3_result_ ******************************* |
| | @@ -75425,21 +75417,21 @@ |
| 75425 | 75417 | xDel((void*)p); |
| 75426 | 75418 | } |
| 75427 | 75419 | if( pCtx ) sqlite3_result_error_toobig(pCtx); |
| 75428 | 75420 | return SQLITE_TOOBIG; |
| 75429 | 75421 | } |
| 75430 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_blob( |
| 75422 | +SQLITE_API void sqlite3_result_blob( |
| 75431 | 75423 | sqlite3_context *pCtx, |
| 75432 | 75424 | const void *z, |
| 75433 | 75425 | int n, |
| 75434 | 75426 | void (*xDel)(void *) |
| 75435 | 75427 | ){ |
| 75436 | 75428 | assert( n>=0 ); |
| 75437 | 75429 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75438 | 75430 | setResultStrOrError(pCtx, z, n, 0, xDel); |
| 75439 | 75431 | } |
| 75440 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64( |
| 75432 | +SQLITE_API void sqlite3_result_blob64( |
| 75441 | 75433 | sqlite3_context *pCtx, |
| 75442 | 75434 | const void *z, |
| 75443 | 75435 | sqlite3_uint64 n, |
| 75444 | 75436 | void (*xDel)(void *) |
| 75445 | 75437 | ){ |
| | @@ -75449,56 +75441,56 @@ |
| 75449 | 75441 | (void)invokeValueDestructor(z, xDel, pCtx); |
| 75450 | 75442 | }else{ |
| 75451 | 75443 | setResultStrOrError(pCtx, z, (int)n, 0, xDel); |
| 75452 | 75444 | } |
| 75453 | 75445 | } |
| 75454 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context *pCtx, double rVal){ |
| 75446 | +SQLITE_API void sqlite3_result_double(sqlite3_context *pCtx, double rVal){ |
| 75455 | 75447 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75456 | 75448 | sqlite3VdbeMemSetDouble(pCtx->pOut, rVal); |
| 75457 | 75449 | } |
| 75458 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){ |
| 75450 | +SQLITE_API void sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){ |
| 75459 | 75451 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75460 | 75452 | pCtx->isError = SQLITE_ERROR; |
| 75461 | 75453 | pCtx->fErrorOrAux = 1; |
| 75462 | 75454 | sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF8, SQLITE_TRANSIENT); |
| 75463 | 75455 | } |
| 75464 | 75456 | #ifndef SQLITE_OMIT_UTF16 |
| 75465 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){ |
| 75457 | +SQLITE_API void sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){ |
| 75466 | 75458 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75467 | 75459 | pCtx->isError = SQLITE_ERROR; |
| 75468 | 75460 | pCtx->fErrorOrAux = 1; |
| 75469 | 75461 | sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT); |
| 75470 | 75462 | } |
| 75471 | 75463 | #endif |
| 75472 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context *pCtx, int iVal){ |
| 75464 | +SQLITE_API void sqlite3_result_int(sqlite3_context *pCtx, int iVal){ |
| 75473 | 75465 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75474 | 75466 | sqlite3VdbeMemSetInt64(pCtx->pOut, (i64)iVal); |
| 75475 | 75467 | } |
| 75476 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){ |
| 75468 | +SQLITE_API void sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){ |
| 75477 | 75469 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75478 | 75470 | sqlite3VdbeMemSetInt64(pCtx->pOut, iVal); |
| 75479 | 75471 | } |
| 75480 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context *pCtx){ |
| 75472 | +SQLITE_API void sqlite3_result_null(sqlite3_context *pCtx){ |
| 75481 | 75473 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75482 | 75474 | sqlite3VdbeMemSetNull(pCtx->pOut); |
| 75483 | 75475 | } |
| 75484 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){ |
| 75476 | +SQLITE_API void sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){ |
| 75485 | 75477 | Mem *pOut = pCtx->pOut; |
| 75486 | 75478 | assert( sqlite3_mutex_held(pOut->db->mutex) ); |
| 75487 | 75479 | pOut->eSubtype = eSubtype & 0xff; |
| 75488 | 75480 | pOut->flags |= MEM_Subtype; |
| 75489 | 75481 | } |
| 75490 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text( |
| 75482 | +SQLITE_API void sqlite3_result_text( |
| 75491 | 75483 | sqlite3_context *pCtx, |
| 75492 | 75484 | const char *z, |
| 75493 | 75485 | int n, |
| 75494 | 75486 | void (*xDel)(void *) |
| 75495 | 75487 | ){ |
| 75496 | 75488 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75497 | 75489 | setResultStrOrError(pCtx, z, n, SQLITE_UTF8, xDel); |
| 75498 | 75490 | } |
| 75499 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text64( |
| 75491 | +SQLITE_API void sqlite3_result_text64( |
| 75500 | 75492 | sqlite3_context *pCtx, |
| 75501 | 75493 | const char *z, |
| 75502 | 75494 | sqlite3_uint64 n, |
| 75503 | 75495 | void (*xDel)(void *), |
| 75504 | 75496 | unsigned char enc |
| | @@ -75511,56 +75503,56 @@ |
| 75511 | 75503 | }else{ |
| 75512 | 75504 | setResultStrOrError(pCtx, z, (int)n, enc, xDel); |
| 75513 | 75505 | } |
| 75514 | 75506 | } |
| 75515 | 75507 | #ifndef SQLITE_OMIT_UTF16 |
| 75516 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text16( |
| 75508 | +SQLITE_API void sqlite3_result_text16( |
| 75517 | 75509 | sqlite3_context *pCtx, |
| 75518 | 75510 | const void *z, |
| 75519 | 75511 | int n, |
| 75520 | 75512 | void (*xDel)(void *) |
| 75521 | 75513 | ){ |
| 75522 | 75514 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75523 | 75515 | setResultStrOrError(pCtx, z, n, SQLITE_UTF16NATIVE, xDel); |
| 75524 | 75516 | } |
| 75525 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be( |
| 75517 | +SQLITE_API void sqlite3_result_text16be( |
| 75526 | 75518 | sqlite3_context *pCtx, |
| 75527 | 75519 | const void *z, |
| 75528 | 75520 | int n, |
| 75529 | 75521 | void (*xDel)(void *) |
| 75530 | 75522 | ){ |
| 75531 | 75523 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75532 | 75524 | setResultStrOrError(pCtx, z, n, SQLITE_UTF16BE, xDel); |
| 75533 | 75525 | } |
| 75534 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le( |
| 75526 | +SQLITE_API void sqlite3_result_text16le( |
| 75535 | 75527 | sqlite3_context *pCtx, |
| 75536 | 75528 | const void *z, |
| 75537 | 75529 | int n, |
| 75538 | 75530 | void (*xDel)(void *) |
| 75539 | 75531 | ){ |
| 75540 | 75532 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75541 | 75533 | setResultStrOrError(pCtx, z, n, SQLITE_UTF16LE, xDel); |
| 75542 | 75534 | } |
| 75543 | 75535 | #endif /* SQLITE_OMIT_UTF16 */ |
| 75544 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){ |
| 75536 | +SQLITE_API void sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){ |
| 75545 | 75537 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75546 | 75538 | sqlite3VdbeMemCopy(pCtx->pOut, pValue); |
| 75547 | 75539 | } |
| 75548 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){ |
| 75540 | +SQLITE_API void sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){ |
| 75549 | 75541 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75550 | 75542 | sqlite3VdbeMemSetZeroBlob(pCtx->pOut, n); |
| 75551 | 75543 | } |
| 75552 | | -SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){ |
| 75544 | +SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){ |
| 75553 | 75545 | Mem *pOut = pCtx->pOut; |
| 75554 | 75546 | assert( sqlite3_mutex_held(pOut->db->mutex) ); |
| 75555 | 75547 | if( n>(u64)pOut->db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
| 75556 | 75548 | return SQLITE_TOOBIG; |
| 75557 | 75549 | } |
| 75558 | 75550 | sqlite3VdbeMemSetZeroBlob(pCtx->pOut, (int)n); |
| 75559 | 75551 | return SQLITE_OK; |
| 75560 | 75552 | } |
| 75561 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){ |
| 75553 | +SQLITE_API void sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){ |
| 75562 | 75554 | pCtx->isError = errCode; |
| 75563 | 75555 | pCtx->fErrorOrAux = 1; |
| 75564 | 75556 | #ifdef SQLITE_DEBUG |
| 75565 | 75557 | if( pCtx->pVdbe ) pCtx->pVdbe->rcApp = errCode; |
| 75566 | 75558 | #endif |
| | @@ -75569,20 +75561,20 @@ |
| 75569 | 75561 | SQLITE_UTF8, SQLITE_STATIC); |
| 75570 | 75562 | } |
| 75571 | 75563 | } |
| 75572 | 75564 | |
| 75573 | 75565 | /* Force an SQLITE_TOOBIG error. */ |
| 75574 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context *pCtx){ |
| 75566 | +SQLITE_API void sqlite3_result_error_toobig(sqlite3_context *pCtx){ |
| 75575 | 75567 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75576 | 75568 | pCtx->isError = SQLITE_TOOBIG; |
| 75577 | 75569 | pCtx->fErrorOrAux = 1; |
| 75578 | 75570 | sqlite3VdbeMemSetStr(pCtx->pOut, "string or blob too big", -1, |
| 75579 | 75571 | SQLITE_UTF8, SQLITE_STATIC); |
| 75580 | 75572 | } |
| 75581 | 75573 | |
| 75582 | 75574 | /* An SQLITE_NOMEM error. */ |
| 75583 | | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context *pCtx){ |
| 75575 | +SQLITE_API void sqlite3_result_error_nomem(sqlite3_context *pCtx){ |
| 75584 | 75576 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75585 | 75577 | sqlite3VdbeMemSetNull(pCtx->pOut); |
| 75586 | 75578 | pCtx->isError = SQLITE_NOMEM_BKPT; |
| 75587 | 75579 | pCtx->fErrorOrAux = 1; |
| 75588 | 75580 | sqlite3OomFault(pCtx->pOut->db); |
| | @@ -75750,11 +75742,11 @@ |
| 75750 | 75742 | /* |
| 75751 | 75743 | ** This is the top-level implementation of sqlite3_step(). Call |
| 75752 | 75744 | ** sqlite3Step() to do most of the work. If a schema error occurs, |
| 75753 | 75745 | ** call sqlite3Reprepare() and try again. |
| 75754 | 75746 | */ |
| 75755 | | -SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt *pStmt){ |
| 75747 | +SQLITE_API int sqlite3_step(sqlite3_stmt *pStmt){ |
| 75756 | 75748 | int rc = SQLITE_OK; /* Result from sqlite3Step() */ |
| 75757 | 75749 | int rc2 = SQLITE_OK; /* Result from sqlite3Reprepare() */ |
| 75758 | 75750 | Vdbe *v = (Vdbe*)pStmt; /* the prepared statement */ |
| 75759 | 75751 | int cnt = 0; /* Counter to prevent infinite loop of reprepares */ |
| 75760 | 75752 | sqlite3 *db; /* The database connection */ |
| | @@ -75801,11 +75793,11 @@ |
| 75801 | 75793 | |
| 75802 | 75794 | /* |
| 75803 | 75795 | ** Extract the user data from a sqlite3_context structure and return a |
| 75804 | 75796 | ** pointer to it. |
| 75805 | 75797 | */ |
| 75806 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context *p){ |
| 75798 | +SQLITE_API void *sqlite3_user_data(sqlite3_context *p){ |
| 75807 | 75799 | assert( p && p->pFunc ); |
| 75808 | 75800 | return p->pFunc->pUserData; |
| 75809 | 75801 | } |
| 75810 | 75802 | |
| 75811 | 75803 | /* |
| | @@ -75816,11 +75808,11 @@ |
| 75816 | 75808 | ** returns a copy of the pointer to the database connection (the 1st |
| 75817 | 75809 | ** parameter) of the sqlite3_create_function() and |
| 75818 | 75810 | ** sqlite3_create_function16() routines that originally registered the |
| 75819 | 75811 | ** application defined function. |
| 75820 | 75812 | */ |
| 75821 | | -SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context *p){ |
| 75813 | +SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context *p){ |
| 75822 | 75814 | assert( p && p->pOut ); |
| 75823 | 75815 | return p->pOut->db; |
| 75824 | 75816 | } |
| 75825 | 75817 | |
| 75826 | 75818 | /* |
| | @@ -75892,11 +75884,11 @@ |
| 75892 | 75884 | /* |
| 75893 | 75885 | ** Allocate or return the aggregate context for a user function. A new |
| 75894 | 75886 | ** context is allocated on the first call. Subsequent calls return the |
| 75895 | 75887 | ** same context that was returned on prior calls. |
| 75896 | 75888 | */ |
| 75897 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context *p, int nByte){ |
| 75889 | +SQLITE_API void *sqlite3_aggregate_context(sqlite3_context *p, int nByte){ |
| 75898 | 75890 | assert( p && p->pFunc && p->pFunc->xFinalize ); |
| 75899 | 75891 | assert( sqlite3_mutex_held(p->pOut->db->mutex) ); |
| 75900 | 75892 | testcase( nByte<0 ); |
| 75901 | 75893 | if( (p->pMem->flags & MEM_Agg)==0 ){ |
| 75902 | 75894 | return createAggContext(p, nByte); |
| | @@ -75907,11 +75899,11 @@ |
| 75907 | 75899 | |
| 75908 | 75900 | /* |
| 75909 | 75901 | ** Return the auxiliary data pointer, if any, for the iArg'th argument to |
| 75910 | 75902 | ** the user-function defined by pCtx. |
| 75911 | 75903 | */ |
| 75912 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){ |
| 75904 | +SQLITE_API void *sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){ |
| 75913 | 75905 | AuxData *pAuxData; |
| 75914 | 75906 | |
| 75915 | 75907 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75916 | 75908 | #if SQLITE_ENABLE_STAT3_OR_STAT4 |
| 75917 | 75909 | if( pCtx->pVdbe==0 ) return 0; |
| | @@ -75928,11 +75920,11 @@ |
| 75928 | 75920 | /* |
| 75929 | 75921 | ** Set the auxiliary data pointer and delete function, for the iArg'th |
| 75930 | 75922 | ** argument to the user-function defined by pCtx. Any previous value is |
| 75931 | 75923 | ** deleted by calling the delete function specified when it was set. |
| 75932 | 75924 | */ |
| 75933 | | -SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata( |
| 75925 | +SQLITE_API void sqlite3_set_auxdata( |
| 75934 | 75926 | sqlite3_context *pCtx, |
| 75935 | 75927 | int iArg, |
| 75936 | 75928 | void *pAux, |
| 75937 | 75929 | void (*xDelete)(void*) |
| 75938 | 75930 | ){ |
| | @@ -75983,29 +75975,29 @@ |
| 75983 | 75975 | ** This function is deprecated. Do not use it for new code. It is |
| 75984 | 75976 | ** provide only to avoid breaking legacy code. New aggregate function |
| 75985 | 75977 | ** implementations should keep their own counts within their aggregate |
| 75986 | 75978 | ** context. |
| 75987 | 75979 | */ |
| 75988 | | -SQLITE_API int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context *p){ |
| 75980 | +SQLITE_API int sqlite3_aggregate_count(sqlite3_context *p){ |
| 75989 | 75981 | assert( p && p->pMem && p->pFunc && p->pFunc->xFinalize ); |
| 75990 | 75982 | return p->pMem->n; |
| 75991 | 75983 | } |
| 75992 | 75984 | #endif |
| 75993 | 75985 | |
| 75994 | 75986 | /* |
| 75995 | 75987 | ** Return the number of columns in the result set for the statement pStmt. |
| 75996 | 75988 | */ |
| 75997 | | -SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt){ |
| 75989 | +SQLITE_API int sqlite3_column_count(sqlite3_stmt *pStmt){ |
| 75998 | 75990 | Vdbe *pVm = (Vdbe *)pStmt; |
| 75999 | 75991 | return pVm ? pVm->nResColumn : 0; |
| 76000 | 75992 | } |
| 76001 | 75993 | |
| 76002 | 75994 | /* |
| 76003 | 75995 | ** Return the number of values available from the current row of the |
| 76004 | 75996 | ** currently executing statement pStmt. |
| 76005 | 75997 | */ |
| 76006 | | -SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt){ |
| 75998 | +SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt){ |
| 76007 | 75999 | Vdbe *pVm = (Vdbe *)pStmt; |
| 76008 | 76000 | if( pVm==0 || pVm->pResultSet==0 ) return 0; |
| 76009 | 76001 | return pVm->nResColumn; |
| 76010 | 76002 | } |
| 76011 | 76003 | |
| | @@ -76104,67 +76096,67 @@ |
| 76104 | 76096 | |
| 76105 | 76097 | /**************************** sqlite3_column_ ******************************* |
| 76106 | 76098 | ** The following routines are used to access elements of the current row |
| 76107 | 76099 | ** in the result set. |
| 76108 | 76100 | */ |
| 76109 | | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt *pStmt, int i){ |
| 76101 | +SQLITE_API const void *sqlite3_column_blob(sqlite3_stmt *pStmt, int i){ |
| 76110 | 76102 | const void *val; |
| 76111 | 76103 | val = sqlite3_value_blob( columnMem(pStmt,i) ); |
| 76112 | 76104 | /* Even though there is no encoding conversion, value_blob() might |
| 76113 | 76105 | ** need to call malloc() to expand the result of a zeroblob() |
| 76114 | 76106 | ** expression. |
| 76115 | 76107 | */ |
| 76116 | 76108 | columnMallocFailure(pStmt); |
| 76117 | 76109 | return val; |
| 76118 | 76110 | } |
| 76119 | | -SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){ |
| 76111 | +SQLITE_API int sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){ |
| 76120 | 76112 | int val = sqlite3_value_bytes( columnMem(pStmt,i) ); |
| 76121 | 76113 | columnMallocFailure(pStmt); |
| 76122 | 76114 | return val; |
| 76123 | 76115 | } |
| 76124 | | -SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){ |
| 76116 | +SQLITE_API int sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){ |
| 76125 | 76117 | int val = sqlite3_value_bytes16( columnMem(pStmt,i) ); |
| 76126 | 76118 | columnMallocFailure(pStmt); |
| 76127 | 76119 | return val; |
| 76128 | 76120 | } |
| 76129 | | -SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt *pStmt, int i){ |
| 76121 | +SQLITE_API double sqlite3_column_double(sqlite3_stmt *pStmt, int i){ |
| 76130 | 76122 | double val = sqlite3_value_double( columnMem(pStmt,i) ); |
| 76131 | 76123 | columnMallocFailure(pStmt); |
| 76132 | 76124 | return val; |
| 76133 | 76125 | } |
| 76134 | | -SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt *pStmt, int i){ |
| 76126 | +SQLITE_API int sqlite3_column_int(sqlite3_stmt *pStmt, int i){ |
| 76135 | 76127 | int val = sqlite3_value_int( columnMem(pStmt,i) ); |
| 76136 | 76128 | columnMallocFailure(pStmt); |
| 76137 | 76129 | return val; |
| 76138 | 76130 | } |
| 76139 | | -SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt *pStmt, int i){ |
| 76131 | +SQLITE_API sqlite_int64 sqlite3_column_int64(sqlite3_stmt *pStmt, int i){ |
| 76140 | 76132 | sqlite_int64 val = sqlite3_value_int64( columnMem(pStmt,i) ); |
| 76141 | 76133 | columnMallocFailure(pStmt); |
| 76142 | 76134 | return val; |
| 76143 | 76135 | } |
| 76144 | | -SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt *pStmt, int i){ |
| 76136 | +SQLITE_API const unsigned char *sqlite3_column_text(sqlite3_stmt *pStmt, int i){ |
| 76145 | 76137 | const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) ); |
| 76146 | 76138 | columnMallocFailure(pStmt); |
| 76147 | 76139 | return val; |
| 76148 | 76140 | } |
| 76149 | | -SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt *pStmt, int i){ |
| 76141 | +SQLITE_API sqlite3_value *sqlite3_column_value(sqlite3_stmt *pStmt, int i){ |
| 76150 | 76142 | Mem *pOut = columnMem(pStmt, i); |
| 76151 | 76143 | if( pOut->flags&MEM_Static ){ |
| 76152 | 76144 | pOut->flags &= ~MEM_Static; |
| 76153 | 76145 | pOut->flags |= MEM_Ephem; |
| 76154 | 76146 | } |
| 76155 | 76147 | columnMallocFailure(pStmt); |
| 76156 | 76148 | return (sqlite3_value *)pOut; |
| 76157 | 76149 | } |
| 76158 | 76150 | #ifndef SQLITE_OMIT_UTF16 |
| 76159 | | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt *pStmt, int i){ |
| 76151 | +SQLITE_API const void *sqlite3_column_text16(sqlite3_stmt *pStmt, int i){ |
| 76160 | 76152 | const void *val = sqlite3_value_text16( columnMem(pStmt,i) ); |
| 76161 | 76153 | columnMallocFailure(pStmt); |
| 76162 | 76154 | return val; |
| 76163 | 76155 | } |
| 76164 | 76156 | #endif /* SQLITE_OMIT_UTF16 */ |
| 76165 | | -SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt *pStmt, int i){ |
| 76157 | +SQLITE_API int sqlite3_column_type(sqlite3_stmt *pStmt, int i){ |
| 76166 | 76158 | int iType = sqlite3_value_type( columnMem(pStmt,i) ); |
| 76167 | 76159 | columnMallocFailure(pStmt); |
| 76168 | 76160 | return iType; |
| 76169 | 76161 | } |
| 76170 | 76162 | |
| | @@ -76224,16 +76216,16 @@ |
| 76224 | 76216 | |
| 76225 | 76217 | /* |
| 76226 | 76218 | ** Return the name of the Nth column of the result set returned by SQL |
| 76227 | 76219 | ** statement pStmt. |
| 76228 | 76220 | */ |
| 76229 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt *pStmt, int N){ |
| 76221 | +SQLITE_API const char *sqlite3_column_name(sqlite3_stmt *pStmt, int N){ |
| 76230 | 76222 | return columnName( |
| 76231 | 76223 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_NAME); |
| 76232 | 76224 | } |
| 76233 | 76225 | #ifndef SQLITE_OMIT_UTF16 |
| 76234 | | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt *pStmt, int N){ |
| 76226 | +SQLITE_API const void *sqlite3_column_name16(sqlite3_stmt *pStmt, int N){ |
| 76235 | 76227 | return columnName( |
| 76236 | 76228 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_NAME); |
| 76237 | 76229 | } |
| 76238 | 76230 | #endif |
| 76239 | 76231 | |
| | @@ -76249,16 +76241,16 @@ |
| 76249 | 76241 | #ifndef SQLITE_OMIT_DECLTYPE |
| 76250 | 76242 | /* |
| 76251 | 76243 | ** Return the column declaration type (if applicable) of the 'i'th column |
| 76252 | 76244 | ** of the result set of SQL statement pStmt. |
| 76253 | 76245 | */ |
| 76254 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){ |
| 76246 | +SQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){ |
| 76255 | 76247 | return columnName( |
| 76256 | 76248 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DECLTYPE); |
| 76257 | 76249 | } |
| 76258 | 76250 | #ifndef SQLITE_OMIT_UTF16 |
| 76259 | | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){ |
| 76251 | +SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){ |
| 76260 | 76252 | return columnName( |
| 76261 | 76253 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DECLTYPE); |
| 76262 | 76254 | } |
| 76263 | 76255 | #endif /* SQLITE_OMIT_UTF16 */ |
| 76264 | 76256 | #endif /* SQLITE_OMIT_DECLTYPE */ |
| | @@ -76267,16 +76259,16 @@ |
| 76267 | 76259 | /* |
| 76268 | 76260 | ** Return the name of the database from which a result column derives. |
| 76269 | 76261 | ** NULL is returned if the result column is an expression or constant or |
| 76270 | 76262 | ** anything else which is not an unambiguous reference to a database column. |
| 76271 | 76263 | */ |
| 76272 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){ |
| 76264 | +SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){ |
| 76273 | 76265 | return columnName( |
| 76274 | 76266 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DATABASE); |
| 76275 | 76267 | } |
| 76276 | 76268 | #ifndef SQLITE_OMIT_UTF16 |
| 76277 | | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){ |
| 76269 | +SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){ |
| 76278 | 76270 | return columnName( |
| 76279 | 76271 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DATABASE); |
| 76280 | 76272 | } |
| 76281 | 76273 | #endif /* SQLITE_OMIT_UTF16 */ |
| 76282 | 76274 | |
| | @@ -76283,16 +76275,16 @@ |
| 76283 | 76275 | /* |
| 76284 | 76276 | ** Return the name of the table from which a result column derives. |
| 76285 | 76277 | ** NULL is returned if the result column is an expression or constant or |
| 76286 | 76278 | ** anything else which is not an unambiguous reference to a database column. |
| 76287 | 76279 | */ |
| 76288 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){ |
| 76280 | +SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){ |
| 76289 | 76281 | return columnName( |
| 76290 | 76282 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_TABLE); |
| 76291 | 76283 | } |
| 76292 | 76284 | #ifndef SQLITE_OMIT_UTF16 |
| 76293 | | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){ |
| 76285 | +SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){ |
| 76294 | 76286 | return columnName( |
| 76295 | 76287 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_TABLE); |
| 76296 | 76288 | } |
| 76297 | 76289 | #endif /* SQLITE_OMIT_UTF16 */ |
| 76298 | 76290 | |
| | @@ -76299,16 +76291,16 @@ |
| 76299 | 76291 | /* |
| 76300 | 76292 | ** Return the name of the table column from which a result column derives. |
| 76301 | 76293 | ** NULL is returned if the result column is an expression or constant or |
| 76302 | 76294 | ** anything else which is not an unambiguous reference to a database column. |
| 76303 | 76295 | */ |
| 76304 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){ |
| 76296 | +SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){ |
| 76305 | 76297 | return columnName( |
| 76306 | 76298 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_COLUMN); |
| 76307 | 76299 | } |
| 76308 | 76300 | #ifndef SQLITE_OMIT_UTF16 |
| 76309 | | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){ |
| 76301 | +SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){ |
| 76310 | 76302 | return columnName( |
| 76311 | 76303 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_COLUMN); |
| 76312 | 76304 | } |
| 76313 | 76305 | #endif /* SQLITE_OMIT_UTF16 */ |
| 76314 | 76306 | #endif /* SQLITE_ENABLE_COLUMN_METADATA */ |
| | @@ -76405,11 +76397,11 @@ |
| 76405 | 76397 | |
| 76406 | 76398 | |
| 76407 | 76399 | /* |
| 76408 | 76400 | ** Bind a blob value to an SQL statement variable. |
| 76409 | 76401 | */ |
| 76410 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob( |
| 76402 | +SQLITE_API int sqlite3_bind_blob( |
| 76411 | 76403 | sqlite3_stmt *pStmt, |
| 76412 | 76404 | int i, |
| 76413 | 76405 | const void *zData, |
| 76414 | 76406 | int nData, |
| 76415 | 76407 | void (*xDel)(void*) |
| | @@ -76417,11 +76409,11 @@ |
| 76417 | 76409 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 76418 | 76410 | if( nData<0 ) return SQLITE_MISUSE_BKPT; |
| 76419 | 76411 | #endif |
| 76420 | 76412 | return bindText(pStmt, i, zData, nData, xDel, 0); |
| 76421 | 76413 | } |
| 76422 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64( |
| 76414 | +SQLITE_API int sqlite3_bind_blob64( |
| 76423 | 76415 | sqlite3_stmt *pStmt, |
| 76424 | 76416 | int i, |
| 76425 | 76417 | const void *zData, |
| 76426 | 76418 | sqlite3_uint64 nData, |
| 76427 | 76419 | void (*xDel)(void*) |
| | @@ -76431,52 +76423,52 @@ |
| 76431 | 76423 | return invokeValueDestructor(zData, xDel, 0); |
| 76432 | 76424 | }else{ |
| 76433 | 76425 | return bindText(pStmt, i, zData, (int)nData, xDel, 0); |
| 76434 | 76426 | } |
| 76435 | 76427 | } |
| 76436 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){ |
| 76428 | +SQLITE_API int sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){ |
| 76437 | 76429 | int rc; |
| 76438 | 76430 | Vdbe *p = (Vdbe *)pStmt; |
| 76439 | 76431 | rc = vdbeUnbind(p, i); |
| 76440 | 76432 | if( rc==SQLITE_OK ){ |
| 76441 | 76433 | sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue); |
| 76442 | 76434 | sqlite3_mutex_leave(p->db->mutex); |
| 76443 | 76435 | } |
| 76444 | 76436 | return rc; |
| 76445 | 76437 | } |
| 76446 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){ |
| 76438 | +SQLITE_API int sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){ |
| 76447 | 76439 | return sqlite3_bind_int64(p, i, (i64)iValue); |
| 76448 | 76440 | } |
| 76449 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){ |
| 76441 | +SQLITE_API int sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){ |
| 76450 | 76442 | int rc; |
| 76451 | 76443 | Vdbe *p = (Vdbe *)pStmt; |
| 76452 | 76444 | rc = vdbeUnbind(p, i); |
| 76453 | 76445 | if( rc==SQLITE_OK ){ |
| 76454 | 76446 | sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue); |
| 76455 | 76447 | sqlite3_mutex_leave(p->db->mutex); |
| 76456 | 76448 | } |
| 76457 | 76449 | return rc; |
| 76458 | 76450 | } |
| 76459 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt *pStmt, int i){ |
| 76451 | +SQLITE_API int sqlite3_bind_null(sqlite3_stmt *pStmt, int i){ |
| 76460 | 76452 | int rc; |
| 76461 | 76453 | Vdbe *p = (Vdbe*)pStmt; |
| 76462 | 76454 | rc = vdbeUnbind(p, i); |
| 76463 | 76455 | if( rc==SQLITE_OK ){ |
| 76464 | 76456 | sqlite3_mutex_leave(p->db->mutex); |
| 76465 | 76457 | } |
| 76466 | 76458 | return rc; |
| 76467 | 76459 | } |
| 76468 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_text( |
| 76460 | +SQLITE_API int sqlite3_bind_text( |
| 76469 | 76461 | sqlite3_stmt *pStmt, |
| 76470 | 76462 | int i, |
| 76471 | 76463 | const char *zData, |
| 76472 | 76464 | int nData, |
| 76473 | 76465 | void (*xDel)(void*) |
| 76474 | 76466 | ){ |
| 76475 | 76467 | return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8); |
| 76476 | 76468 | } |
| 76477 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64( |
| 76469 | +SQLITE_API int sqlite3_bind_text64( |
| 76478 | 76470 | sqlite3_stmt *pStmt, |
| 76479 | 76471 | int i, |
| 76480 | 76472 | const char *zData, |
| 76481 | 76473 | sqlite3_uint64 nData, |
| 76482 | 76474 | void (*xDel)(void*), |
| | @@ -76489,21 +76481,21 @@ |
| 76489 | 76481 | if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE; |
| 76490 | 76482 | return bindText(pStmt, i, zData, (int)nData, xDel, enc); |
| 76491 | 76483 | } |
| 76492 | 76484 | } |
| 76493 | 76485 | #ifndef SQLITE_OMIT_UTF16 |
| 76494 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16( |
| 76486 | +SQLITE_API int sqlite3_bind_text16( |
| 76495 | 76487 | sqlite3_stmt *pStmt, |
| 76496 | 76488 | int i, |
| 76497 | 76489 | const void *zData, |
| 76498 | 76490 | int nData, |
| 76499 | 76491 | void (*xDel)(void*) |
| 76500 | 76492 | ){ |
| 76501 | 76493 | return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE); |
| 76502 | 76494 | } |
| 76503 | 76495 | #endif /* SQLITE_OMIT_UTF16 */ |
| 76504 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){ |
| 76496 | +SQLITE_API int sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){ |
| 76505 | 76497 | int rc; |
| 76506 | 76498 | switch( sqlite3_value_type((sqlite3_value*)pValue) ){ |
| 76507 | 76499 | case SQLITE_INTEGER: { |
| 76508 | 76500 | rc = sqlite3_bind_int64(pStmt, i, pValue->u.i); |
| 76509 | 76501 | break; |
| | @@ -76530,21 +76522,21 @@ |
| 76530 | 76522 | break; |
| 76531 | 76523 | } |
| 76532 | 76524 | } |
| 76533 | 76525 | return rc; |
| 76534 | 76526 | } |
| 76535 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){ |
| 76527 | +SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){ |
| 76536 | 76528 | int rc; |
| 76537 | 76529 | Vdbe *p = (Vdbe *)pStmt; |
| 76538 | 76530 | rc = vdbeUnbind(p, i); |
| 76539 | 76531 | if( rc==SQLITE_OK ){ |
| 76540 | 76532 | sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n); |
| 76541 | 76533 | sqlite3_mutex_leave(p->db->mutex); |
| 76542 | 76534 | } |
| 76543 | 76535 | return rc; |
| 76544 | 76536 | } |
| 76545 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){ |
| 76537 | +SQLITE_API int sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){ |
| 76546 | 76538 | int rc; |
| 76547 | 76539 | Vdbe *p = (Vdbe *)pStmt; |
| 76548 | 76540 | sqlite3_mutex_enter(p->db->mutex); |
| 76549 | 76541 | if( n>(u64)p->db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
| 76550 | 76542 | rc = SQLITE_TOOBIG; |
| | @@ -76559,11 +76551,11 @@ |
| 76559 | 76551 | |
| 76560 | 76552 | /* |
| 76561 | 76553 | ** Return the number of wildcards that can be potentially bound to. |
| 76562 | 76554 | ** This routine is added to support DBD::SQLite. |
| 76563 | 76555 | */ |
| 76564 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){ |
| 76556 | +SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){ |
| 76565 | 76557 | Vdbe *p = (Vdbe*)pStmt; |
| 76566 | 76558 | return p ? p->nVar : 0; |
| 76567 | 76559 | } |
| 76568 | 76560 | |
| 76569 | 76561 | /* |
| | @@ -76570,11 +76562,11 @@ |
| 76570 | 76562 | ** Return the name of a wildcard parameter. Return NULL if the index |
| 76571 | 76563 | ** is out of range or if the wildcard is unnamed. |
| 76572 | 76564 | ** |
| 76573 | 76565 | ** The result is always UTF-8. |
| 76574 | 76566 | */ |
| 76575 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){ |
| 76567 | +SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){ |
| 76576 | 76568 | Vdbe *p = (Vdbe*)pStmt; |
| 76577 | 76569 | if( p==0 || i<1 || i>p->nzVar ){ |
| 76578 | 76570 | return 0; |
| 76579 | 76571 | } |
| 76580 | 76572 | return p->azVar[i-1]; |
| | @@ -76598,11 +76590,11 @@ |
| 76598 | 76590 | } |
| 76599 | 76591 | } |
| 76600 | 76592 | } |
| 76601 | 76593 | return 0; |
| 76602 | 76594 | } |
| 76603 | | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){ |
| 76595 | +SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){ |
| 76604 | 76596 | return sqlite3VdbeParameterIndex((Vdbe*)pStmt, zName, sqlite3Strlen30(zName)); |
| 76605 | 76597 | } |
| 76606 | 76598 | |
| 76607 | 76599 | /* |
| 76608 | 76600 | ** Transfer all bindings from the first statement over to the second. |
| | @@ -76632,11 +76624,11 @@ |
| 76632 | 76624 | ** |
| 76633 | 76625 | ** If the two statements contain a different number of bindings, then |
| 76634 | 76626 | ** an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise |
| 76635 | 76627 | ** SQLITE_OK is returned. |
| 76636 | 76628 | */ |
| 76637 | | -SQLITE_API int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){ |
| 76629 | +SQLITE_API int sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){ |
| 76638 | 76630 | Vdbe *pFrom = (Vdbe*)pFromStmt; |
| 76639 | 76631 | Vdbe *pTo = (Vdbe*)pToStmt; |
| 76640 | 76632 | if( pFrom->nVar!=pTo->nVar ){ |
| 76641 | 76633 | return SQLITE_ERROR; |
| 76642 | 76634 | } |
| | @@ -76654,26 +76646,26 @@ |
| 76654 | 76646 | ** Return the sqlite3* database handle to which the prepared statement given |
| 76655 | 76647 | ** in the argument belongs. This is the same database handle that was |
| 76656 | 76648 | ** the first argument to the sqlite3_prepare() that was used to create |
| 76657 | 76649 | ** the statement in the first place. |
| 76658 | 76650 | */ |
| 76659 | | -SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt *pStmt){ |
| 76651 | +SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt *pStmt){ |
| 76660 | 76652 | return pStmt ? ((Vdbe*)pStmt)->db : 0; |
| 76661 | 76653 | } |
| 76662 | 76654 | |
| 76663 | 76655 | /* |
| 76664 | 76656 | ** Return true if the prepared statement is guaranteed to not modify the |
| 76665 | 76657 | ** database. |
| 76666 | 76658 | */ |
| 76667 | | -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt){ |
| 76659 | +SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt){ |
| 76668 | 76660 | return pStmt ? ((Vdbe*)pStmt)->readOnly : 1; |
| 76669 | 76661 | } |
| 76670 | 76662 | |
| 76671 | 76663 | /* |
| 76672 | 76664 | ** Return true if the prepared statement is in need of being reset. |
| 76673 | 76665 | */ |
| 76674 | | -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt *pStmt){ |
| 76666 | +SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt *pStmt){ |
| 76675 | 76667 | Vdbe *v = (Vdbe*)pStmt; |
| 76676 | 76668 | return v!=0 && v->pc>=0 && v->magic==VDBE_MAGIC_RUN; |
| 76677 | 76669 | } |
| 76678 | 76670 | |
| 76679 | 76671 | /* |
| | @@ -76680,11 +76672,11 @@ |
| 76680 | 76672 | ** Return a pointer to the next prepared statement after pStmt associated |
| 76681 | 76673 | ** with database connection pDb. If pStmt is NULL, return the first |
| 76682 | 76674 | ** prepared statement for the database connection. Return NULL if there |
| 76683 | 76675 | ** are no more. |
| 76684 | 76676 | */ |
| 76685 | | -SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){ |
| 76677 | +SQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){ |
| 76686 | 76678 | sqlite3_stmt *pNext; |
| 76687 | 76679 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 76688 | 76680 | if( !sqlite3SafetyCheckOk(pDb) ){ |
| 76689 | 76681 | (void)SQLITE_MISUSE_BKPT; |
| 76690 | 76682 | return 0; |
| | @@ -76701,11 +76693,11 @@ |
| 76701 | 76693 | } |
| 76702 | 76694 | |
| 76703 | 76695 | /* |
| 76704 | 76696 | ** Return the value of a status counter for a prepared statement |
| 76705 | 76697 | */ |
| 76706 | | -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){ |
| 76698 | +SQLITE_API int sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){ |
| 76707 | 76699 | Vdbe *pVdbe = (Vdbe*)pStmt; |
| 76708 | 76700 | u32 v; |
| 76709 | 76701 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 76710 | 76702 | if( !pStmt ){ |
| 76711 | 76703 | (void)SQLITE_MISUSE_BKPT; |
| | @@ -76718,11 +76710,11 @@ |
| 76718 | 76710 | } |
| 76719 | 76711 | |
| 76720 | 76712 | /* |
| 76721 | 76713 | ** Return the SQL associated with a prepared statement |
| 76722 | 76714 | */ |
| 76723 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt){ |
| 76715 | +SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt){ |
| 76724 | 76716 | Vdbe *p = (Vdbe *)pStmt; |
| 76725 | 76717 | return p ? p->zSql : 0; |
| 76726 | 76718 | } |
| 76727 | 76719 | |
| 76728 | 76720 | /* |
| | @@ -76732,11 +76724,11 @@ |
| 76732 | 76724 | ** freeing the returned string by passing it to sqlite3_free(). |
| 76733 | 76725 | ** |
| 76734 | 76726 | ** The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of |
| 76735 | 76727 | ** expanded bound parameters. |
| 76736 | 76728 | */ |
| 76737 | | -SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt){ |
| 76729 | +SQLITE_API char *sqlite3_expanded_sql(sqlite3_stmt *pStmt){ |
| 76738 | 76730 | #ifdef SQLITE_OMIT_TRACE |
| 76739 | 76731 | return 0; |
| 76740 | 76732 | #else |
| 76741 | 76733 | char *z = 0; |
| 76742 | 76734 | const char *zSql = sqlite3_sql(pStmt); |
| | @@ -76774,11 +76766,11 @@ |
| 76774 | 76766 | |
| 76775 | 76767 | /* |
| 76776 | 76768 | ** This function is called from within a pre-update callback to retrieve |
| 76777 | 76769 | ** a field of the row currently being updated or deleted. |
| 76778 | 76770 | */ |
| 76779 | | -SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppValue){ |
| 76771 | +SQLITE_API int sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppValue){ |
| 76780 | 76772 | PreUpdate *p = db->pPreUpdate; |
| 76781 | 76773 | int rc = SQLITE_OK; |
| 76782 | 76774 | |
| 76783 | 76775 | /* Test that this call is being made from within an SQLITE_DELETE or |
| 76784 | 76776 | ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */ |
| | @@ -76829,11 +76821,11 @@ |
| 76829 | 76821 | #ifdef SQLITE_ENABLE_PREUPDATE_HOOK |
| 76830 | 76822 | /* |
| 76831 | 76823 | ** This function is called from within a pre-update callback to retrieve |
| 76832 | 76824 | ** the number of columns in the row being updated, deleted or inserted. |
| 76833 | 76825 | */ |
| 76834 | | -SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *db){ |
| 76826 | +SQLITE_API int sqlite3_preupdate_count(sqlite3 *db){ |
| 76835 | 76827 | PreUpdate *p = db->pPreUpdate; |
| 76836 | 76828 | return (p ? p->keyinfo.nField : 0); |
| 76837 | 76829 | } |
| 76838 | 76830 | #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */ |
| 76839 | 76831 | |
| | @@ -76847,11 +76839,11 @@ |
| 76847 | 76839 | ** top-level trigger etc.). |
| 76848 | 76840 | ** |
| 76849 | 76841 | ** For the purposes of the previous paragraph, a foreign key CASCADE, SET NULL |
| 76850 | 76842 | ** or SET DEFAULT action is considered a trigger. |
| 76851 | 76843 | */ |
| 76852 | | -SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *db){ |
| 76844 | +SQLITE_API int sqlite3_preupdate_depth(sqlite3 *db){ |
| 76853 | 76845 | PreUpdate *p = db->pPreUpdate; |
| 76854 | 76846 | return (p ? p->v->nFrame : 0); |
| 76855 | 76847 | } |
| 76856 | 76848 | #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */ |
| 76857 | 76849 | |
| | @@ -76858,11 +76850,11 @@ |
| 76858 | 76850 | #ifdef SQLITE_ENABLE_PREUPDATE_HOOK |
| 76859 | 76851 | /* |
| 76860 | 76852 | ** This function is called from within a pre-update callback to retrieve |
| 76861 | 76853 | ** a field of the row currently being updated or inserted. |
| 76862 | 76854 | */ |
| 76863 | | -SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){ |
| 76855 | +SQLITE_API int sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){ |
| 76864 | 76856 | PreUpdate *p = db->pPreUpdate; |
| 76865 | 76857 | int rc = SQLITE_OK; |
| 76866 | 76858 | Mem *pMem; |
| 76867 | 76859 | |
| 76868 | 76860 | if( !p || p->op==SQLITE_DELETE ){ |
| | @@ -76878,11 +76870,11 @@ |
| 76878 | 76870 | /* For an INSERT, memory cell p->iNewReg contains the serialized record |
| 76879 | 76871 | ** that is being inserted. Deserialize it. */ |
| 76880 | 76872 | UnpackedRecord *pUnpack = p->pNewUnpacked; |
| 76881 | 76873 | if( !pUnpack ){ |
| 76882 | 76874 | Mem *pData = &p->v->aMem[p->iNewReg]; |
| 76883 | | - rc = sqlite3VdbeMemExpandBlob(pData); |
| 76875 | + rc = ExpandBlob(pData); |
| 76884 | 76876 | if( rc!=SQLITE_OK ) goto preupdate_new_out; |
| 76885 | 76877 | pUnpack = vdbeUnpackRecord(&p->keyinfo, pData->n, pData->z); |
| 76886 | 76878 | if( !pUnpack ){ |
| 76887 | 76879 | rc = SQLITE_NOMEM; |
| 76888 | 76880 | goto preupdate_new_out; |
| | @@ -76932,11 +76924,11 @@ |
| 76932 | 76924 | |
| 76933 | 76925 | #ifdef SQLITE_ENABLE_STMT_SCANSTATUS |
| 76934 | 76926 | /* |
| 76935 | 76927 | ** Return status data for a single loop within query pStmt. |
| 76936 | 76928 | */ |
| 76937 | | -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus( |
| 76929 | +SQLITE_API int sqlite3_stmt_scanstatus( |
| 76938 | 76930 | sqlite3_stmt *pStmt, /* Prepared statement being queried */ |
| 76939 | 76931 | int idx, /* Index of loop to report on */ |
| 76940 | 76932 | int iScanStatusOp, /* Which metric to return */ |
| 76941 | 76933 | void *pOut /* OUT: Write the answer here */ |
| 76942 | 76934 | ){ |
| | @@ -76991,11 +76983,11 @@ |
| 76991 | 76983 | } |
| 76992 | 76984 | |
| 76993 | 76985 | /* |
| 76994 | 76986 | ** Zero all counters associated with the sqlite3_stmt_scanstatus() data. |
| 76995 | 76987 | */ |
| 76996 | | -SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){ |
| 76988 | +SQLITE_API void sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){ |
| 76997 | 76989 | Vdbe *p = (Vdbe*)pStmt; |
| 76998 | 76990 | memset(p->anExec, 0, p->nOp * sizeof(i64)); |
| 76999 | 76991 | } |
| 77000 | 76992 | #endif /* SQLITE_ENABLE_STMT_SCANSTATUS */ |
| 77001 | 76993 | |
| | @@ -77518,11 +77510,11 @@ |
| 77518 | 77510 | ** Try to convert the type of a function argument or a result column |
| 77519 | 77511 | ** into a numeric representation. Use either INTEGER or REAL whichever |
| 77520 | 77512 | ** is appropriate. But only do the conversion if it is possible without |
| 77521 | 77513 | ** loss of information and return the revised type of the argument. |
| 77522 | 77514 | */ |
| 77523 | | -SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value *pVal){ |
| 77515 | +SQLITE_API int sqlite3_value_numeric_type(sqlite3_value *pVal){ |
| 77524 | 77516 | int eType = sqlite3_value_type(pVal); |
| 77525 | 77517 | if( eType==SQLITE_TEXT ){ |
| 77526 | 77518 | Mem *pMem = (Mem*)pVal; |
| 77527 | 77519 | applyNumericAffinity(pMem, 0); |
| 77528 | 77520 | eType = sqlite3_value_type(pVal); |
| | @@ -79344,12 +79336,11 @@ |
| 79344 | 79336 | testcase( pIn1->flags & MEM_Int ); |
| 79345 | 79337 | testcase( pIn1->flags & MEM_Real ); |
| 79346 | 79338 | sqlite3VdbeMemStringify(pIn1, encoding, 1); |
| 79347 | 79339 | testcase( (flags1&MEM_Dyn) != (pIn1->flags&MEM_Dyn) ); |
| 79348 | 79340 | flags1 = (pIn1->flags & ~MEM_TypeMask) | (flags1 & MEM_TypeMask); |
| 79349 | | - testcase( flags3!=pIn3->flags ); /* Possible if pIn1==pIn3 */ |
| 79350 | | - flags3 = pIn3->flags; |
| 79341 | + assert( pIn1!=pIn3 ); |
| 79351 | 79342 | } |
| 79352 | 79343 | if( (flags3 & MEM_Str)==0 && (flags3 & (MEM_Int|MEM_Real))!=0 ){ |
| 79353 | 79344 | testcase( pIn3->flags & MEM_Int ); |
| 79354 | 79345 | testcase( pIn3->flags & MEM_Real ); |
| 79355 | 79346 | sqlite3VdbeMemStringify(pIn3, encoding, 1); |
| | @@ -79409,15 +79400,15 @@ |
| 79409 | 79400 | break; |
| 79410 | 79401 | } |
| 79411 | 79402 | |
| 79412 | 79403 | /* Opcode: ElseNotEq * P2 * * * |
| 79413 | 79404 | ** |
| 79414 | | -** This opcode must immediately follow an Lt or Gt comparison operator. |
| 79415 | | -** If the operands in that previous comparison had been used with an Eq |
| 79416 | | -** operator and if the result of that Eq would be NULL or false (0), then |
| 79417 | | -** then jump to P2. If the result of comparing the two previous operands |
| 79418 | | -** using Eq would have been true (1), then fall through. |
| 79405 | +** This opcode must immediately follow an OP_Lt or OP_Gt comparison operator. |
| 79406 | +** If result of an OP_Eq comparison on the same two operands |
| 79407 | +** would have be NULL or false (0), then then jump to P2. |
| 79408 | +** If the result of an OP_Eq comparison on the two previous operands |
| 79409 | +** would have been true (1), then fall through. |
| 79419 | 79410 | */ |
| 79420 | 79411 | case OP_ElseNotEq: { /* same as TK_ESCAPE, jump */ |
| 79421 | 79412 | assert( pOp>aOp ); |
| 79422 | 79413 | assert( pOp[-1].opcode==OP_Lt || pOp[-1].opcode==OP_Gt ); |
| 79423 | 79414 | assert( pOp[-1].p5 & SQLITE_STOREP2 ); |
| | @@ -79620,26 +79611,22 @@ |
| 79620 | 79611 | break; |
| 79621 | 79612 | } |
| 79622 | 79613 | |
| 79623 | 79614 | /* Opcode: Once P1 P2 * * * |
| 79624 | 79615 | ** |
| 79625 | | -** Check the "once" flag number P1. If it is set, jump to instruction P2. |
| 79626 | | -** Otherwise, set the flag and fall through to the next instruction. |
| 79627 | | -** In other words, this opcode causes all following opcodes up through P2 |
| 79628 | | -** (but not including P2) to run just once and to be skipped on subsequent |
| 79629 | | -** times through the loop. |
| 79630 | | -** |
| 79631 | | -** All "once" flags are initially cleared whenever a prepared statement |
| 79632 | | -** first begins to run. |
| 79616 | +** If the P1 value is equal to the P1 value on the OP_Init opcode at |
| 79617 | +** instruction 0, then jump to P2. If the two P1 values differ, then |
| 79618 | +** set the P1 value on this opcode to equal the P1 value on the OP_Init |
| 79619 | +** and fall through. |
| 79633 | 79620 | */ |
| 79634 | 79621 | case OP_Once: { /* jump */ |
| 79635 | | - assert( pOp->p1<p->nOnceFlag ); |
| 79636 | | - VdbeBranchTaken(p->aOnceFlag[pOp->p1]!=0, 2); |
| 79637 | | - if( p->aOnceFlag[pOp->p1] ){ |
| 79622 | + assert( p->aOp[0].opcode==OP_Init ); |
| 79623 | + VdbeBranchTaken(p->aOp[0].p1==pOp->p1, 2); |
| 79624 | + if( p->aOp[0].p1==pOp->p1 ){ |
| 79638 | 79625 | goto jump_to_p2; |
| 79639 | 79626 | }else{ |
| 79640 | | - p->aOnceFlag[pOp->p1] = 1; |
| 79627 | + pOp->p1 = p->aOp[0].p1; |
| 79641 | 79628 | } |
| 79642 | 79629 | break; |
| 79643 | 79630 | } |
| 79644 | 79631 | |
| 79645 | 79632 | /* Opcode: If P1 P2 P3 * * |
| | @@ -80468,16 +80455,16 @@ |
| 80468 | 80455 | |
| 80469 | 80456 | if( pBt ){ |
| 80470 | 80457 | rc = sqlite3BtreeBeginTrans(pBt, pOp->p2); |
| 80471 | 80458 | testcase( rc==SQLITE_BUSY_SNAPSHOT ); |
| 80472 | 80459 | testcase( rc==SQLITE_BUSY_RECOVERY ); |
| 80473 | | - if( (rc&0xff)==SQLITE_BUSY ){ |
| 80474 | | - p->pc = (int)(pOp - aOp); |
| 80475 | | - p->rc = rc; |
| 80476 | | - goto vdbe_return; |
| 80477 | | - } |
| 80478 | 80460 | if( rc!=SQLITE_OK ){ |
| 80461 | + if( (rc&0xff)==SQLITE_BUSY ){ |
| 80462 | + p->pc = (int)(pOp - aOp); |
| 80463 | + p->rc = rc; |
| 80464 | + goto vdbe_return; |
| 80465 | + } |
| 80479 | 80466 | goto abort_due_to_error; |
| 80480 | 80467 | } |
| 80481 | 80468 | |
| 80482 | 80469 | if( pOp->p2 && p->usesStmtJournal |
| 80483 | 80470 | && (db->autoCommit==0 || db->nVdbeRead>1) |
| | @@ -81164,11 +81151,10 @@ |
| 81164 | 81151 | |
| 81165 | 81152 | r.aMem = &aMem[pOp->p3]; |
| 81166 | 81153 | #ifdef SQLITE_DEBUG |
| 81167 | 81154 | { int i; for(i=0; i<r.nField; i++) assert( memIsValid(&r.aMem[i]) ); } |
| 81168 | 81155 | #endif |
| 81169 | | - (void)ExpandBlob(r.aMem); |
| 81170 | 81156 | r.eqSeen = 0; |
| 81171 | 81157 | rc = sqlite3BtreeMovetoUnpacked(pC->uc.pCursor, &r, 0, 0, &res); |
| 81172 | 81158 | if( rc!=SQLITE_OK ){ |
| 81173 | 81159 | goto abort_due_to_error; |
| 81174 | 81160 | } |
| | @@ -81305,17 +81291,17 @@ |
| 81305 | 81291 | pFree = 0; |
| 81306 | 81292 | if( pOp->p4.i>0 ){ |
| 81307 | 81293 | r.pKeyInfo = pC->pKeyInfo; |
| 81308 | 81294 | r.nField = (u16)pOp->p4.i; |
| 81309 | 81295 | r.aMem = pIn3; |
| 81296 | +#ifdef SQLITE_DEBUG |
| 81310 | 81297 | for(ii=0; ii<r.nField; ii++){ |
| 81311 | 81298 | assert( memIsValid(&r.aMem[ii]) ); |
| 81312 | | - (void)ExpandBlob(&r.aMem[ii]); |
| 81313 | | -#ifdef SQLITE_DEBUG |
| 81299 | + assert( (r.aMem[ii].flags & MEM_Zero)==0 || r.aMem[ii].n==0 ); |
| 81314 | 81300 | if( ii ) REGISTER_TRACE(pOp->p3+ii, &r.aMem[ii]); |
| 81301 | + } |
| 81315 | 81302 | #endif |
| 81316 | | - } |
| 81317 | 81303 | pIdxKey = &r; |
| 81318 | 81304 | }else{ |
| 81319 | 81305 | pIdxKey = sqlite3VdbeAllocUnpackedRecord( |
| 81320 | 81306 | pC->pKeyInfo, aTempRec, sizeof(aTempRec), &pFree |
| 81321 | 81307 | ); |
| | @@ -83078,12 +83064,11 @@ |
| 83078 | 83064 | nMem = pProgram->nMem + pProgram->nCsr; |
| 83079 | 83065 | assert( nMem>0 ); |
| 83080 | 83066 | if( pProgram->nCsr==0 ) nMem++; |
| 83081 | 83067 | nByte = ROUND8(sizeof(VdbeFrame)) |
| 83082 | 83068 | + nMem * sizeof(Mem) |
| 83083 | | - + pProgram->nCsr * sizeof(VdbeCursor *) |
| 83084 | | - + pProgram->nOnce * sizeof(u8); |
| 83069 | + + pProgram->nCsr * sizeof(VdbeCursor *); |
| 83085 | 83070 | pFrame = sqlite3DbMallocZero(db, nByte); |
| 83086 | 83071 | if( !pFrame ){ |
| 83087 | 83072 | goto no_mem; |
| 83088 | 83073 | } |
| 83089 | 83074 | sqlite3VdbeMemRelease(pRt); |
| | @@ -83099,12 +83084,10 @@ |
| 83099 | 83084 | pFrame->apCsr = p->apCsr; |
| 83100 | 83085 | pFrame->nCursor = p->nCursor; |
| 83101 | 83086 | pFrame->aOp = p->aOp; |
| 83102 | 83087 | pFrame->nOp = p->nOp; |
| 83103 | 83088 | pFrame->token = pProgram->token; |
| 83104 | | - pFrame->aOnceFlag = p->aOnceFlag; |
| 83105 | | - pFrame->nOnceFlag = p->nOnceFlag; |
| 83106 | 83089 | #ifdef SQLITE_ENABLE_STMT_SCANSTATUS |
| 83107 | 83090 | pFrame->anExec = p->anExec; |
| 83108 | 83091 | #endif |
| 83109 | 83092 | |
| 83110 | 83093 | pEnd = &VdbeFrameMem(pFrame)[pFrame->nChildMem]; |
| | @@ -83134,17 +83117,14 @@ |
| 83134 | 83117 | p->nMem = pFrame->nChildMem; |
| 83135 | 83118 | p->nCursor = (u16)pFrame->nChildCsr; |
| 83136 | 83119 | p->apCsr = (VdbeCursor **)&aMem[p->nMem]; |
| 83137 | 83120 | p->aOp = aOp = pProgram->aOp; |
| 83138 | 83121 | p->nOp = pProgram->nOp; |
| 83139 | | - p->aOnceFlag = (u8 *)&p->apCsr[p->nCursor]; |
| 83140 | | - p->nOnceFlag = pProgram->nOnce; |
| 83141 | 83122 | #ifdef SQLITE_ENABLE_STMT_SCANSTATUS |
| 83142 | 83123 | p->anExec = 0; |
| 83143 | 83124 | #endif |
| 83144 | 83125 | pOp = &aOp[-1]; |
| 83145 | | - memset(p->aOnceFlag, 0, p->nOnceFlag); |
| 83146 | 83126 | |
| 83147 | 83127 | break; |
| 83148 | 83128 | } |
| 83149 | 83129 | |
| 83150 | 83130 | /* Opcode: Param P1 P2 * * * |
| | @@ -84107,11 +84087,11 @@ |
| 84107 | 84087 | break; |
| 84108 | 84088 | } |
| 84109 | 84089 | #endif |
| 84110 | 84090 | |
| 84111 | 84091 | |
| 84112 | | -/* Opcode: Init * P2 * P4 * |
| 84092 | +/* Opcode: Init P1 P2 * P4 * |
| 84113 | 84093 | ** Synopsis: Start at P2 |
| 84114 | 84094 | ** |
| 84115 | 84095 | ** Programs contain a single instance of this opcode as the very first |
| 84116 | 84096 | ** opcode. |
| 84117 | 84097 | ** |
| | @@ -84118,13 +84098,17 @@ |
| 84118 | 84098 | ** If tracing is enabled (by the sqlite3_trace()) interface, then |
| 84119 | 84099 | ** the UTF-8 string contained in P4 is emitted on the trace callback. |
| 84120 | 84100 | ** Or if P4 is blank, use the string returned by sqlite3_sql(). |
| 84121 | 84101 | ** |
| 84122 | 84102 | ** If P2 is not zero, jump to instruction P2. |
| 84103 | +** |
| 84104 | +** Increment the value of P1 so that OP_Once opcodes will jump the |
| 84105 | +** first time they are evaluated for this run. |
| 84123 | 84106 | */ |
| 84124 | 84107 | case OP_Init: { /* jump */ |
| 84125 | 84108 | char *zTrace; |
| 84109 | + int i; |
| 84126 | 84110 | |
| 84127 | 84111 | /* If the P4 argument is not NULL, then it must be an SQL comment string. |
| 84128 | 84112 | ** The "--" string is broken up to prevent false-positives with srcck1.c. |
| 84129 | 84113 | ** |
| 84130 | 84114 | ** This assert() provides evidence for: |
| | @@ -84132,10 +84116,11 @@ |
| 84132 | 84116 | ** would have been returned by the legacy sqlite3_trace() interface by |
| 84133 | 84117 | ** using the X argument when X begins with "--" and invoking |
| 84134 | 84118 | ** sqlite3_expanded_sql(P) otherwise. |
| 84135 | 84119 | */ |
| 84136 | 84120 | assert( pOp->p4.z==0 || strncmp(pOp->p4.z, "-" "- ", 3)==0 ); |
| 84121 | + assert( pOp==p->aOp ); /* Always instruction 0 */ |
| 84137 | 84122 | |
| 84138 | 84123 | #ifndef SQLITE_OMIT_TRACE |
| 84139 | 84124 | if( (db->mTrace & (SQLITE_TRACE_STMT|SQLITE_TRACE_LEGACY))!=0 |
| 84140 | 84125 | && !p->doingRerun |
| 84141 | 84126 | && (zTrace = (pOp->p4.z ? pOp->p4.z : p->zSql))!=0 |
| | @@ -84153,14 +84138,14 @@ |
| 84153 | 84138 | } |
| 84154 | 84139 | } |
| 84155 | 84140 | #ifdef SQLITE_USE_FCNTL_TRACE |
| 84156 | 84141 | zTrace = (pOp->p4.z ? pOp->p4.z : p->zSql); |
| 84157 | 84142 | if( zTrace ){ |
| 84158 | | - int i; |
| 84159 | | - for(i=0; i<db->nDb; i++){ |
| 84160 | | - if( DbMaskTest(p->btreeMask, i)==0 ) continue; |
| 84161 | | - sqlite3_file_control(db, db->aDb[i].zDbSName, SQLITE_FCNTL_TRACE, zTrace); |
| 84143 | + int j; |
| 84144 | + for(j=0; j<db->nDb; j++){ |
| 84145 | + if( DbMaskTest(p->btreeMask, j)==0 ) continue; |
| 84146 | + sqlite3_file_control(db, db->aDb[j].zDbSName, SQLITE_FCNTL_TRACE, zTrace); |
| 84162 | 84147 | } |
| 84163 | 84148 | } |
| 84164 | 84149 | #endif /* SQLITE_USE_FCNTL_TRACE */ |
| 84165 | 84150 | #ifdef SQLITE_DEBUG |
| 84166 | 84151 | if( (db->flags & SQLITE_SqlTrace)!=0 |
| | @@ -84169,10 +84154,17 @@ |
| 84169 | 84154 | sqlite3DebugPrintf("SQL-trace: %s\n", zTrace); |
| 84170 | 84155 | } |
| 84171 | 84156 | #endif /* SQLITE_DEBUG */ |
| 84172 | 84157 | #endif /* SQLITE_OMIT_TRACE */ |
| 84173 | 84158 | assert( pOp->p2>0 ); |
| 84159 | + if( pOp->p1>=sqlite3GlobalConfig.iOnceResetThreshold ){ |
| 84160 | + for(i=1; i<p->nOp; i++){ |
| 84161 | + if( p->aOp[i].opcode==OP_Once ) p->aOp[i].p1 = 0; |
| 84162 | + } |
| 84163 | + pOp->p1 = 0; |
| 84164 | + } |
| 84165 | + pOp->p1++; |
| 84174 | 84166 | goto jump_to_p2; |
| 84175 | 84167 | } |
| 84176 | 84168 | |
| 84177 | 84169 | #ifdef SQLITE_ENABLE_CURSOR_HINTS |
| 84178 | 84170 | /* Opcode: CursorHint P1 * * P4 * |
| | @@ -84422,11 +84414,11 @@ |
| 84422 | 84414 | } |
| 84423 | 84415 | |
| 84424 | 84416 | /* |
| 84425 | 84417 | ** Open a blob handle. |
| 84426 | 84418 | */ |
| 84427 | | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_open( |
| 84419 | +SQLITE_API int sqlite3_blob_open( |
| 84428 | 84420 | sqlite3* db, /* The database connection */ |
| 84429 | 84421 | const char *zDb, /* The attached database containing the blob */ |
| 84430 | 84422 | const char *zTable, /* The table containing the blob */ |
| 84431 | 84423 | const char *zColumn, /* The column containing the blob */ |
| 84432 | 84424 | sqlite_int64 iRow, /* The row containing the glob */ |
| | @@ -84663,11 +84655,11 @@ |
| 84663 | 84655 | |
| 84664 | 84656 | /* |
| 84665 | 84657 | ** Close a blob handle that was previously created using |
| 84666 | 84658 | ** sqlite3_blob_open(). |
| 84667 | 84659 | */ |
| 84668 | | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *pBlob){ |
| 84660 | +SQLITE_API int sqlite3_blob_close(sqlite3_blob *pBlob){ |
| 84669 | 84661 | Incrblob *p = (Incrblob *)pBlob; |
| 84670 | 84662 | int rc; |
| 84671 | 84663 | sqlite3 *db; |
| 84672 | 84664 | |
| 84673 | 84665 | if( p ){ |
| | @@ -84756,28 +84748,28 @@ |
| 84756 | 84748 | } |
| 84757 | 84749 | |
| 84758 | 84750 | /* |
| 84759 | 84751 | ** Read data from a blob handle. |
| 84760 | 84752 | */ |
| 84761 | | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){ |
| 84753 | +SQLITE_API int sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){ |
| 84762 | 84754 | return blobReadWrite(pBlob, z, n, iOffset, sqlite3BtreeData); |
| 84763 | 84755 | } |
| 84764 | 84756 | |
| 84765 | 84757 | /* |
| 84766 | 84758 | ** Write data to a blob handle. |
| 84767 | 84759 | */ |
| 84768 | | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){ |
| 84760 | +SQLITE_API int sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){ |
| 84769 | 84761 | return blobReadWrite(pBlob, (void *)z, n, iOffset, sqlite3BtreePutData); |
| 84770 | 84762 | } |
| 84771 | 84763 | |
| 84772 | 84764 | /* |
| 84773 | 84765 | ** Query a blob handle for the size of the data. |
| 84774 | 84766 | ** |
| 84775 | 84767 | ** The Incrblob.nByte field is fixed for the lifetime of the Incrblob |
| 84776 | 84768 | ** so no mutex is required for access. |
| 84777 | 84769 | */ |
| 84778 | | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *pBlob){ |
| 84770 | +SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *pBlob){ |
| 84779 | 84771 | Incrblob *p = (Incrblob *)pBlob; |
| 84780 | 84772 | return (p && p->pStmt) ? p->nByte : 0; |
| 84781 | 84773 | } |
| 84782 | 84774 | |
| 84783 | 84775 | /* |
| | @@ -84788,11 +84780,11 @@ |
| 84788 | 84780 | ** contain a blob or text value, then an error code is returned and the |
| 84789 | 84781 | ** database handle error code and message set. If this happens, then all |
| 84790 | 84782 | ** subsequent calls to sqlite3_blob_xxx() functions (except blob_close()) |
| 84791 | 84783 | ** immediately return SQLITE_ABORT. |
| 84792 | 84784 | */ |
| 84793 | | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){ |
| 84785 | +SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){ |
| 84794 | 84786 | int rc; |
| 84795 | 84787 | Incrblob *p = (Incrblob *)pBlob; |
| 84796 | 84788 | sqlite3 *db; |
| 84797 | 84789 | |
| 84798 | 84790 | if( p==0 ) return SQLITE_MISUSE_BKPT; |
| | @@ -88049,11 +88041,11 @@ |
| 88049 | 88041 | if( rc || ExprHasProperty(pExpr,EP_TokenOnly) ) return rc & WRC_Abort; |
| 88050 | 88042 | if( pExpr->pLeft && walkExpr(pWalker, pExpr->pLeft) ) return WRC_Abort; |
| 88051 | 88043 | if( pExpr->pRight && walkExpr(pWalker, pExpr->pRight) ) return WRC_Abort; |
| 88052 | 88044 | if( ExprHasProperty(pExpr, EP_xIsSelect) ){ |
| 88053 | 88045 | if( sqlite3WalkSelect(pWalker, pExpr->x.pSelect) ) return WRC_Abort; |
| 88054 | | - }else{ |
| 88046 | + }else if( pExpr->x.pList ){ |
| 88055 | 88047 | if( sqlite3WalkExprList(pWalker, pExpr->x.pList) ) return WRC_Abort; |
| 88056 | 88048 | } |
| 88057 | 88049 | return WRC_Continue; |
| 88058 | 88050 | } |
| 88059 | 88051 | SQLITE_PRIVATE int sqlite3WalkExpr(Walker *pWalker, Expr *pExpr){ |
| | @@ -88811,11 +88803,10 @@ |
| 88811 | 88803 | ExprList *pList = pExpr->x.pList; /* The argument list */ |
| 88812 | 88804 | int n = pList ? pList->nExpr : 0; /* Number of arguments */ |
| 88813 | 88805 | int no_such_func = 0; /* True if no such function exists */ |
| 88814 | 88806 | int wrong_num_args = 0; /* True if wrong number of arguments */ |
| 88815 | 88807 | int is_agg = 0; /* True if is an aggregate function */ |
| 88816 | | - int auth; /* Authorization to use the function */ |
| 88817 | 88808 | int nId; /* Number of characters in function name */ |
| 88818 | 88809 | const char *zId; /* The function name. */ |
| 88819 | 88810 | FuncDef *pDef; /* Information about the function */ |
| 88820 | 88811 | u8 enc = ENC(pParse->db); /* The database encoding */ |
| 88821 | 88812 | |
| | @@ -88855,19 +88846,21 @@ |
| 88855 | 88846 | /* TUNING: unlikely() probability is 0.0625. likely() is 0.9375 */ |
| 88856 | 88847 | pExpr->iTable = pDef->zName[0]=='u' ? 8388608 : 125829120; |
| 88857 | 88848 | } |
| 88858 | 88849 | } |
| 88859 | 88850 | #ifndef SQLITE_OMIT_AUTHORIZATION |
| 88860 | | - auth = sqlite3AuthCheck(pParse, SQLITE_FUNCTION, 0, pDef->zName, 0); |
| 88861 | | - if( auth!=SQLITE_OK ){ |
| 88862 | | - if( auth==SQLITE_DENY ){ |
| 88863 | | - sqlite3ErrorMsg(pParse, "not authorized to use function: %s", |
| 88864 | | - pDef->zName); |
| 88865 | | - pNC->nErr++; |
| 88866 | | - } |
| 88867 | | - pExpr->op = TK_NULL; |
| 88868 | | - return WRC_Prune; |
| 88851 | + { |
| 88852 | + int auth = sqlite3AuthCheck(pParse, SQLITE_FUNCTION, 0,pDef->zName,0); |
| 88853 | + if( auth!=SQLITE_OK ){ |
| 88854 | + if( auth==SQLITE_DENY ){ |
| 88855 | + sqlite3ErrorMsg(pParse, "not authorized to use function: %s", |
| 88856 | + pDef->zName); |
| 88857 | + pNC->nErr++; |
| 88858 | + } |
| 88859 | + pExpr->op = TK_NULL; |
| 88860 | + return WRC_Prune; |
| 88861 | + } |
| 88869 | 88862 | } |
| 88870 | 88863 | #endif |
| 88871 | 88864 | if( pDef->funcFlags & (SQLITE_FUNC_CONSTANT|SQLITE_FUNC_SLOCHNG) ){ |
| 88872 | 88865 | /* For the purposes of the EP_ConstFunc flag, date and time |
| 88873 | 88866 | ** functions and other functions that change slowly are considered |
| | @@ -91664,19 +91657,10 @@ |
| 91664 | 91657 | } |
| 91665 | 91658 | return p; |
| 91666 | 91659 | } |
| 91667 | 91660 | #endif /* SQLITE_OMIT_SUBQUERY */ |
| 91668 | 91661 | |
| 91669 | | -/* |
| 91670 | | -** Code an OP_Once instruction and allocate space for its flag. Return the |
| 91671 | | -** address of the new instruction. |
| 91672 | | -*/ |
| 91673 | | -SQLITE_PRIVATE int sqlite3CodeOnce(Parse *pParse){ |
| 91674 | | - Vdbe *v = sqlite3GetVdbe(pParse); /* Virtual machine being coded */ |
| 91675 | | - return sqlite3VdbeAddOp1(v, OP_Once, pParse->nOnce++); |
| 91676 | | -} |
| 91677 | | - |
| 91678 | 91662 | #ifndef SQLITE_OMIT_SUBQUERY |
| 91679 | 91663 | /* |
| 91680 | 91664 | ** Generate code that checks the left-most column of index table iCur to see if |
| 91681 | 91665 | ** it contains any NULL entries. Cause the register at regHasNull to be set |
| 91682 | 91666 | ** to a non-NULL value if iCur contains no NULLs. Cause register regHasNull |
| | @@ -91846,11 +91830,11 @@ |
| 91846 | 91830 | sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName); |
| 91847 | 91831 | |
| 91848 | 91832 | assert(v); /* sqlite3GetVdbe() has always been previously called */ |
| 91849 | 91833 | if( nExpr==1 && pEList->a[0].pExpr->iColumn<0 ){ |
| 91850 | 91834 | /* The "x IN (SELECT rowid FROM table)" case */ |
| 91851 | | - int iAddr = sqlite3CodeOnce(pParse); |
| 91835 | + int iAddr = sqlite3VdbeAddOp0(v, OP_Once); |
| 91852 | 91836 | VdbeCoverage(v); |
| 91853 | 91837 | |
| 91854 | 91838 | sqlite3OpenTable(pParse, iTab, iDb, pTab, OP_OpenRead); |
| 91855 | 91839 | eType = IN_INDEX_ROWID; |
| 91856 | 91840 | |
| | @@ -91929,11 +91913,11 @@ |
| 91929 | 91913 | } |
| 91930 | 91914 | |
| 91931 | 91915 | assert( i==nExpr || colUsed!=(MASKBIT(nExpr)-1) ); |
| 91932 | 91916 | if( colUsed==(MASKBIT(nExpr)-1) ){ |
| 91933 | 91917 | /* If we reach this point, that means the index pIdx is usable */ |
| 91934 | | - int iAddr = sqlite3CodeOnce(pParse); VdbeCoverage(v); |
| 91918 | + int iAddr = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v); |
| 91935 | 91919 | #ifndef SQLITE_OMIT_EXPLAIN |
| 91936 | 91920 | sqlite3VdbeAddOp4(v, OP_Explain, 0, 0, 0, |
| 91937 | 91921 | sqlite3MPrintf(db, "USING INDEX %s FOR IN-OPERATOR",pIdx->zName), |
| 91938 | 91922 | P4_DYNAMIC); |
| 91939 | 91923 | #endif |
| | @@ -92104,11 +92088,11 @@ |
| 92104 | 92088 | ** |
| 92105 | 92089 | ** If all of the above are false, then we can run this code just once |
| 92106 | 92090 | ** save the results, and reuse the same result on subsequent invocations. |
| 92107 | 92091 | */ |
| 92108 | 92092 | if( !ExprHasProperty(pExpr, EP_VarSelect) ){ |
| 92109 | | - jmpIfDynamic = sqlite3CodeOnce(pParse); VdbeCoverage(v); |
| 92093 | + jmpIfDynamic = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v); |
| 92110 | 92094 | } |
| 92111 | 92095 | |
| 92112 | 92096 | #ifndef SQLITE_OMIT_EXPLAIN |
| 92113 | 92097 | if( pParse->explain==2 ){ |
| 92114 | 92098 | char *zMsg = sqlite3MPrintf(pParse->db, "EXECUTE %s%s SUBQUERY %d", |
| | @@ -93044,11 +93028,10 @@ |
| 93044 | 93028 | int op; /* The opcode being coded */ |
| 93045 | 93029 | int inReg = target; /* Results stored in register inReg */ |
| 93046 | 93030 | int regFree1 = 0; /* If non-zero free this temporary register */ |
| 93047 | 93031 | int regFree2 = 0; /* If non-zero free this temporary register */ |
| 93048 | 93032 | int r1, r2; /* Various register numbers */ |
| 93049 | | - sqlite3 *db = pParse->db; /* The database connection */ |
| 93050 | 93033 | Expr tempX; /* Temporary expression node */ |
| 93051 | 93034 | int p5 = 0; |
| 93052 | 93035 | |
| 93053 | 93036 | assert( target>0 && target<=pParse->nMem ); |
| 93054 | 93037 | if( v==0 ){ |
| | @@ -93065,56 +93048,53 @@ |
| 93065 | 93048 | case TK_AGG_COLUMN: { |
| 93066 | 93049 | AggInfo *pAggInfo = pExpr->pAggInfo; |
| 93067 | 93050 | struct AggInfo_col *pCol = &pAggInfo->aCol[pExpr->iAgg]; |
| 93068 | 93051 | if( !pAggInfo->directMode ){ |
| 93069 | 93052 | assert( pCol->iMem>0 ); |
| 93070 | | - inReg = pCol->iMem; |
| 93071 | | - break; |
| 93053 | + return pCol->iMem; |
| 93072 | 93054 | }else if( pAggInfo->useSortingIdx ){ |
| 93073 | 93055 | sqlite3VdbeAddOp3(v, OP_Column, pAggInfo->sortingIdxPTab, |
| 93074 | 93056 | pCol->iSorterColumn, target); |
| 93075 | | - break; |
| 93057 | + return target; |
| 93076 | 93058 | } |
| 93077 | 93059 | /* Otherwise, fall thru into the TK_COLUMN case */ |
| 93078 | 93060 | } |
| 93079 | 93061 | case TK_COLUMN: { |
| 93080 | 93062 | int iTab = pExpr->iTable; |
| 93081 | 93063 | if( iTab<0 ){ |
| 93082 | 93064 | if( pParse->ckBase>0 ){ |
| 93083 | 93065 | /* Generating CHECK constraints or inserting into partial index */ |
| 93084 | | - inReg = pExpr->iColumn + pParse->ckBase; |
| 93085 | | - break; |
| 93066 | + return pExpr->iColumn + pParse->ckBase; |
| 93086 | 93067 | }else{ |
| 93087 | 93068 | /* Coding an expression that is part of an index where column names |
| 93088 | 93069 | ** in the index refer to the table to which the index belongs */ |
| 93089 | 93070 | iTab = pParse->iSelfTab; |
| 93090 | 93071 | } |
| 93091 | 93072 | } |
| 93092 | | - inReg = sqlite3ExprCodeGetColumn(pParse, pExpr->pTab, |
| 93073 | + return sqlite3ExprCodeGetColumn(pParse, pExpr->pTab, |
| 93093 | 93074 | pExpr->iColumn, iTab, target, |
| 93094 | 93075 | pExpr->op2); |
| 93095 | | - break; |
| 93096 | 93076 | } |
| 93097 | 93077 | case TK_INTEGER: { |
| 93098 | 93078 | codeInteger(pParse, pExpr, 0, target); |
| 93099 | | - break; |
| 93079 | + return target; |
| 93100 | 93080 | } |
| 93101 | 93081 | #ifndef SQLITE_OMIT_FLOATING_POINT |
| 93102 | 93082 | case TK_FLOAT: { |
| 93103 | 93083 | assert( !ExprHasProperty(pExpr, EP_IntValue) ); |
| 93104 | 93084 | codeReal(v, pExpr->u.zToken, 0, target); |
| 93105 | | - break; |
| 93085 | + return target; |
| 93106 | 93086 | } |
| 93107 | 93087 | #endif |
| 93108 | 93088 | case TK_STRING: { |
| 93109 | 93089 | assert( !ExprHasProperty(pExpr, EP_IntValue) ); |
| 93110 | 93090 | sqlite3VdbeLoadString(v, target, pExpr->u.zToken); |
| 93111 | | - break; |
| 93091 | + return target; |
| 93112 | 93092 | } |
| 93113 | 93093 | case TK_NULL: { |
| 93114 | 93094 | sqlite3VdbeAddOp2(v, OP_Null, 0, target); |
| 93115 | | - break; |
| 93095 | + return target; |
| 93116 | 93096 | } |
| 93117 | 93097 | #ifndef SQLITE_OMIT_BLOB_LITERAL |
| 93118 | 93098 | case TK_BLOB: { |
| 93119 | 93099 | int n; |
| 93120 | 93100 | const char *z; |
| | @@ -93125,11 +93105,11 @@ |
| 93125 | 93105 | z = &pExpr->u.zToken[2]; |
| 93126 | 93106 | n = sqlite3Strlen30(z) - 1; |
| 93127 | 93107 | assert( z[n]=='\'' ); |
| 93128 | 93108 | zBlob = sqlite3HexToBlob(sqlite3VdbeDb(v), z, n); |
| 93129 | 93109 | sqlite3VdbeAddOp4(v, OP_Blob, n/2, target, 0, zBlob, P4_DYNAMIC); |
| 93130 | | - break; |
| 93110 | + return target; |
| 93131 | 93111 | } |
| 93132 | 93112 | #endif |
| 93133 | 93113 | case TK_VARIABLE: { |
| 93134 | 93114 | assert( !ExprHasProperty(pExpr, EP_IntValue) ); |
| 93135 | 93115 | assert( pExpr->u.zToken!=0 ); |
| | @@ -93138,15 +93118,14 @@ |
| 93138 | 93118 | if( pExpr->u.zToken[1]!=0 ){ |
| 93139 | 93119 | assert( pExpr->u.zToken[0]=='?' |
| 93140 | 93120 | || strcmp(pExpr->u.zToken, pParse->azVar[pExpr->iColumn-1])==0 ); |
| 93141 | 93121 | sqlite3VdbeChangeP4(v, -1, pParse->azVar[pExpr->iColumn-1], P4_STATIC); |
| 93142 | 93122 | } |
| 93143 | | - break; |
| 93123 | + return target; |
| 93144 | 93124 | } |
| 93145 | 93125 | case TK_REGISTER: { |
| 93146 | | - inReg = pExpr->iTable; |
| 93147 | | - break; |
| 93126 | + return pExpr->iTable; |
| 93148 | 93127 | } |
| 93149 | 93128 | #ifndef SQLITE_OMIT_CAST |
| 93150 | 93129 | case TK_CAST: { |
| 93151 | 93130 | /* Expressions of the form: CAST(pLeft AS token) */ |
| 93152 | 93131 | inReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target); |
| | @@ -93156,11 +93135,11 @@ |
| 93156 | 93135 | } |
| 93157 | 93136 | sqlite3VdbeAddOp2(v, OP_Cast, target, |
| 93158 | 93137 | sqlite3AffinityType(pExpr->u.zToken, 0)); |
| 93159 | 93138 | testcase( usedAsColumnCache(pParse, inReg, inReg) ); |
| 93160 | 93139 | sqlite3ExprCacheAffinityChange(pParse, inReg, 1); |
| 93161 | | - break; |
| 93140 | + return inReg; |
| 93162 | 93141 | } |
| 93163 | 93142 | #endif /* SQLITE_OMIT_CAST */ |
| 93164 | 93143 | case TK_IS: |
| 93165 | 93144 | case TK_ISNOT: |
| 93166 | 93145 | op = (op==TK_IS) ? TK_EQ : TK_NE; |
| | @@ -93224,14 +93203,16 @@ |
| 93224 | 93203 | case TK_UMINUS: { |
| 93225 | 93204 | Expr *pLeft = pExpr->pLeft; |
| 93226 | 93205 | assert( pLeft ); |
| 93227 | 93206 | if( pLeft->op==TK_INTEGER ){ |
| 93228 | 93207 | codeInteger(pParse, pLeft, 1, target); |
| 93208 | + return target; |
| 93229 | 93209 | #ifndef SQLITE_OMIT_FLOATING_POINT |
| 93230 | 93210 | }else if( pLeft->op==TK_FLOAT ){ |
| 93231 | 93211 | assert( !ExprHasProperty(pExpr, EP_IntValue) ); |
| 93232 | 93212 | codeReal(v, pLeft->u.zToken, 1, target); |
| 93213 | + return target; |
| 93233 | 93214 | #endif |
| 93234 | 93215 | }else{ |
| 93235 | 93216 | tempX.op = TK_INTEGER; |
| 93236 | 93217 | tempX.flags = EP_IntValue|EP_TokenOnly; |
| 93237 | 93218 | tempX.u.iValue = 0; |
| | @@ -93238,20 +93219,18 @@ |
| 93238 | 93219 | r1 = sqlite3ExprCodeTemp(pParse, &tempX, ®Free1); |
| 93239 | 93220 | r2 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, ®Free2); |
| 93240 | 93221 | sqlite3VdbeAddOp3(v, OP_Subtract, r2, r1, target); |
| 93241 | 93222 | testcase( regFree2==0 ); |
| 93242 | 93223 | } |
| 93243 | | - inReg = target; |
| 93244 | 93224 | break; |
| 93245 | 93225 | } |
| 93246 | 93226 | case TK_BITNOT: |
| 93247 | 93227 | case TK_NOT: { |
| 93248 | 93228 | assert( TK_BITNOT==OP_BitNot ); testcase( op==TK_BITNOT ); |
| 93249 | 93229 | assert( TK_NOT==OP_Not ); testcase( op==TK_NOT ); |
| 93250 | 93230 | r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, ®Free1); |
| 93251 | 93231 | testcase( regFree1==0 ); |
| 93252 | | - inReg = target; |
| 93253 | 93232 | sqlite3VdbeAddOp2(v, op, r1, inReg); |
| 93254 | 93233 | break; |
| 93255 | 93234 | } |
| 93256 | 93235 | case TK_ISNULL: |
| 93257 | 93236 | case TK_NOTNULL: { |
| | @@ -93272,11 +93251,11 @@ |
| 93272 | 93251 | AggInfo *pInfo = pExpr->pAggInfo; |
| 93273 | 93252 | if( pInfo==0 ){ |
| 93274 | 93253 | assert( !ExprHasProperty(pExpr, EP_IntValue) ); |
| 93275 | 93254 | sqlite3ErrorMsg(pParse, "misuse of aggregate: %s()", pExpr->u.zToken); |
| 93276 | 93255 | }else{ |
| 93277 | | - inReg = pInfo->aFunc[pExpr->iAgg].iMem; |
| 93256 | + return pInfo->aFunc[pExpr->iAgg].iMem; |
| 93278 | 93257 | } |
| 93279 | 93258 | break; |
| 93280 | 93259 | } |
| 93281 | 93260 | case TK_FUNCTION: { |
| 93282 | 93261 | ExprList *pFarg; /* List of function arguments */ |
| | @@ -93283,10 +93262,11 @@ |
| 93283 | 93262 | int nFarg; /* Number of function arguments */ |
| 93284 | 93263 | FuncDef *pDef; /* The function definition object */ |
| 93285 | 93264 | const char *zId; /* The function name */ |
| 93286 | 93265 | u32 constMask = 0; /* Mask of function arguments that are constant */ |
| 93287 | 93266 | int i; /* Loop counter */ |
| 93267 | + sqlite3 *db = pParse->db; /* The database connection */ |
| 93288 | 93268 | u8 enc = ENC(db); /* The text encoding used by this database */ |
| 93289 | 93269 | CollSeq *pColl = 0; /* A collating sequence */ |
| 93290 | 93270 | |
| 93291 | 93271 | assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); |
| 93292 | 93272 | if( ExprHasProperty(pExpr, EP_TokenOnly) ){ |
| | @@ -93331,12 +93311,11 @@ |
| 93331 | 93311 | /* The UNLIKELY() function is a no-op. The result is the value |
| 93332 | 93312 | ** of the first argument. |
| 93333 | 93313 | */ |
| 93334 | 93314 | if( pDef->funcFlags & SQLITE_FUNC_UNLIKELY ){ |
| 93335 | 93315 | assert( nFarg>=1 ); |
| 93336 | | - inReg = sqlite3ExprCodeTarget(pParse, pFarg->a[0].pExpr, target); |
| 93337 | | - break; |
| 93316 | + return sqlite3ExprCodeTarget(pParse, pFarg->a[0].pExpr, target); |
| 93338 | 93317 | } |
| 93339 | 93318 | |
| 93340 | 93319 | for(i=0; i<nFarg; i++){ |
| 93341 | 93320 | if( i<32 && sqlite3ExprIsConstant(pFarg->a[i].pExpr) ){ |
| 93342 | 93321 | testcase( i==31 ); |
| | @@ -93407,11 +93386,11 @@ |
| 93407 | 93386 | (char*)pDef, P4_FUNCDEF); |
| 93408 | 93387 | sqlite3VdbeChangeP5(v, (u8)nFarg); |
| 93409 | 93388 | if( nFarg && constMask==0 ){ |
| 93410 | 93389 | sqlite3ReleaseTempRange(pParse, r1, nFarg); |
| 93411 | 93390 | } |
| 93412 | | - break; |
| 93391 | + return target; |
| 93413 | 93392 | } |
| 93414 | 93393 | #ifndef SQLITE_OMIT_SUBQUERY |
| 93415 | 93394 | case TK_EXISTS: |
| 93416 | 93395 | case TK_SELECT: { |
| 93417 | 93396 | int nCol; |
| | @@ -93418,20 +93397,19 @@ |
| 93418 | 93397 | testcase( op==TK_EXISTS ); |
| 93419 | 93398 | testcase( op==TK_SELECT ); |
| 93420 | 93399 | if( op==TK_SELECT && (nCol = pExpr->x.pSelect->pEList->nExpr)!=1 ){ |
| 93421 | 93400 | sqlite3SubselectError(pParse, nCol, 1); |
| 93422 | 93401 | }else{ |
| 93423 | | - inReg = sqlite3CodeSubselect(pParse, pExpr, 0, 0); |
| 93402 | + return sqlite3CodeSubselect(pParse, pExpr, 0, 0); |
| 93424 | 93403 | } |
| 93425 | 93404 | break; |
| 93426 | 93405 | } |
| 93427 | 93406 | case TK_SELECT_COLUMN: { |
| 93428 | 93407 | if( pExpr->pLeft->iTable==0 ){ |
| 93429 | 93408 | pExpr->pLeft->iTable = sqlite3CodeSubselect(pParse, pExpr->pLeft, 0, 0); |
| 93430 | 93409 | } |
| 93431 | | - inReg = pExpr->pLeft->iTable + pExpr->iColumn; |
| 93432 | | - break; |
| 93410 | + return pExpr->pLeft->iTable + pExpr->iColumn; |
| 93433 | 93411 | } |
| 93434 | 93412 | case TK_IN: { |
| 93435 | 93413 | int destIfFalse = sqlite3VdbeMakeLabel(v); |
| 93436 | 93414 | int destIfNull = sqlite3VdbeMakeLabel(v); |
| 93437 | 93415 | sqlite3VdbeAddOp2(v, OP_Null, 0, target); |
| | @@ -93438,11 +93416,11 @@ |
| 93438 | 93416 | sqlite3ExprCodeIN(pParse, pExpr, destIfFalse, destIfNull); |
| 93439 | 93417 | sqlite3VdbeAddOp2(v, OP_Integer, 1, target); |
| 93440 | 93418 | sqlite3VdbeResolveLabel(v, destIfFalse); |
| 93441 | 93419 | sqlite3VdbeAddOp2(v, OP_AddImm, target, 0); |
| 93442 | 93420 | sqlite3VdbeResolveLabel(v, destIfNull); |
| 93443 | | - break; |
| 93421 | + return target; |
| 93444 | 93422 | } |
| 93445 | 93423 | #endif /* SQLITE_OMIT_SUBQUERY */ |
| 93446 | 93424 | |
| 93447 | 93425 | |
| 93448 | 93426 | /* |
| | @@ -93456,17 +93434,16 @@ |
| 93456 | 93434 | ** Y is stored in pExpr->pList->a[0].pExpr. |
| 93457 | 93435 | ** Z is stored in pExpr->pList->a[1].pExpr. |
| 93458 | 93436 | */ |
| 93459 | 93437 | case TK_BETWEEN: { |
| 93460 | 93438 | exprCodeBetween(pParse, pExpr, target, 0, 0); |
| 93461 | | - break; |
| 93439 | + return target; |
| 93462 | 93440 | } |
| 93463 | 93441 | case TK_SPAN: |
| 93464 | 93442 | case TK_COLLATE: |
| 93465 | 93443 | case TK_UPLUS: { |
| 93466 | | - inReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target); |
| 93467 | | - break; |
| 93444 | + return sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target); |
| 93468 | 93445 | } |
| 93469 | 93446 | |
| 93470 | 93447 | case TK_TRIGGER: { |
| 93471 | 93448 | /* If the opcode is TK_TRIGGER, then the expression is a reference |
| 93472 | 93449 | ** to a column in the new.* or old.* pseudo-tables available to |
| | @@ -93604,11 +93581,11 @@ |
| 93604 | 93581 | sqlite3ExprCode(pParse, pEList->a[nExpr-1].pExpr, target); |
| 93605 | 93582 | sqlite3ExprCachePop(pParse); |
| 93606 | 93583 | }else{ |
| 93607 | 93584 | sqlite3VdbeAddOp2(v, OP_Null, 0, target); |
| 93608 | 93585 | } |
| 93609 | | - assert( db->mallocFailed || pParse->nErr>0 |
| 93586 | + assert( pParse->db->mallocFailed || pParse->nErr>0 |
| 93610 | 93587 | || pParse->iCacheLevel==iCacheLevel ); |
| 93611 | 93588 | sqlite3VdbeResolveLabel(v, endLabel); |
| 93612 | 93589 | break; |
| 93613 | 93590 | } |
| 93614 | 93591 | #ifndef SQLITE_OMIT_TRIGGER |
| | @@ -97644,11 +97621,11 @@ |
| 97644 | 97621 | break; |
| 97645 | 97622 | |
| 97646 | 97623 | case SQLITE_NULL: |
| 97647 | 97624 | /* No key specified. Use the key from the main database */ |
| 97648 | 97625 | sqlite3CodecGetKey(db, 0, (void**)&zKey, &nKey); |
| 97649 | | - if( nKey>0 || sqlite3BtreeGetOptimalReserve(db->aDb[0].pBt)>0 ){ |
| 97626 | + if( nKey || sqlite3BtreeGetOptimalReserve(db->aDb[0].pBt)>0 ){ |
| 97650 | 97627 | rc = sqlite3CodecAttach(db, db->nDb-1, zKey, nKey); |
| 97651 | 97628 | } |
| 97652 | 97629 | break; |
| 97653 | 97630 | } |
| 97654 | 97631 | } |
| | @@ -98103,11 +98080,11 @@ |
| 98103 | 98080 | ** and attempts to write the column will be ignored. |
| 98104 | 98081 | ** |
| 98105 | 98082 | ** Setting the auth function to NULL disables this hook. The default |
| 98106 | 98083 | ** setting of the auth function is NULL. |
| 98107 | 98084 | */ |
| 98108 | | -SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer( |
| 98085 | +SQLITE_API int sqlite3_set_authorizer( |
| 98109 | 98086 | sqlite3 *db, |
| 98110 | 98087 | int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), |
| 98111 | 98088 | void *pArg |
| 98112 | 98089 | ){ |
| 98113 | 98090 | #ifdef SQLITE_ENABLE_API_ARMOR |
| | @@ -100441,11 +100418,13 @@ |
| 100441 | 100418 | Table *pSelTab; /* A fake table from which we get the result set */ |
| 100442 | 100419 | Select *pSel; /* Copy of the SELECT that implements the view */ |
| 100443 | 100420 | int nErr = 0; /* Number of errors encountered */ |
| 100444 | 100421 | int n; /* Temporarily holds the number of cursors assigned */ |
| 100445 | 100422 | sqlite3 *db = pParse->db; /* Database connection for malloc errors */ |
| 100423 | +#ifndef SQLITE_OMIT_AUTHORIZATION |
| 100446 | 100424 | sqlite3_xauth xAuth; /* Saved xAuth pointer */ |
| 100425 | +#endif |
| 100447 | 100426 | |
| 100448 | 100427 | assert( pTable ); |
| 100449 | 100428 | |
| 100450 | 100429 | #ifndef SQLITE_OMIT_VIRTUALTABLE |
| 100451 | 100430 | if( sqlite3VtabCallConnect(pParse, pTable) ){ |
| | @@ -103434,11 +103413,10 @@ |
| 103434 | 103413 | SrcList *pTabList, /* The table from which we should delete things */ |
| 103435 | 103414 | Expr *pWhere /* The WHERE clause. May be null */ |
| 103436 | 103415 | ){ |
| 103437 | 103416 | Vdbe *v; /* The virtual database engine */ |
| 103438 | 103417 | Table *pTab; /* The table from which records will be deleted */ |
| 103439 | | - const char *zDb; /* Name of database holding pTab */ |
| 103440 | 103418 | int i; /* Loop counter */ |
| 103441 | 103419 | WhereInfo *pWInfo; /* Information about the WHERE clause */ |
| 103442 | 103420 | Index *pIdx; /* For looping over indices of the table */ |
| 103443 | 103421 | int iTabCur; /* Cursor number for the table */ |
| 103444 | 103422 | int iDataCur = 0; /* VDBE cursor for the canonical data source */ |
| | @@ -103511,12 +103489,12 @@ |
| 103511 | 103489 | if( sqlite3IsReadOnly(pParse, pTab, (pTrigger?1:0)) ){ |
| 103512 | 103490 | goto delete_from_cleanup; |
| 103513 | 103491 | } |
| 103514 | 103492 | iDb = sqlite3SchemaToIndex(db, pTab->pSchema); |
| 103515 | 103493 | assert( iDb<db->nDb ); |
| 103516 | | - zDb = db->aDb[iDb].zDbSName; |
| 103517 | | - rcauth = sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb); |
| 103494 | + rcauth = sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, |
| 103495 | + db->aDb[iDb].zDbSName); |
| 103518 | 103496 | assert( rcauth==SQLITE_OK || rcauth==SQLITE_DENY || rcauth==SQLITE_IGNORE ); |
| 103519 | 103497 | if( rcauth==SQLITE_DENY ){ |
| 103520 | 103498 | goto delete_from_cleanup; |
| 103521 | 103499 | } |
| 103522 | 103500 | assert(!isView || pTrigger); |
| | @@ -103696,11 +103674,11 @@ |
| 103696 | 103674 | ** triggers. |
| 103697 | 103675 | */ |
| 103698 | 103676 | if( !isView ){ |
| 103699 | 103677 | int iAddrOnce = 0; |
| 103700 | 103678 | if( eOnePass==ONEPASS_MULTI ){ |
| 103701 | | - iAddrOnce = sqlite3CodeOnce(pParse); VdbeCoverage(v); |
| 103679 | + iAddrOnce = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v); |
| 103702 | 103680 | } |
| 103703 | 103681 | testcase( IsVirtual(pTab) ); |
| 103704 | 103682 | sqlite3OpenTableAndIndices(pParse, pTab, OP_OpenWrite, OPFLAG_FORDELETE, |
| 103705 | 103683 | iTabCur, aToOpen, &iDataCur, &iIdxCur); |
| 103706 | 103684 | assert( pPk || IsVirtual(pTab) || iDataCur==iTabCur ); |
| | @@ -104874,18 +104852,18 @@ |
| 104874 | 104852 | } |
| 104875 | 104853 | |
| 104876 | 104854 | /* |
| 104877 | 104855 | ** The sqlite3_strglob() interface. |
| 104878 | 104856 | */ |
| 104879 | | -SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlobPattern, const char *zString){ |
| 104857 | +SQLITE_API int sqlite3_strglob(const char *zGlobPattern, const char *zString){ |
| 104880 | 104858 | return patternCompare((u8*)zGlobPattern, (u8*)zString, &globInfo, '[')==0; |
| 104881 | 104859 | } |
| 104882 | 104860 | |
| 104883 | 104861 | /* |
| 104884 | 104862 | ** The sqlite3_strlike() interface. |
| 104885 | 104863 | */ |
| 104886 | | -SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){ |
| 104864 | +SQLITE_API int sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){ |
| 104887 | 104865 | return patternCompare((u8*)zPattern, (u8*)zStr, &likeInfoNorm, esc)==0; |
| 104888 | 104866 | } |
| 104889 | 104867 | |
| 104890 | 104868 | /* |
| 104891 | 104869 | ** Count the number of times that the LIKE operator (or GLOB which is |
| | @@ -107868,11 +107846,10 @@ |
| 107868 | 107846 | int onError /* How to handle constraint errors */ |
| 107869 | 107847 | ){ |
| 107870 | 107848 | sqlite3 *db; /* The main database structure */ |
| 107871 | 107849 | Table *pTab; /* The table to insert into. aka TABLE */ |
| 107872 | 107850 | char *zTab; /* Name of the table into which we are inserting */ |
| 107873 | | - const char *zDb; /* Name of the database holding this table */ |
| 107874 | 107851 | int i, j, idx; /* Loop counters */ |
| 107875 | 107852 | Vdbe *v; /* Generate code into this virtual machine */ |
| 107876 | 107853 | Index *pIdx; /* For looping over indices of the table */ |
| 107877 | 107854 | int nColumn; /* Number of columns in the data */ |
| 107878 | 107855 | int nHidden = 0; /* Number of hidden columns if TABLE is virtual */ |
| | @@ -107883,11 +107860,10 @@ |
| 107883 | 107860 | int srcTab = 0; /* Data comes from this temporary cursor if >=0 */ |
| 107884 | 107861 | int addrInsTop = 0; /* Jump to label "D" */ |
| 107885 | 107862 | int addrCont = 0; /* Top of insert loop. Label "C" in templates 3 and 4 */ |
| 107886 | 107863 | SelectDest dest; /* Destination for SELECT on rhs of INSERT */ |
| 107887 | 107864 | int iDb; /* Index of database holding TABLE */ |
| 107888 | | - Db *pDb; /* The database containing table being inserted into */ |
| 107889 | 107865 | u8 useTempTable = 0; /* Store SELECT results in intermediate table */ |
| 107890 | 107866 | u8 appendFlag = 0; /* True if the insert is likely to be an append */ |
| 107891 | 107867 | u8 withoutRowid; /* 0 for normal table. 1 for WITHOUT ROWID table */ |
| 107892 | 107868 | u8 bIdListInOrder; /* True if IDLIST is in table order */ |
| 107893 | 107869 | ExprList *pList = 0; /* List of VALUES() to be inserted */ |
| | @@ -107933,13 +107909,12 @@ |
| 107933 | 107909 | if( pTab==0 ){ |
| 107934 | 107910 | goto insert_cleanup; |
| 107935 | 107911 | } |
| 107936 | 107912 | iDb = sqlite3SchemaToIndex(db, pTab->pSchema); |
| 107937 | 107913 | assert( iDb<db->nDb ); |
| 107938 | | - pDb = &db->aDb[iDb]; |
| 107939 | | - zDb = pDb->zDbSName; |
| 107940 | | - if( sqlite3AuthCheck(pParse, SQLITE_INSERT, pTab->zName, 0, zDb) ){ |
| 107914 | + if( sqlite3AuthCheck(pParse, SQLITE_INSERT, pTab->zName, 0, |
| 107915 | + db->aDb[iDb].zDbSName) ){ |
| 107941 | 107916 | goto insert_cleanup; |
| 107942 | 107917 | } |
| 107943 | 107918 | withoutRowid = !HasRowid(pTab); |
| 107944 | 107919 | |
| 107945 | 107920 | /* Figure out if we have any triggers and if the table being |
| | @@ -109604,11 +109579,11 @@ |
| 109604 | 109579 | ** If the SQL is a query, then for each row in the query result |
| 109605 | 109580 | ** the xCallback() function is called. pArg becomes the first |
| 109606 | 109581 | ** argument to xCallback(). If xCallback=NULL then no callback |
| 109607 | 109582 | ** is invoked, even for queries. |
| 109608 | 109583 | */ |
| 109609 | | -SQLITE_API int SQLITE_STDCALL sqlite3_exec( |
| 109584 | +SQLITE_API int sqlite3_exec( |
| 109610 | 109585 | sqlite3 *db, /* The database on which the SQL executes */ |
| 109611 | 109586 | const char *zSql, /* The SQL to be executed */ |
| 109612 | 109587 | sqlite3_callback xCallback, /* Invoke this callback routine */ |
| 109613 | 109588 | void *pArg, /* First argument to xCallback() */ |
| 109614 | 109589 | char **pzErrMsg /* Write error messages here */ |
| | @@ -110866,11 +110841,11 @@ |
| 110866 | 110841 | db->aExtension = aHandle; |
| 110867 | 110842 | |
| 110868 | 110843 | db->aExtension[db->nExtension++] = handle; |
| 110869 | 110844 | return SQLITE_OK; |
| 110870 | 110845 | } |
| 110871 | | -SQLITE_API int SQLITE_STDCALL sqlite3_load_extension( |
| 110846 | +SQLITE_API int sqlite3_load_extension( |
| 110872 | 110847 | sqlite3 *db, /* Load the extension into this database connection */ |
| 110873 | 110848 | const char *zFile, /* Name of the shared library containing extension */ |
| 110874 | 110849 | const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */ |
| 110875 | 110850 | char **pzErrMsg /* Put error message here if not 0 */ |
| 110876 | 110851 | ){ |
| | @@ -110897,11 +110872,11 @@ |
| 110897 | 110872 | |
| 110898 | 110873 | /* |
| 110899 | 110874 | ** Enable or disable extension loading. Extension loading is disabled by |
| 110900 | 110875 | ** default so as not to open security holes in older applications. |
| 110901 | 110876 | */ |
| 110902 | | -SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff){ |
| 110877 | +SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff){ |
| 110903 | 110878 | sqlite3_mutex_enter(db->mutex); |
| 110904 | 110879 | if( onoff ){ |
| 110905 | 110880 | db->flags |= SQLITE_LoadExtension|SQLITE_LoadExtFunc; |
| 110906 | 110881 | }else{ |
| 110907 | 110882 | db->flags &= ~(SQLITE_LoadExtension|SQLITE_LoadExtFunc); |
| | @@ -110908,22 +110883,11 @@ |
| 110908 | 110883 | } |
| 110909 | 110884 | sqlite3_mutex_leave(db->mutex); |
| 110910 | 110885 | return SQLITE_OK; |
| 110911 | 110886 | } |
| 110912 | 110887 | |
| 110913 | | -#endif /* SQLITE_OMIT_LOAD_EXTENSION */ |
| 110914 | | - |
| 110915 | | -/* |
| 110916 | | -** The auto-extension code added regardless of whether or not extension |
| 110917 | | -** loading is supported. We need a dummy sqlite3Apis pointer for that |
| 110918 | | -** code if regular extension loading is not available. This is that |
| 110919 | | -** dummy pointer. |
| 110920 | | -*/ |
| 110921 | | -#ifdef SQLITE_OMIT_LOAD_EXTENSION |
| 110922 | | -static const sqlite3_api_routines sqlite3Apis = { 0 }; |
| 110923 | | -#endif |
| 110924 | | - |
| 110888 | +#endif /* !defined(SQLITE_OMIT_LOAD_EXTENSION) */ |
| 110925 | 110889 | |
| 110926 | 110890 | /* |
| 110927 | 110891 | ** The following object holds the list of automatically loaded |
| 110928 | 110892 | ** extensions. |
| 110929 | 110893 | ** |
| | @@ -110954,11 +110918,11 @@ |
| 110954 | 110918 | |
| 110955 | 110919 | /* |
| 110956 | 110920 | ** Register a statically linked extension that is automatically |
| 110957 | 110921 | ** loaded by every new database connection. |
| 110958 | 110922 | */ |
| 110959 | | -SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension( |
| 110923 | +SQLITE_API int sqlite3_auto_extension( |
| 110960 | 110924 | void (*xInit)(void) |
| 110961 | 110925 | ){ |
| 110962 | 110926 | int rc = SQLITE_OK; |
| 110963 | 110927 | #ifndef SQLITE_OMIT_AUTOINIT |
| 110964 | 110928 | rc = sqlite3_initialize(); |
| | @@ -111001,11 +110965,11 @@ |
| 111001 | 110965 | ** routine is a no-op. |
| 111002 | 110966 | ** |
| 111003 | 110967 | ** Return 1 if xInit was found on the list and removed. Return 0 if xInit |
| 111004 | 110968 | ** was not on the list. |
| 111005 | 110969 | */ |
| 111006 | | -SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension( |
| 110970 | +SQLITE_API int sqlite3_cancel_auto_extension( |
| 111007 | 110971 | void (*xInit)(void) |
| 111008 | 110972 | ){ |
| 111009 | 110973 | #if SQLITE_THREADSAFE |
| 111010 | 110974 | sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); |
| 111011 | 110975 | #endif |
| | @@ -111026,11 +110990,11 @@ |
| 111026 | 110990 | } |
| 111027 | 110991 | |
| 111028 | 110992 | /* |
| 111029 | 110993 | ** Reset the automatic extension loading mechanism. |
| 111030 | 110994 | */ |
| 111031 | | -SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void){ |
| 110995 | +SQLITE_API void sqlite3_reset_auto_extension(void){ |
| 111032 | 110996 | #ifndef SQLITE_OMIT_AUTOINIT |
| 111033 | 110997 | if( sqlite3_initialize()==SQLITE_OK ) |
| 111034 | 110998 | #endif |
| 111035 | 110999 | { |
| 111036 | 111000 | #if SQLITE_THREADSAFE |
| | @@ -111064,20 +111028,25 @@ |
| 111064 | 111028 | for(i=0; go; i++){ |
| 111065 | 111029 | char *zErrmsg; |
| 111066 | 111030 | #if SQLITE_THREADSAFE |
| 111067 | 111031 | sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); |
| 111068 | 111032 | #endif |
| 111033 | +#ifdef SQLITE_OMIT_LOAD_EXTENSION |
| 111034 | + const sqlite3_api_routines *pThunk = 0; |
| 111035 | +#else |
| 111036 | + const sqlite3_api_routines *pThunk = &sqlite3Apis; |
| 111037 | +#endif |
| 111069 | 111038 | sqlite3_mutex_enter(mutex); |
| 111070 | 111039 | if( i>=wsdAutoext.nExt ){ |
| 111071 | 111040 | xInit = 0; |
| 111072 | 111041 | go = 0; |
| 111073 | 111042 | }else{ |
| 111074 | 111043 | xInit = (sqlite3_loadext_entry)wsdAutoext.aExt[i]; |
| 111075 | 111044 | } |
| 111076 | 111045 | sqlite3_mutex_leave(mutex); |
| 111077 | 111046 | zErrmsg = 0; |
| 111078 | | - if( xInit && (rc = xInit(db, &zErrmsg, &sqlite3Apis))!=0 ){ |
| 111047 | + if( xInit && (rc = xInit(db, &zErrmsg, pThunk))!=0 ){ |
| 111079 | 111048 | sqlite3ErrorWithMsg(db, rc, |
| 111080 | 111049 | "automatic extension loading failed: %s", zErrmsg); |
| 111081 | 111050 | go = 0; |
| 111082 | 111051 | } |
| 111083 | 111052 | sqlite3_free(zErrmsg); |
| | @@ -114289,11 +114258,11 @@ |
| 114289 | 114258 | ** and so if a schema change occurs, SQLITE_SCHEMA is returned by |
| 114290 | 114259 | ** sqlite3_step(). In the new version, the original SQL text is retained |
| 114291 | 114260 | ** and the statement is automatically recompiled if an schema change |
| 114292 | 114261 | ** occurs. |
| 114293 | 114262 | */ |
| 114294 | | -SQLITE_API int SQLITE_STDCALL sqlite3_prepare( |
| 114263 | +SQLITE_API int sqlite3_prepare( |
| 114295 | 114264 | sqlite3 *db, /* Database handle. */ |
| 114296 | 114265 | const char *zSql, /* UTF-8 encoded SQL statement. */ |
| 114297 | 114266 | int nBytes, /* Length of zSql in bytes. */ |
| 114298 | 114267 | sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ |
| 114299 | 114268 | const char **pzTail /* OUT: End of parsed string */ |
| | @@ -114301,11 +114270,11 @@ |
| 114301 | 114270 | int rc; |
| 114302 | 114271 | rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail); |
| 114303 | 114272 | assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */ |
| 114304 | 114273 | return rc; |
| 114305 | 114274 | } |
| 114306 | | -SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2( |
| 114275 | +SQLITE_API int sqlite3_prepare_v2( |
| 114307 | 114276 | sqlite3 *db, /* Database handle. */ |
| 114308 | 114277 | const char *zSql, /* UTF-8 encoded SQL statement. */ |
| 114309 | 114278 | int nBytes, /* Length of zSql in bytes. */ |
| 114310 | 114279 | sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ |
| 114311 | 114280 | const char **pzTail /* OUT: End of parsed string */ |
| | @@ -114377,11 +114346,11 @@ |
| 114377 | 114346 | ** and so if a schema change occurs, SQLITE_SCHEMA is returned by |
| 114378 | 114347 | ** sqlite3_step(). In the new version, the original SQL text is retained |
| 114379 | 114348 | ** and the statement is automatically recompiled if an schema change |
| 114380 | 114349 | ** occurs. |
| 114381 | 114350 | */ |
| 114382 | | -SQLITE_API int SQLITE_STDCALL sqlite3_prepare16( |
| 114351 | +SQLITE_API int sqlite3_prepare16( |
| 114383 | 114352 | sqlite3 *db, /* Database handle. */ |
| 114384 | 114353 | const void *zSql, /* UTF-16 encoded SQL statement. */ |
| 114385 | 114354 | int nBytes, /* Length of zSql in bytes. */ |
| 114386 | 114355 | sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ |
| 114387 | 114356 | const void **pzTail /* OUT: End of parsed string */ |
| | @@ -114389,11 +114358,11 @@ |
| 114389 | 114358 | int rc; |
| 114390 | 114359 | rc = sqlite3Prepare16(db,zSql,nBytes,0,ppStmt,pzTail); |
| 114391 | 114360 | assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */ |
| 114392 | 114361 | return rc; |
| 114393 | 114362 | } |
| 114394 | | -SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2( |
| 114363 | +SQLITE_API int sqlite3_prepare16_v2( |
| 114395 | 114364 | sqlite3 *db, /* Database handle. */ |
| 114396 | 114365 | const void *zSql, /* UTF-16 encoded SQL statement. */ |
| 114397 | 114366 | int nBytes, /* Length of zSql in bytes. */ |
| 114398 | 114367 | sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ |
| 114399 | 114368 | const void **pzTail /* OUT: End of parsed string */ |
| | @@ -115640,11 +115609,11 @@ |
| 115640 | 115609 | nKey = pOrderBy->nExpr - pSort->nOBSat; |
| 115641 | 115610 | if( pSort->sortFlags & SORTFLAG_UseSorter ){ |
| 115642 | 115611 | int regSortOut = ++pParse->nMem; |
| 115643 | 115612 | iSortTab = pParse->nTab++; |
| 115644 | 115613 | if( pSort->labelBkOut ){ |
| 115645 | | - addrOnce = sqlite3CodeOnce(pParse); VdbeCoverage(v); |
| 115614 | + addrOnce = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v); |
| 115646 | 115615 | } |
| 115647 | 115616 | sqlite3VdbeAddOp3(v, OP_OpenPseudo, iSortTab, regSortOut, nKey+1+nSortData); |
| 115648 | 115617 | if( addrOnce ) sqlite3VdbeJumpHere(v, addrOnce); |
| 115649 | 115618 | addr = 1 + sqlite3VdbeAddOp2(v, OP_SorterSort, iTab, addrBreak); |
| 115650 | 115619 | VdbeCoverage(v); |
| | @@ -119435,11 +119404,11 @@ |
| 119435 | 119404 | pItem->addrFillSub = topAddr+1; |
| 119436 | 119405 | if( pItem->fg.isCorrelated==0 ){ |
| 119437 | 119406 | /* If the subquery is not correlated and if we are not inside of |
| 119438 | 119407 | ** a trigger, then we only need to compute the value of the subquery |
| 119439 | 119408 | ** once. */ |
| 119440 | | - onceAddr = sqlite3CodeOnce(pParse); VdbeCoverage(v); |
| 119409 | + onceAddr = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v); |
| 119441 | 119410 | VdbeComment((v, "materialize \"%s\"", pItem->pTab->zName)); |
| 119442 | 119411 | }else{ |
| 119443 | 119412 | VdbeNoopComment((v, "materialize \"%s\"", pItem->pTab->zName)); |
| 119444 | 119413 | } |
| 119445 | 119414 | sqlite3SelectDestInit(&dest, SRT_EphemTab, pItem->iCursor); |
| | @@ -120198,11 +120167,11 @@ |
| 120198 | 120167 | ** The result that is written to ***pazResult is held in memory obtained |
| 120199 | 120168 | ** from malloc(). But the caller cannot free this memory directly. |
| 120200 | 120169 | ** Instead, the entire table should be passed to sqlite3_free_table() when |
| 120201 | 120170 | ** the calling procedure is finished using it. |
| 120202 | 120171 | */ |
| 120203 | | -SQLITE_API int SQLITE_STDCALL sqlite3_get_table( |
| 120172 | +SQLITE_API int sqlite3_get_table( |
| 120204 | 120173 | sqlite3 *db, /* The database on which the SQL executes */ |
| 120205 | 120174 | const char *zSql, /* The SQL to be executed */ |
| 120206 | 120175 | char ***pazResult, /* Write the result table here */ |
| 120207 | 120176 | int *pnRow, /* Write the number of rows in the result here */ |
| 120208 | 120177 | int *pnColumn, /* Write the number of columns of result here */ |
| | @@ -120267,11 +120236,11 @@ |
| 120267 | 120236 | } |
| 120268 | 120237 | |
| 120269 | 120238 | /* |
| 120270 | 120239 | ** This routine frees the space the sqlite3_get_table() malloced. |
| 120271 | 120240 | */ |
| 120272 | | -SQLITE_API void SQLITE_STDCALL sqlite3_free_table( |
| 120241 | +SQLITE_API void sqlite3_free_table( |
| 120273 | 120242 | char **azResult /* Result returned from sqlite3_get_table() */ |
| 120274 | 120243 | ){ |
| 120275 | 120244 | if( azResult ){ |
| 120276 | 120245 | int i, n; |
| 120277 | 120246 | azResult--; |
| | @@ -120382,11 +120351,10 @@ |
| 120382 | 120351 | char *zName = 0; /* Name of the trigger */ |
| 120383 | 120352 | sqlite3 *db = pParse->db; /* The database connection */ |
| 120384 | 120353 | int iDb; /* The database to store the trigger in */ |
| 120385 | 120354 | Token *pName; /* The unqualified db name */ |
| 120386 | 120355 | DbFixer sFix; /* State vector for the DB fixer */ |
| 120387 | | - int iTabDb; /* Index of the database holding pTab */ |
| 120388 | 120356 | |
| 120389 | 120357 | assert( pName1!=0 ); /* pName1->z might be NULL, but not pName1 itself */ |
| 120390 | 120358 | assert( pName2!=0 ); |
| 120391 | 120359 | assert( op==TK_INSERT || op==TK_UPDATE || op==TK_DELETE ); |
| 120392 | 120360 | assert( op>0 && op<0xff ); |
| | @@ -120495,14 +120463,14 @@ |
| 120495 | 120463 | if( !pTab->pSelect && tr_tm==TK_INSTEAD ){ |
| 120496 | 120464 | sqlite3ErrorMsg(pParse, "cannot create INSTEAD OF" |
| 120497 | 120465 | " trigger on table: %S", pTableName, 0); |
| 120498 | 120466 | goto trigger_cleanup; |
| 120499 | 120467 | } |
| 120500 | | - iTabDb = sqlite3SchemaToIndex(db, pTab->pSchema); |
| 120501 | 120468 | |
| 120502 | 120469 | #ifndef SQLITE_OMIT_AUTHORIZATION |
| 120503 | 120470 | { |
| 120471 | + int iTabDb = sqlite3SchemaToIndex(db, pTab->pSchema); |
| 120504 | 120472 | int code = SQLITE_CREATE_TRIGGER; |
| 120505 | 120473 | const char *zDb = db->aDb[iTabDb].zDbSName; |
| 120506 | 120474 | const char *zDbTrig = isTemp ? db->aDb[1].zDbSName : zDb; |
| 120507 | 120475 | if( iTabDb==1 || isTemp ) code = SQLITE_CREATE_TEMP_TRIGGER; |
| 120508 | 120476 | if( sqlite3AuthCheck(pParse, code, zName, pTab->zName, zDbTrig) ){ |
| | @@ -121166,11 +121134,10 @@ |
| 121166 | 121134 | if( db->mallocFailed==0 ){ |
| 121167 | 121135 | pProgram->aOp = sqlite3VdbeTakeOpArray(v, &pProgram->nOp, &pTop->nMaxArg); |
| 121168 | 121136 | } |
| 121169 | 121137 | pProgram->nMem = pSubParse->nMem; |
| 121170 | 121138 | pProgram->nCsr = pSubParse->nTab; |
| 121171 | | - pProgram->nOnce = pSubParse->nOnce; |
| 121172 | 121139 | pProgram->token = (void *)pTrigger; |
| 121173 | 121140 | pPrg->aColmask[0] = pSubParse->oldmask; |
| 121174 | 121141 | pPrg->aColmask[1] = pSubParse->newmask; |
| 121175 | 121142 | sqlite3VdbeDelete(v); |
| 121176 | 121143 | } |
| | @@ -122655,11 +122622,11 @@ |
| 122655 | 122622 | |
| 122656 | 122623 | |
| 122657 | 122624 | /* |
| 122658 | 122625 | ** External API function used to create a new virtual-table module. |
| 122659 | 122626 | */ |
| 122660 | | -SQLITE_API int SQLITE_STDCALL sqlite3_create_module( |
| 122627 | +SQLITE_API int sqlite3_create_module( |
| 122661 | 122628 | sqlite3 *db, /* Database in which module is registered */ |
| 122662 | 122629 | const char *zName, /* Name assigned to this module */ |
| 122663 | 122630 | const sqlite3_module *pModule, /* The definition of the module */ |
| 122664 | 122631 | void *pAux /* Context pointer for xCreate/xConnect */ |
| 122665 | 122632 | ){ |
| | @@ -122670,11 +122637,11 @@ |
| 122670 | 122637 | } |
| 122671 | 122638 | |
| 122672 | 122639 | /* |
| 122673 | 122640 | ** External API function used to create a new virtual-table module. |
| 122674 | 122641 | */ |
| 122675 | | -SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2( |
| 122642 | +SQLITE_API int sqlite3_create_module_v2( |
| 122676 | 122643 | sqlite3 *db, /* Database in which module is registered */ |
| 122677 | 122644 | const char *zName, /* Name assigned to this module */ |
| 122678 | 122645 | const sqlite3_module *pModule, /* The definition of the module */ |
| 122679 | 122646 | void *pAux, /* Context pointer for xCreate/xConnect */ |
| 122680 | 122647 | void (*xDestroy)(void *) /* Module destructor function */ |
| | @@ -123294,11 +123261,11 @@ |
| 123294 | 123261 | /* |
| 123295 | 123262 | ** This function is used to set the schema of a virtual table. It is only |
| 123296 | 123263 | ** valid to call this function from within the xCreate() or xConnect() of a |
| 123297 | 123264 | ** virtual table module. |
| 123298 | 123265 | */ |
| 123299 | | -SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){ |
| 123266 | +SQLITE_API int sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){ |
| 123300 | 123267 | VtabCtx *pCtx; |
| 123301 | 123268 | Parse *pParse; |
| 123302 | 123269 | int rc = SQLITE_OK; |
| 123303 | 123270 | Table *pTab; |
| 123304 | 123271 | char *zErr = 0; |
| | @@ -123751,11 +123718,11 @@ |
| 123751 | 123718 | ** table update operation currently in progress. |
| 123752 | 123719 | ** |
| 123753 | 123720 | ** The results of this routine are undefined unless it is called from |
| 123754 | 123721 | ** within an xUpdate method. |
| 123755 | 123722 | */ |
| 123756 | | -SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *db){ |
| 123723 | +SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *db){ |
| 123757 | 123724 | static const unsigned char aMap[] = { |
| 123758 | 123725 | SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE |
| 123759 | 123726 | }; |
| 123760 | 123727 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 123761 | 123728 | if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
| | @@ -123769,11 +123736,11 @@ |
| 123769 | 123736 | /* |
| 123770 | 123737 | ** Call from within the xCreate() or xConnect() methods to provide |
| 123771 | 123738 | ** the SQLite core with additional information about the behavior |
| 123772 | 123739 | ** of the virtual table being implemented. |
| 123773 | 123740 | */ |
| 123774 | | -SQLITE_API int SQLITE_CDECL sqlite3_vtab_config(sqlite3 *db, int op, ...){ |
| 123741 | +SQLITE_API int sqlite3_vtab_config(sqlite3 *db, int op, ...){ |
| 123775 | 123742 | va_list ap; |
| 123776 | 123743 | int rc = SQLITE_OK; |
| 123777 | 123744 | |
| 123778 | 123745 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 123779 | 123746 | if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
| | @@ -124886,18 +124853,17 @@ |
| 124886 | 124853 | pIn = pLevel->u.in.aInLoop; |
| 124887 | 124854 | if( pIn ){ |
| 124888 | 124855 | int iMap = 0; /* Index in aiMap[] */ |
| 124889 | 124856 | pIn += i; |
| 124890 | 124857 | for(i=iEq;i<pLoop->nLTerm; i++){ |
| 124891 | | - int iOut = iReg; |
| 124892 | 124858 | if( pLoop->aLTerm[i]->pExpr==pX ){ |
| 124859 | + int iOut = iReg + i - iEq; |
| 124893 | 124860 | if( eType==IN_INDEX_ROWID ){ |
| 124894 | | - assert( nEq==1 && i==iEq ); |
| 124895 | | - pIn->addrInTop = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iReg); |
| 124861 | + testcase( nEq>1 ); /* Happens with a UNIQUE index on ROWID */ |
| 124862 | + pIn->addrInTop = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iOut); |
| 124896 | 124863 | }else{ |
| 124897 | 124864 | int iCol = aiMap ? aiMap[iMap++] : 0; |
| 124898 | | - iOut = iReg + i - iEq; |
| 124899 | 124865 | pIn->addrInTop = sqlite3VdbeAddOp3(v,OP_Column,iTab, iCol, iOut); |
| 124900 | 124866 | } |
| 124901 | 124867 | sqlite3VdbeAddOp1(v, OP_IsNull, iOut); VdbeCoverage(v); |
| 124902 | 124868 | if( i==iEq ){ |
| 124903 | 124869 | pIn->iCur = iTab; |
| | @@ -128496,11 +128462,11 @@ |
| 128496 | 128462 | |
| 128497 | 128463 | /* Generate code to skip over the creation and initialization of the |
| 128498 | 128464 | ** transient index on 2nd and subsequent iterations of the loop. */ |
| 128499 | 128465 | v = pParse->pVdbe; |
| 128500 | 128466 | assert( v!=0 ); |
| 128501 | | - addrInit = sqlite3CodeOnce(pParse); VdbeCoverage(v); |
| 128467 | + addrInit = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v); |
| 128502 | 128468 | |
| 128503 | 128469 | /* Count the number of columns that will be added to the index |
| 128504 | 128470 | ** and used to match WHERE clause constraints */ |
| 128505 | 128471 | nKeyCol = 0; |
| 128506 | 128472 | pTable = pSrc->pTab; |
| | @@ -130167,10 +130133,12 @@ |
| 130167 | 130133 | LogEst rLogSize; /* Logarithm of table size */ |
| 130168 | 130134 | WhereTerm *pTop = 0, *pBtm = 0; /* Top and bottom range constraints */ |
| 130169 | 130135 | |
| 130170 | 130136 | pNew = pBuilder->pNew; |
| 130171 | 130137 | if( db->mallocFailed ) return SQLITE_NOMEM_BKPT; |
| 130138 | + WHERETRACE(0x800, ("BEGIN addBtreeIdx(%s), nEq=%d\n", |
| 130139 | + pProbe->zName, pNew->u.btree.nEq)); |
| 130172 | 130140 | |
| 130173 | 130141 | assert( (pNew->wsFlags & WHERE_VIRTUALTABLE)==0 ); |
| 130174 | 130142 | assert( (pNew->wsFlags & WHERE_TOP_LIMIT)==0 ); |
| 130175 | 130143 | if( pNew->wsFlags & WHERE_BTM_LIMIT ){ |
| 130176 | 130144 | opMask = WO_LT|WO_LE; |
| | @@ -130253,11 +130221,11 @@ |
| 130253 | 130221 | ** In this case there is a separate term for each of (x) and (y). |
| 130254 | 130222 | ** However, the nIn multiplier should only be applied once, not once |
| 130255 | 130223 | ** for each such term. The following loop checks that pTerm is the |
| 130256 | 130224 | ** first such term in use, and sets nIn back to 0 if it is not. */ |
| 130257 | 130225 | for(i=0; i<pNew->nLTerm-1; i++){ |
| 130258 | | - if( pNew->aLTerm[i]->pExpr==pExpr ) nIn = 0; |
| 130226 | + if( pNew->aLTerm[i] && pNew->aLTerm[i]->pExpr==pExpr ) nIn = 0; |
| 130259 | 130227 | } |
| 130260 | 130228 | }else if( ALWAYS(pExpr->x.pList && pExpr->x.pList->nExpr) ){ |
| 130261 | 130229 | /* "x IN (value, value, ...)" */ |
| 130262 | 130230 | nIn = sqlite3LogEst(pExpr->x.pList->nExpr); |
| 130263 | 130231 | assert( nIn>0 ); /* RHS always has 2 or more terms... The parser |
| | @@ -130445,10 +130413,12 @@ |
| 130445 | 130413 | pNew->u.btree.nEq = saved_nEq; |
| 130446 | 130414 | pNew->nSkip = saved_nSkip; |
| 130447 | 130415 | pNew->wsFlags = saved_wsFlags; |
| 130448 | 130416 | } |
| 130449 | 130417 | |
| 130418 | + WHERETRACE(0x800, ("END addBtreeIdx(%s), nEq=%d, rc=%d\n", |
| 130419 | + pProbe->zName, saved_nEq, rc)); |
| 130450 | 130420 | return rc; |
| 130451 | 130421 | } |
| 130452 | 130422 | |
| 130453 | 130423 | /* |
| 130454 | 130424 | ** Return True if it is possible that pIndex might be useful in |
| | @@ -137554,11 +137524,11 @@ |
| 137554 | 137524 | ** |
| 137555 | 137525 | ** If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed |
| 137556 | 137526 | ** to recognize the end of a trigger can be omitted. All we have to do |
| 137557 | 137527 | ** is look for a semicolon that is not part of an string or comment. |
| 137558 | 137528 | */ |
| 137559 | | -SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *zSql){ |
| 137529 | +SQLITE_API int sqlite3_complete(const char *zSql){ |
| 137560 | 137530 | u8 state = 0; /* Current state, using numbers defined in header comment */ |
| 137561 | 137531 | u8 token; /* Value of the next token */ |
| 137562 | 137532 | |
| 137563 | 137533 | #ifndef SQLITE_OMIT_TRIGGER |
| 137564 | 137534 | /* A complex statement machine used to detect the end of a CREATE TRIGGER |
| | @@ -137719,11 +137689,11 @@ |
| 137719 | 137689 | /* |
| 137720 | 137690 | ** This routine is the same as the sqlite3_complete() routine described |
| 137721 | 137691 | ** above, except that the parameter is required to be UTF-16 encoded, not |
| 137722 | 137692 | ** UTF-8. |
| 137723 | 137693 | */ |
| 137724 | | -SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *zSql){ |
| 137694 | +SQLITE_API int sqlite3_complete16(const void *zSql){ |
| 137725 | 137695 | sqlite3_value *pVal; |
| 137726 | 137696 | char const *zSql8; |
| 137727 | 137697 | int rc; |
| 137728 | 137698 | |
| 137729 | 137699 | #ifndef SQLITE_OMIT_AUTOINIT |
| | @@ -137879,28 +137849,28 @@ |
| 137879 | 137849 | #endif |
| 137880 | 137850 | |
| 137881 | 137851 | /* IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns |
| 137882 | 137852 | ** a pointer to the to the sqlite3_version[] string constant. |
| 137883 | 137853 | */ |
| 137884 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void){ return sqlite3_version; } |
| 137854 | +SQLITE_API const char *sqlite3_libversion(void){ return sqlite3_version; } |
| 137885 | 137855 | |
| 137886 | 137856 | /* IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a |
| 137887 | 137857 | ** pointer to a string constant whose value is the same as the |
| 137888 | 137858 | ** SQLITE_SOURCE_ID C preprocessor macro. |
| 137889 | 137859 | */ |
| 137890 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } |
| 137860 | +SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } |
| 137891 | 137861 | |
| 137892 | 137862 | /* IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function |
| 137893 | 137863 | ** returns an integer equal to SQLITE_VERSION_NUMBER. |
| 137894 | 137864 | */ |
| 137895 | | -SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; } |
| 137865 | +SQLITE_API int sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; } |
| 137896 | 137866 | |
| 137897 | 137867 | /* IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns |
| 137898 | 137868 | ** zero if and only if SQLite was compiled with mutexing code omitted due to |
| 137899 | 137869 | ** the SQLITE_THREADSAFE compile-time option being set to 0. |
| 137900 | 137870 | */ |
| 137901 | | -SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; } |
| 137871 | +SQLITE_API int sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; } |
| 137902 | 137872 | |
| 137903 | 137873 | /* |
| 137904 | 137874 | ** When compiling the test fixture or with debugging enabled (on Win32), |
| 137905 | 137875 | ** this variable being set to non-zero will cause OSTRACE macros to emit |
| 137906 | 137876 | ** extra diagnostic information. |
| | @@ -137969,11 +137939,11 @@ |
| 137969 | 137939 | ** call by X completes. |
| 137970 | 137940 | ** |
| 137971 | 137941 | ** * Recursive calls to this routine from thread X return immediately |
| 137972 | 137942 | ** without blocking. |
| 137973 | 137943 | */ |
| 137974 | | -SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void){ |
| 137944 | +SQLITE_API int sqlite3_initialize(void){ |
| 137975 | 137945 | MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */ |
| 137976 | 137946 | int rc; /* Result code */ |
| 137977 | 137947 | #ifdef SQLITE_EXTRA_INIT |
| 137978 | 137948 | int bRunExtraInit = 0; /* Extra initialization needed */ |
| 137979 | 137949 | #endif |
| | @@ -138135,11 +138105,11 @@ |
| 138135 | 138105 | ** while any part of SQLite is otherwise in use in any thread. This |
| 138136 | 138106 | ** routine is not threadsafe. But it is safe to invoke this routine |
| 138137 | 138107 | ** on when SQLite is already shut down. If SQLite is already shut down |
| 138138 | 138108 | ** when this routine is invoked, then this routine is a harmless no-op. |
| 138139 | 138109 | */ |
| 138140 | | -SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void){ |
| 138110 | +SQLITE_API int sqlite3_shutdown(void){ |
| 138141 | 138111 | #ifdef SQLITE_OMIT_WSD |
| 138142 | 138112 | int rc = sqlite3_wsd_init(4096, 24); |
| 138143 | 138113 | if( rc!=SQLITE_OK ){ |
| 138144 | 138114 | return rc; |
| 138145 | 138115 | } |
| | @@ -138189,11 +138159,11 @@ |
| 138189 | 138159 | ** This routine should only be called when there are no outstanding |
| 138190 | 138160 | ** database connections or memory allocations. This routine is not |
| 138191 | 138161 | ** threadsafe. Failure to heed these warnings can lead to unpredictable |
| 138192 | 138162 | ** behavior. |
| 138193 | 138163 | */ |
| 138194 | | -SQLITE_API int SQLITE_CDECL sqlite3_config(int op, ...){ |
| 138164 | +SQLITE_API int sqlite3_config(int op, ...){ |
| 138195 | 138165 | va_list ap; |
| 138196 | 138166 | int rc = SQLITE_OK; |
| 138197 | 138167 | |
| 138198 | 138168 | /* sqlite3_config() shall return SQLITE_MISUSE if it is invoked while |
| 138199 | 138169 | ** the SQLite library is in use. */ |
| | @@ -138554,11 +138524,11 @@ |
| 138554 | 138524 | } |
| 138555 | 138525 | |
| 138556 | 138526 | /* |
| 138557 | 138527 | ** Return the mutex associated with a database connection. |
| 138558 | 138528 | */ |
| 138559 | | -SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3 *db){ |
| 138529 | +SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3 *db){ |
| 138560 | 138530 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 138561 | 138531 | if( !sqlite3SafetyCheckOk(db) ){ |
| 138562 | 138532 | (void)SQLITE_MISUSE_BKPT; |
| 138563 | 138533 | return 0; |
| 138564 | 138534 | } |
| | @@ -138568,11 +138538,11 @@ |
| 138568 | 138538 | |
| 138569 | 138539 | /* |
| 138570 | 138540 | ** Free up as much memory as we can from the given database |
| 138571 | 138541 | ** connection. |
| 138572 | 138542 | */ |
| 138573 | | -SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3 *db){ |
| 138543 | +SQLITE_API int sqlite3_db_release_memory(sqlite3 *db){ |
| 138574 | 138544 | int i; |
| 138575 | 138545 | |
| 138576 | 138546 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 138577 | 138547 | if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
| 138578 | 138548 | #endif |
| | @@ -138592,11 +138562,11 @@ |
| 138592 | 138562 | |
| 138593 | 138563 | /* |
| 138594 | 138564 | ** Flush any dirty pages in the pager-cache for any attached database |
| 138595 | 138565 | ** to disk. |
| 138596 | 138566 | */ |
| 138597 | | -SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3 *db){ |
| 138567 | +SQLITE_API int sqlite3_db_cacheflush(sqlite3 *db){ |
| 138598 | 138568 | int i; |
| 138599 | 138569 | int rc = SQLITE_OK; |
| 138600 | 138570 | int bSeenBusy = 0; |
| 138601 | 138571 | |
| 138602 | 138572 | #ifdef SQLITE_ENABLE_API_ARMOR |
| | @@ -138621,11 +138591,11 @@ |
| 138621 | 138591 | } |
| 138622 | 138592 | |
| 138623 | 138593 | /* |
| 138624 | 138594 | ** Configuration settings for an individual database connection |
| 138625 | 138595 | */ |
| 138626 | | -SQLITE_API int SQLITE_CDECL sqlite3_db_config(sqlite3 *db, int op, ...){ |
| 138596 | +SQLITE_API int sqlite3_db_config(sqlite3 *db, int op, ...){ |
| 138627 | 138597 | va_list ap; |
| 138628 | 138598 | int rc; |
| 138629 | 138599 | va_start(ap, op); |
| 138630 | 138600 | switch( op ){ |
| 138631 | 138601 | case SQLITE_DBCONFIG_MAINDBNAME: { |
| | @@ -138747,11 +138717,11 @@ |
| 138747 | 138717 | } |
| 138748 | 138718 | |
| 138749 | 138719 | /* |
| 138750 | 138720 | ** Return the ROWID of the most recent insert |
| 138751 | 138721 | */ |
| 138752 | | -SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3 *db){ |
| 138722 | +SQLITE_API sqlite_int64 sqlite3_last_insert_rowid(sqlite3 *db){ |
| 138753 | 138723 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 138754 | 138724 | if( !sqlite3SafetyCheckOk(db) ){ |
| 138755 | 138725 | (void)SQLITE_MISUSE_BKPT; |
| 138756 | 138726 | return 0; |
| 138757 | 138727 | } |
| | @@ -138760,11 +138730,11 @@ |
| 138760 | 138730 | } |
| 138761 | 138731 | |
| 138762 | 138732 | /* |
| 138763 | 138733 | ** Return the number of changes in the most recent call to sqlite3_exec(). |
| 138764 | 138734 | */ |
| 138765 | | -SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3 *db){ |
| 138735 | +SQLITE_API int sqlite3_changes(sqlite3 *db){ |
| 138766 | 138736 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 138767 | 138737 | if( !sqlite3SafetyCheckOk(db) ){ |
| 138768 | 138738 | (void)SQLITE_MISUSE_BKPT; |
| 138769 | 138739 | return 0; |
| 138770 | 138740 | } |
| | @@ -138773,11 +138743,11 @@ |
| 138773 | 138743 | } |
| 138774 | 138744 | |
| 138775 | 138745 | /* |
| 138776 | 138746 | ** Return the number of changes since the database handle was opened. |
| 138777 | 138747 | */ |
| 138778 | | -SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3 *db){ |
| 138748 | +SQLITE_API int sqlite3_total_changes(sqlite3 *db){ |
| 138779 | 138749 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 138780 | 138750 | if( !sqlite3SafetyCheckOk(db) ){ |
| 138781 | 138751 | (void)SQLITE_MISUSE_BKPT; |
| 138782 | 138752 | return 0; |
| 138783 | 138753 | } |
| | @@ -138924,12 +138894,12 @@ |
| 138924 | 138894 | ** statements or unfinished sqlite3_backups. The sqlite3_close_v2() |
| 138925 | 138895 | ** version forces the connection to become a zombie if there are |
| 138926 | 138896 | ** unclosed resources, and arranges for deallocation when the last |
| 138927 | 138897 | ** prepare statement or sqlite3_backup closes. |
| 138928 | 138898 | */ |
| 138929 | | -SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3 *db){ return sqlite3Close(db,0); } |
| 138930 | | -SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3 *db){ return sqlite3Close(db,1); } |
| 138899 | +SQLITE_API int sqlite3_close(sqlite3 *db){ return sqlite3Close(db,0); } |
| 138900 | +SQLITE_API int sqlite3_close_v2(sqlite3 *db){ return sqlite3Close(db,1); } |
| 138931 | 138901 | |
| 138932 | 138902 | |
| 138933 | 138903 | /* |
| 138934 | 138904 | ** Close the mutex on database connection db. |
| 138935 | 138905 | ** |
| | @@ -139332,11 +139302,11 @@ |
| 139332 | 139302 | |
| 139333 | 139303 | /* |
| 139334 | 139304 | ** This routine sets the busy callback for an Sqlite database to the |
| 139335 | 139305 | ** given callback function with the given argument. |
| 139336 | 139306 | */ |
| 139337 | | -SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler( |
| 139307 | +SQLITE_API int sqlite3_busy_handler( |
| 139338 | 139308 | sqlite3 *db, |
| 139339 | 139309 | int (*xBusy)(void*,int), |
| 139340 | 139310 | void *pArg |
| 139341 | 139311 | ){ |
| 139342 | 139312 | #ifdef SQLITE_ENABLE_API_ARMOR |
| | @@ -139355,11 +139325,11 @@ |
| 139355 | 139325 | /* |
| 139356 | 139326 | ** This routine sets the progress callback for an Sqlite database to the |
| 139357 | 139327 | ** given callback function with the given argument. The progress callback will |
| 139358 | 139328 | ** be invoked every nOps opcodes. |
| 139359 | 139329 | */ |
| 139360 | | -SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler( |
| 139330 | +SQLITE_API void sqlite3_progress_handler( |
| 139361 | 139331 | sqlite3 *db, |
| 139362 | 139332 | int nOps, |
| 139363 | 139333 | int (*xProgress)(void*), |
| 139364 | 139334 | void *pArg |
| 139365 | 139335 | ){ |
| | @@ -139386,11 +139356,11 @@ |
| 139386 | 139356 | |
| 139387 | 139357 | /* |
| 139388 | 139358 | ** This routine installs a default busy handler that waits for the |
| 139389 | 139359 | ** specified number of milliseconds before returning 0. |
| 139390 | 139360 | */ |
| 139391 | | -SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3 *db, int ms){ |
| 139361 | +SQLITE_API int sqlite3_busy_timeout(sqlite3 *db, int ms){ |
| 139392 | 139362 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 139393 | 139363 | if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
| 139394 | 139364 | #endif |
| 139395 | 139365 | if( ms>0 ){ |
| 139396 | 139366 | sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db); |
| | @@ -139402,11 +139372,11 @@ |
| 139402 | 139372 | } |
| 139403 | 139373 | |
| 139404 | 139374 | /* |
| 139405 | 139375 | ** Cause any pending operation to stop at its earliest opportunity. |
| 139406 | 139376 | */ |
| 139407 | | -SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3 *db){ |
| 139377 | +SQLITE_API void sqlite3_interrupt(sqlite3 *db){ |
| 139408 | 139378 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 139409 | 139379 | if( !sqlite3SafetyCheckOk(db) ){ |
| 139410 | 139380 | (void)SQLITE_MISUSE_BKPT; |
| 139411 | 139381 | return; |
| 139412 | 139382 | } |
| | @@ -139518,11 +139488,11 @@ |
| 139518 | 139488 | } |
| 139519 | 139489 | |
| 139520 | 139490 | /* |
| 139521 | 139491 | ** Create new user functions. |
| 139522 | 139492 | */ |
| 139523 | | -SQLITE_API int SQLITE_STDCALL sqlite3_create_function( |
| 139493 | +SQLITE_API int sqlite3_create_function( |
| 139524 | 139494 | sqlite3 *db, |
| 139525 | 139495 | const char *zFunc, |
| 139526 | 139496 | int nArg, |
| 139527 | 139497 | int enc, |
| 139528 | 139498 | void *p, |
| | @@ -139532,11 +139502,11 @@ |
| 139532 | 139502 | ){ |
| 139533 | 139503 | return sqlite3_create_function_v2(db, zFunc, nArg, enc, p, xSFunc, xStep, |
| 139534 | 139504 | xFinal, 0); |
| 139535 | 139505 | } |
| 139536 | 139506 | |
| 139537 | | -SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2( |
| 139507 | +SQLITE_API int sqlite3_create_function_v2( |
| 139538 | 139508 | sqlite3 *db, |
| 139539 | 139509 | const char *zFunc, |
| 139540 | 139510 | int nArg, |
| 139541 | 139511 | int enc, |
| 139542 | 139512 | void *p, |
| | @@ -139575,11 +139545,11 @@ |
| 139575 | 139545 | sqlite3_mutex_leave(db->mutex); |
| 139576 | 139546 | return rc; |
| 139577 | 139547 | } |
| 139578 | 139548 | |
| 139579 | 139549 | #ifndef SQLITE_OMIT_UTF16 |
| 139580 | | -SQLITE_API int SQLITE_STDCALL sqlite3_create_function16( |
| 139550 | +SQLITE_API int sqlite3_create_function16( |
| 139581 | 139551 | sqlite3 *db, |
| 139582 | 139552 | const void *zFunctionName, |
| 139583 | 139553 | int nArg, |
| 139584 | 139554 | int eTextRep, |
| 139585 | 139555 | void *p, |
| | @@ -139615,11 +139585,11 @@ |
| 139615 | 139585 | ** When virtual tables intend to provide an overloaded function, they |
| 139616 | 139586 | ** should call this routine to make sure the global function exists. |
| 139617 | 139587 | ** A global function must exist in order for name resolution to work |
| 139618 | 139588 | ** properly. |
| 139619 | 139589 | */ |
| 139620 | | -SQLITE_API int SQLITE_STDCALL sqlite3_overload_function( |
| 139590 | +SQLITE_API int sqlite3_overload_function( |
| 139621 | 139591 | sqlite3 *db, |
| 139622 | 139592 | const char *zName, |
| 139623 | 139593 | int nArg |
| 139624 | 139594 | ){ |
| 139625 | 139595 | int rc = SQLITE_OK; |
| | @@ -139647,11 +139617,11 @@ |
| 139647 | 139617 | ** A NULL trace function means that no tracing is executes. A non-NULL |
| 139648 | 139618 | ** trace is a pointer to a function that is invoked at the start of each |
| 139649 | 139619 | ** SQL statement. |
| 139650 | 139620 | */ |
| 139651 | 139621 | #ifndef SQLITE_OMIT_DEPRECATED |
| 139652 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_trace(sqlite3 *db, void(*xTrace)(void*,const char*), void *pArg){ |
| 139622 | +SQLITE_API void *sqlite3_trace(sqlite3 *db, void(*xTrace)(void*,const char*), void *pArg){ |
| 139653 | 139623 | void *pOld; |
| 139654 | 139624 | |
| 139655 | 139625 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 139656 | 139626 | if( !sqlite3SafetyCheckOk(db) ){ |
| 139657 | 139627 | (void)SQLITE_MISUSE_BKPT; |
| | @@ -139668,11 +139638,11 @@ |
| 139668 | 139638 | } |
| 139669 | 139639 | #endif /* SQLITE_OMIT_DEPRECATED */ |
| 139670 | 139640 | |
| 139671 | 139641 | /* Register a trace callback using the version-2 interface. |
| 139672 | 139642 | */ |
| 139673 | | -SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2( |
| 139643 | +SQLITE_API int sqlite3_trace_v2( |
| 139674 | 139644 | sqlite3 *db, /* Trace this connection */ |
| 139675 | 139645 | unsigned mTrace, /* Mask of events to be traced */ |
| 139676 | 139646 | int(*xTrace)(unsigned,void*,void*,void*), /* Callback to invoke */ |
| 139677 | 139647 | void *pArg /* Context */ |
| 139678 | 139648 | ){ |
| | @@ -139698,11 +139668,11 @@ |
| 139698 | 139668 | ** |
| 139699 | 139669 | ** A NULL profile function means that no profiling is executes. A non-NULL |
| 139700 | 139670 | ** profile is a pointer to a function that is invoked at the conclusion of |
| 139701 | 139671 | ** each SQL statement that is run. |
| 139702 | 139672 | */ |
| 139703 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_profile( |
| 139673 | +SQLITE_API void *sqlite3_profile( |
| 139704 | 139674 | sqlite3 *db, |
| 139705 | 139675 | void (*xProfile)(void*,const char*,sqlite_uint64), |
| 139706 | 139676 | void *pArg |
| 139707 | 139677 | ){ |
| 139708 | 139678 | void *pOld; |
| | @@ -139726,11 +139696,11 @@ |
| 139726 | 139696 | /* |
| 139727 | 139697 | ** Register a function to be invoked when a transaction commits. |
| 139728 | 139698 | ** If the invoked function returns non-zero, then the commit becomes a |
| 139729 | 139699 | ** rollback. |
| 139730 | 139700 | */ |
| 139731 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook( |
| 139701 | +SQLITE_API void *sqlite3_commit_hook( |
| 139732 | 139702 | sqlite3 *db, /* Attach the hook to this database */ |
| 139733 | 139703 | int (*xCallback)(void*), /* Function to invoke on each commit */ |
| 139734 | 139704 | void *pArg /* Argument to the function */ |
| 139735 | 139705 | ){ |
| 139736 | 139706 | void *pOld; |
| | @@ -139751,11 +139721,11 @@ |
| 139751 | 139721 | |
| 139752 | 139722 | /* |
| 139753 | 139723 | ** Register a callback to be invoked each time a row is updated, |
| 139754 | 139724 | ** inserted or deleted using this database connection. |
| 139755 | 139725 | */ |
| 139756 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook( |
| 139726 | +SQLITE_API void *sqlite3_update_hook( |
| 139757 | 139727 | sqlite3 *db, /* Attach the hook to this database */ |
| 139758 | 139728 | void (*xCallback)(void*,int,char const *,char const *,sqlite_int64), |
| 139759 | 139729 | void *pArg /* Argument to the function */ |
| 139760 | 139730 | ){ |
| 139761 | 139731 | void *pRet; |
| | @@ -139776,11 +139746,11 @@ |
| 139776 | 139746 | |
| 139777 | 139747 | /* |
| 139778 | 139748 | ** Register a callback to be invoked each time a transaction is rolled |
| 139779 | 139749 | ** back by this database connection. |
| 139780 | 139750 | */ |
| 139781 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook( |
| 139751 | +SQLITE_API void *sqlite3_rollback_hook( |
| 139782 | 139752 | sqlite3 *db, /* Attach the hook to this database */ |
| 139783 | 139753 | void (*xCallback)(void*), /* Callback function */ |
| 139784 | 139754 | void *pArg /* Argument to the function */ |
| 139785 | 139755 | ){ |
| 139786 | 139756 | void *pRet; |
| | @@ -139802,11 +139772,11 @@ |
| 139802 | 139772 | #ifdef SQLITE_ENABLE_PREUPDATE_HOOK |
| 139803 | 139773 | /* |
| 139804 | 139774 | ** Register a callback to be invoked each time a row is updated, |
| 139805 | 139775 | ** inserted or deleted using this database connection. |
| 139806 | 139776 | */ |
| 139807 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_preupdate_hook( |
| 139777 | +SQLITE_API void *sqlite3_preupdate_hook( |
| 139808 | 139778 | sqlite3 *db, /* Attach the hook to this database */ |
| 139809 | 139779 | void(*xCallback)( /* Callback function */ |
| 139810 | 139780 | void*,sqlite3*,int,char const*,char const*,sqlite3_int64,sqlite3_int64), |
| 139811 | 139781 | void *pArg /* First callback argument */ |
| 139812 | 139782 | ){ |
| | @@ -139851,11 +139821,11 @@ |
| 139851 | 139821 | ** The callback registered by this function replaces any existing callback |
| 139852 | 139822 | ** registered using sqlite3_wal_hook(). Likewise, registering a callback |
| 139853 | 139823 | ** using sqlite3_wal_hook() disables the automatic checkpoint mechanism |
| 139854 | 139824 | ** configured by this function. |
| 139855 | 139825 | */ |
| 139856 | | -SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){ |
| 139826 | +SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){ |
| 139857 | 139827 | #ifdef SQLITE_OMIT_WAL |
| 139858 | 139828 | UNUSED_PARAMETER(db); |
| 139859 | 139829 | UNUSED_PARAMETER(nFrame); |
| 139860 | 139830 | #else |
| 139861 | 139831 | #ifdef SQLITE_ENABLE_API_ARMOR |
| | @@ -139872,11 +139842,11 @@ |
| 139872 | 139842 | |
| 139873 | 139843 | /* |
| 139874 | 139844 | ** Register a callback to be invoked each time a transaction is written |
| 139875 | 139845 | ** into the write-ahead-log by this database connection. |
| 139876 | 139846 | */ |
| 139877 | | -SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook( |
| 139847 | +SQLITE_API void *sqlite3_wal_hook( |
| 139878 | 139848 | sqlite3 *db, /* Attach the hook to this db handle */ |
| 139879 | 139849 | int(*xCallback)(void *, sqlite3*, const char*, int), |
| 139880 | 139850 | void *pArg /* First argument passed to xCallback() */ |
| 139881 | 139851 | ){ |
| 139882 | 139852 | #ifndef SQLITE_OMIT_WAL |
| | @@ -139899,11 +139869,11 @@ |
| 139899 | 139869 | } |
| 139900 | 139870 | |
| 139901 | 139871 | /* |
| 139902 | 139872 | ** Checkpoint database zDb. |
| 139903 | 139873 | */ |
| 139904 | | -SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2( |
| 139874 | +SQLITE_API int sqlite3_wal_checkpoint_v2( |
| 139905 | 139875 | sqlite3 *db, /* Database handle */ |
| 139906 | 139876 | const char *zDb, /* Name of attached database (or NULL) */ |
| 139907 | 139877 | int eMode, /* SQLITE_CHECKPOINT_* value */ |
| 139908 | 139878 | int *pnLog, /* OUT: Size of WAL log in frames */ |
| 139909 | 139879 | int *pnCkpt /* OUT: Total number of frames checkpointed */ |
| | @@ -139954,11 +139924,11 @@ |
| 139954 | 139924 | /* |
| 139955 | 139925 | ** Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points |
| 139956 | 139926 | ** to contains a zero-length string, all attached databases are |
| 139957 | 139927 | ** checkpointed. |
| 139958 | 139928 | */ |
| 139959 | | -SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){ |
| 139929 | +SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){ |
| 139960 | 139930 | /* EVIDENCE-OF: R-41613-20553 The sqlite3_wal_checkpoint(D,X) is equivalent to |
| 139961 | 139931 | ** sqlite3_wal_checkpoint_v2(D,X,SQLITE_CHECKPOINT_PASSIVE,0,0). */ |
| 139962 | 139932 | return sqlite3_wal_checkpoint_v2(db,zDb,SQLITE_CHECKPOINT_PASSIVE,0,0); |
| 139963 | 139933 | } |
| 139964 | 139934 | |
| | @@ -140045,11 +140015,11 @@ |
| 140045 | 140015 | |
| 140046 | 140016 | /* |
| 140047 | 140017 | ** Return UTF-8 encoded English language explanation of the most recent |
| 140048 | 140018 | ** error. |
| 140049 | 140019 | */ |
| 140050 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3 *db){ |
| 140020 | +SQLITE_API const char *sqlite3_errmsg(sqlite3 *db){ |
| 140051 | 140021 | const char *z; |
| 140052 | 140022 | if( !db ){ |
| 140053 | 140023 | return sqlite3ErrStr(SQLITE_NOMEM_BKPT); |
| 140054 | 140024 | } |
| 140055 | 140025 | if( !sqlite3SafetyCheckSickOrOk(db) ){ |
| | @@ -140073,11 +140043,11 @@ |
| 140073 | 140043 | #ifndef SQLITE_OMIT_UTF16 |
| 140074 | 140044 | /* |
| 140075 | 140045 | ** Return UTF-16 encoded English language explanation of the most recent |
| 140076 | 140046 | ** error. |
| 140077 | 140047 | */ |
| 140078 | | -SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3 *db){ |
| 140048 | +SQLITE_API const void *sqlite3_errmsg16(sqlite3 *db){ |
| 140079 | 140049 | static const u16 outOfMem[] = { |
| 140080 | 140050 | 'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0 |
| 140081 | 140051 | }; |
| 140082 | 140052 | static const u16 misuse[] = { |
| 140083 | 140053 | 'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ', |
| | @@ -140118,38 +140088,38 @@ |
| 140118 | 140088 | |
| 140119 | 140089 | /* |
| 140120 | 140090 | ** Return the most recent error code generated by an SQLite routine. If NULL is |
| 140121 | 140091 | ** passed to this function, we assume a malloc() failed during sqlite3_open(). |
| 140122 | 140092 | */ |
| 140123 | | -SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db){ |
| 140093 | +SQLITE_API int sqlite3_errcode(sqlite3 *db){ |
| 140124 | 140094 | if( db && !sqlite3SafetyCheckSickOrOk(db) ){ |
| 140125 | 140095 | return SQLITE_MISUSE_BKPT; |
| 140126 | 140096 | } |
| 140127 | 140097 | if( !db || db->mallocFailed ){ |
| 140128 | 140098 | return SQLITE_NOMEM_BKPT; |
| 140129 | 140099 | } |
| 140130 | 140100 | return db->errCode & db->errMask; |
| 140131 | 140101 | } |
| 140132 | | -SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db){ |
| 140102 | +SQLITE_API int sqlite3_extended_errcode(sqlite3 *db){ |
| 140133 | 140103 | if( db && !sqlite3SafetyCheckSickOrOk(db) ){ |
| 140134 | 140104 | return SQLITE_MISUSE_BKPT; |
| 140135 | 140105 | } |
| 140136 | 140106 | if( !db || db->mallocFailed ){ |
| 140137 | 140107 | return SQLITE_NOMEM_BKPT; |
| 140138 | 140108 | } |
| 140139 | 140109 | return db->errCode; |
| 140140 | 140110 | } |
| 140141 | | -SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3 *db){ |
| 140111 | +SQLITE_API int sqlite3_system_errno(sqlite3 *db){ |
| 140142 | 140112 | return db ? db->iSysErrno : 0; |
| 140143 | 140113 | } |
| 140144 | 140114 | |
| 140145 | 140115 | /* |
| 140146 | 140116 | ** Return a string that describes the kind of error specified in the |
| 140147 | 140117 | ** argument. For now, this simply calls the internal sqlite3ErrStr() |
| 140148 | 140118 | ** function. |
| 140149 | 140119 | */ |
| 140150 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int rc){ |
| 140120 | +SQLITE_API const char *sqlite3_errstr(int rc){ |
| 140151 | 140121 | return sqlite3ErrStr(rc); |
| 140152 | 140122 | } |
| 140153 | 140123 | |
| 140154 | 140124 | /* |
| 140155 | 140125 | ** Create a new collating function for database "db". The name is zName |
| | @@ -140293,11 +140263,11 @@ |
| 140293 | 140263 | ** |
| 140294 | 140264 | ** A new lower limit does not shrink existing constructs. |
| 140295 | 140265 | ** It merely prevents new constructs that exceed the limit |
| 140296 | 140266 | ** from forming. |
| 140297 | 140267 | */ |
| 140298 | | -SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3 *db, int limitId, int newLimit){ |
| 140268 | +SQLITE_API int sqlite3_limit(sqlite3 *db, int limitId, int newLimit){ |
| 140299 | 140269 | int oldLimit; |
| 140300 | 140270 | |
| 140301 | 140271 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 140302 | 140272 | if( !sqlite3SafetyCheckOk(db) ){ |
| 140303 | 140273 | (void)SQLITE_MISUSE_BKPT; |
| | @@ -140920,18 +140890,18 @@ |
| 140920 | 140890 | } |
| 140921 | 140891 | |
| 140922 | 140892 | /* |
| 140923 | 140893 | ** Open a new database handle. |
| 140924 | 140894 | */ |
| 140925 | | -SQLITE_API int SQLITE_STDCALL sqlite3_open( |
| 140895 | +SQLITE_API int sqlite3_open( |
| 140926 | 140896 | const char *zFilename, |
| 140927 | 140897 | sqlite3 **ppDb |
| 140928 | 140898 | ){ |
| 140929 | 140899 | return openDatabase(zFilename, ppDb, |
| 140930 | 140900 | SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0); |
| 140931 | 140901 | } |
| 140932 | | -SQLITE_API int SQLITE_STDCALL sqlite3_open_v2( |
| 140902 | +SQLITE_API int sqlite3_open_v2( |
| 140933 | 140903 | const char *filename, /* Database filename (UTF-8) */ |
| 140934 | 140904 | sqlite3 **ppDb, /* OUT: SQLite db handle */ |
| 140935 | 140905 | int flags, /* Flags */ |
| 140936 | 140906 | const char *zVfs /* Name of VFS module to use */ |
| 140937 | 140907 | ){ |
| | @@ -140940,11 +140910,11 @@ |
| 140940 | 140910 | |
| 140941 | 140911 | #ifndef SQLITE_OMIT_UTF16 |
| 140942 | 140912 | /* |
| 140943 | 140913 | ** Open a new database handle. |
| 140944 | 140914 | */ |
| 140945 | | -SQLITE_API int SQLITE_STDCALL sqlite3_open16( |
| 140915 | +SQLITE_API int sqlite3_open16( |
| 140946 | 140916 | const void *zFilename, |
| 140947 | 140917 | sqlite3 **ppDb |
| 140948 | 140918 | ){ |
| 140949 | 140919 | char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */ |
| 140950 | 140920 | sqlite3_value *pVal; |
| | @@ -140979,11 +140949,11 @@ |
| 140979 | 140949 | #endif /* SQLITE_OMIT_UTF16 */ |
| 140980 | 140950 | |
| 140981 | 140951 | /* |
| 140982 | 140952 | ** Register a new collation sequence with the database handle db. |
| 140983 | 140953 | */ |
| 140984 | | -SQLITE_API int SQLITE_STDCALL sqlite3_create_collation( |
| 140954 | +SQLITE_API int sqlite3_create_collation( |
| 140985 | 140955 | sqlite3* db, |
| 140986 | 140956 | const char *zName, |
| 140987 | 140957 | int enc, |
| 140988 | 140958 | void* pCtx, |
| 140989 | 140959 | int(*xCompare)(void*,int,const void*,int,const void*) |
| | @@ -140992,11 +140962,11 @@ |
| 140992 | 140962 | } |
| 140993 | 140963 | |
| 140994 | 140964 | /* |
| 140995 | 140965 | ** Register a new collation sequence with the database handle db. |
| 140996 | 140966 | */ |
| 140997 | | -SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2( |
| 140967 | +SQLITE_API int sqlite3_create_collation_v2( |
| 140998 | 140968 | sqlite3* db, |
| 140999 | 140969 | const char *zName, |
| 141000 | 140970 | int enc, |
| 141001 | 140971 | void* pCtx, |
| 141002 | 140972 | int(*xCompare)(void*,int,const void*,int,const void*), |
| | @@ -141017,11 +140987,11 @@ |
| 141017 | 140987 | |
| 141018 | 140988 | #ifndef SQLITE_OMIT_UTF16 |
| 141019 | 140989 | /* |
| 141020 | 140990 | ** Register a new collation sequence with the database handle db. |
| 141021 | 140991 | */ |
| 141022 | | -SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16( |
| 140992 | +SQLITE_API int sqlite3_create_collation16( |
| 141023 | 140993 | sqlite3* db, |
| 141024 | 140994 | const void *zName, |
| 141025 | 140995 | int enc, |
| 141026 | 140996 | void* pCtx, |
| 141027 | 140997 | int(*xCompare)(void*,int,const void*,int,const void*) |
| | @@ -141047,11 +141017,11 @@ |
| 141047 | 141017 | |
| 141048 | 141018 | /* |
| 141049 | 141019 | ** Register a collation sequence factory callback with the database handle |
| 141050 | 141020 | ** db. Replace any previously installed collation sequence factory. |
| 141051 | 141021 | */ |
| 141052 | | -SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed( |
| 141022 | +SQLITE_API int sqlite3_collation_needed( |
| 141053 | 141023 | sqlite3 *db, |
| 141054 | 141024 | void *pCollNeededArg, |
| 141055 | 141025 | void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*) |
| 141056 | 141026 | ){ |
| 141057 | 141027 | #ifdef SQLITE_ENABLE_API_ARMOR |
| | @@ -141068,11 +141038,11 @@ |
| 141068 | 141038 | #ifndef SQLITE_OMIT_UTF16 |
| 141069 | 141039 | /* |
| 141070 | 141040 | ** Register a collation sequence factory callback with the database handle |
| 141071 | 141041 | ** db. Replace any previously installed collation sequence factory. |
| 141072 | 141042 | */ |
| 141073 | | -SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16( |
| 141043 | +SQLITE_API int sqlite3_collation_needed16( |
| 141074 | 141044 | sqlite3 *db, |
| 141075 | 141045 | void *pCollNeededArg, |
| 141076 | 141046 | void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*) |
| 141077 | 141047 | ){ |
| 141078 | 141048 | #ifdef SQLITE_ENABLE_API_ARMOR |
| | @@ -141090,11 +141060,11 @@ |
| 141090 | 141060 | #ifndef SQLITE_OMIT_DEPRECATED |
| 141091 | 141061 | /* |
| 141092 | 141062 | ** This function is now an anachronism. It used to be used to recover from a |
| 141093 | 141063 | ** malloc() failure, but SQLite now does this automatically. |
| 141094 | 141064 | */ |
| 141095 | | -SQLITE_API int SQLITE_STDCALL sqlite3_global_recover(void){ |
| 141065 | +SQLITE_API int sqlite3_global_recover(void){ |
| 141096 | 141066 | return SQLITE_OK; |
| 141097 | 141067 | } |
| 141098 | 141068 | #endif |
| 141099 | 141069 | |
| 141100 | 141070 | /* |
| | @@ -141101,11 +141071,11 @@ |
| 141101 | 141071 | ** Test to see whether or not the database connection is in autocommit |
| 141102 | 141072 | ** mode. Return TRUE if it is and FALSE if not. Autocommit mode is on |
| 141103 | 141073 | ** by default. Autocommit is disabled by a BEGIN statement and reenabled |
| 141104 | 141074 | ** by the next COMMIT or ROLLBACK. |
| 141105 | 141075 | */ |
| 141106 | | -SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3 *db){ |
| 141076 | +SQLITE_API int sqlite3_get_autocommit(sqlite3 *db){ |
| 141107 | 141077 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 141108 | 141078 | if( !sqlite3SafetyCheckOk(db) ){ |
| 141109 | 141079 | (void)SQLITE_MISUSE_BKPT; |
| 141110 | 141080 | return 0; |
| 141111 | 141081 | } |
| | @@ -141158,19 +141128,19 @@ |
| 141158 | 141128 | ** data for this thread has been deallocated. |
| 141159 | 141129 | ** |
| 141160 | 141130 | ** SQLite no longer uses thread-specific data so this routine is now a |
| 141161 | 141131 | ** no-op. It is retained for historical compatibility. |
| 141162 | 141132 | */ |
| 141163 | | -SQLITE_API void SQLITE_STDCALL sqlite3_thread_cleanup(void){ |
| 141133 | +SQLITE_API void sqlite3_thread_cleanup(void){ |
| 141164 | 141134 | } |
| 141165 | 141135 | #endif |
| 141166 | 141136 | |
| 141167 | 141137 | /* |
| 141168 | 141138 | ** Return meta information about a specific column of a database table. |
| 141169 | 141139 | ** See comment in sqlite3.h (sqlite.h.in) for details. |
| 141170 | 141140 | */ |
| 141171 | | -SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata( |
| 141141 | +SQLITE_API int sqlite3_table_column_metadata( |
| 141172 | 141142 | sqlite3 *db, /* Connection handle */ |
| 141173 | 141143 | const char *zDbName, /* Database name or NULL */ |
| 141174 | 141144 | const char *zTableName, /* Table name */ |
| 141175 | 141145 | const char *zColumnName, /* Column name */ |
| 141176 | 141146 | char const **pzDataType, /* OUTPUT: Declared data type */ |
| | @@ -141284,11 +141254,11 @@ |
| 141284 | 141254 | } |
| 141285 | 141255 | |
| 141286 | 141256 | /* |
| 141287 | 141257 | ** Sleep for a little while. Return the amount of time slept. |
| 141288 | 141258 | */ |
| 141289 | | -SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int ms){ |
| 141259 | +SQLITE_API int sqlite3_sleep(int ms){ |
| 141290 | 141260 | sqlite3_vfs *pVfs; |
| 141291 | 141261 | int rc; |
| 141292 | 141262 | pVfs = sqlite3_vfs_find(0); |
| 141293 | 141263 | if( pVfs==0 ) return 0; |
| 141294 | 141264 | |
| | @@ -141300,11 +141270,11 @@ |
| 141300 | 141270 | } |
| 141301 | 141271 | |
| 141302 | 141272 | /* |
| 141303 | 141273 | ** Enable or disable the extended result codes. |
| 141304 | 141274 | */ |
| 141305 | | -SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3 *db, int onoff){ |
| 141275 | +SQLITE_API int sqlite3_extended_result_codes(sqlite3 *db, int onoff){ |
| 141306 | 141276 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 141307 | 141277 | if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
| 141308 | 141278 | #endif |
| 141309 | 141279 | sqlite3_mutex_enter(db->mutex); |
| 141310 | 141280 | db->errMask = onoff ? 0xffffffff : 0xff; |
| | @@ -141313,11 +141283,11 @@ |
| 141313 | 141283 | } |
| 141314 | 141284 | |
| 141315 | 141285 | /* |
| 141316 | 141286 | ** Invoke the xFileControl method on a particular database. |
| 141317 | 141287 | */ |
| 141318 | | -SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){ |
| 141288 | +SQLITE_API int sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){ |
| 141319 | 141289 | int rc = SQLITE_ERROR; |
| 141320 | 141290 | Btree *pBtree; |
| 141321 | 141291 | |
| 141322 | 141292 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 141323 | 141293 | if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
| | @@ -141353,11 +141323,11 @@ |
| 141353 | 141323 | } |
| 141354 | 141324 | |
| 141355 | 141325 | /* |
| 141356 | 141326 | ** Interface to the testing logic. |
| 141357 | 141327 | */ |
| 141358 | | -SQLITE_API int SQLITE_CDECL sqlite3_test_control(int op, ...){ |
| 141328 | +SQLITE_API int sqlite3_test_control(int op, ...){ |
| 141359 | 141329 | int rc = 0; |
| 141360 | 141330 | #ifdef SQLITE_OMIT_BUILTIN_TEST |
| 141361 | 141331 | UNUSED_PARAMETER(op); |
| 141362 | 141332 | #else |
| 141363 | 141333 | va_list ap; |
| | @@ -141621,10 +141591,19 @@ |
| 141621 | 141591 | case SQLITE_TESTCTRL_NEVER_CORRUPT: { |
| 141622 | 141592 | sqlite3GlobalConfig.neverCorrupt = va_arg(ap, int); |
| 141623 | 141593 | break; |
| 141624 | 141594 | } |
| 141625 | 141595 | |
| 141596 | + /* Set the threshold at which OP_Once counters reset back to zero. |
| 141597 | + ** By default this is 0x7ffffffe (over 2 billion), but that value is |
| 141598 | + ** too big to test in a reasonable amount of time, so this control is |
| 141599 | + ** provided to set a small and easily reachable reset value. |
| 141600 | + */ |
| 141601 | + case SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD: { |
| 141602 | + sqlite3GlobalConfig.iOnceResetThreshold = va_arg(ap, int); |
| 141603 | + break; |
| 141604 | + } |
| 141626 | 141605 | |
| 141627 | 141606 | /* sqlite3_test_control(SQLITE_TESTCTRL_VDBE_COVERAGE, xCallback, ptr); |
| 141628 | 141607 | ** |
| 141629 | 141608 | ** Set the VDBE coverage callback function to xCallback with context |
| 141630 | 141609 | ** pointer ptr. |
| | @@ -141698,11 +141677,11 @@ |
| 141698 | 141677 | ** method of a VFS implementation. The zParam argument is the name of the |
| 141699 | 141678 | ** query parameter we seek. This routine returns the value of the zParam |
| 141700 | 141679 | ** parameter if it exists. If the parameter does not exist, this routine |
| 141701 | 141680 | ** returns a NULL pointer. |
| 141702 | 141681 | */ |
| 141703 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam){ |
| 141682 | +SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam){ |
| 141704 | 141683 | if( zFilename==0 || zParam==0 ) return 0; |
| 141705 | 141684 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| 141706 | 141685 | while( zFilename[0] ){ |
| 141707 | 141686 | int x = strcmp(zFilename, zParam); |
| 141708 | 141687 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| | @@ -141713,20 +141692,20 @@ |
| 141713 | 141692 | } |
| 141714 | 141693 | |
| 141715 | 141694 | /* |
| 141716 | 141695 | ** Return a boolean value for a query parameter. |
| 141717 | 141696 | */ |
| 141718 | | -SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){ |
| 141697 | +SQLITE_API int sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){ |
| 141719 | 141698 | const char *z = sqlite3_uri_parameter(zFilename, zParam); |
| 141720 | 141699 | bDflt = bDflt!=0; |
| 141721 | 141700 | return z ? sqlite3GetBoolean(z, bDflt) : bDflt; |
| 141722 | 141701 | } |
| 141723 | 141702 | |
| 141724 | 141703 | /* |
| 141725 | 141704 | ** Return a 64-bit integer value for a query parameter. |
| 141726 | 141705 | */ |
| 141727 | | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64( |
| 141706 | +SQLITE_API sqlite3_int64 sqlite3_uri_int64( |
| 141728 | 141707 | const char *zFilename, /* Filename as passed to xOpen */ |
| 141729 | 141708 | const char *zParam, /* URI parameter sought */ |
| 141730 | 141709 | sqlite3_int64 bDflt /* return if parameter is missing */ |
| 141731 | 141710 | ){ |
| 141732 | 141711 | const char *z = sqlite3_uri_parameter(zFilename, zParam); |
| | @@ -141754,11 +141733,11 @@ |
| 141754 | 141733 | |
| 141755 | 141734 | /* |
| 141756 | 141735 | ** Return the filename of the database associated with a database |
| 141757 | 141736 | ** connection. |
| 141758 | 141737 | */ |
| 141759 | | -SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName){ |
| 141738 | +SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName){ |
| 141760 | 141739 | Btree *pBt; |
| 141761 | 141740 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 141762 | 141741 | if( !sqlite3SafetyCheckOk(db) ){ |
| 141763 | 141742 | (void)SQLITE_MISUSE_BKPT; |
| 141764 | 141743 | return 0; |
| | @@ -141770,11 +141749,11 @@ |
| 141770 | 141749 | |
| 141771 | 141750 | /* |
| 141772 | 141751 | ** Return 1 if database is read-only or 0 if read/write. Return -1 if |
| 141773 | 141752 | ** no such database exists. |
| 141774 | 141753 | */ |
| 141775 | | -SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName){ |
| 141754 | +SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName){ |
| 141776 | 141755 | Btree *pBt; |
| 141777 | 141756 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 141778 | 141757 | if( !sqlite3SafetyCheckOk(db) ){ |
| 141779 | 141758 | (void)SQLITE_MISUSE_BKPT; |
| 141780 | 141759 | return -1; |
| | @@ -141787,11 +141766,11 @@ |
| 141787 | 141766 | #ifdef SQLITE_ENABLE_SNAPSHOT |
| 141788 | 141767 | /* |
| 141789 | 141768 | ** Obtain a snapshot handle for the snapshot of database zDb currently |
| 141790 | 141769 | ** being read by handle db. |
| 141791 | 141770 | */ |
| 141792 | | -SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_get( |
| 141771 | +SQLITE_API int sqlite3_snapshot_get( |
| 141793 | 141772 | sqlite3 *db, |
| 141794 | 141773 | const char *zDb, |
| 141795 | 141774 | sqlite3_snapshot **ppSnapshot |
| 141796 | 141775 | ){ |
| 141797 | 141776 | int rc = SQLITE_ERROR; |
| | @@ -141822,11 +141801,11 @@ |
| 141822 | 141801 | } |
| 141823 | 141802 | |
| 141824 | 141803 | /* |
| 141825 | 141804 | ** Open a read-transaction on the snapshot idendified by pSnapshot. |
| 141826 | 141805 | */ |
| 141827 | | -SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_open( |
| 141806 | +SQLITE_API int sqlite3_snapshot_open( |
| 141828 | 141807 | sqlite3 *db, |
| 141829 | 141808 | const char *zDb, |
| 141830 | 141809 | sqlite3_snapshot *pSnapshot |
| 141831 | 141810 | ){ |
| 141832 | 141811 | int rc = SQLITE_ERROR; |
| | @@ -141859,11 +141838,11 @@ |
| 141859 | 141838 | } |
| 141860 | 141839 | |
| 141861 | 141840 | /* |
| 141862 | 141841 | ** Free a snapshot handle obtained from sqlite3_snapshot_get(). |
| 141863 | 141842 | */ |
| 141864 | | -SQLITE_API void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot *pSnapshot){ |
| 141843 | +SQLITE_API void sqlite3_snapshot_free(sqlite3_snapshot *pSnapshot){ |
| 141865 | 141844 | sqlite3_free(pSnapshot); |
| 141866 | 141845 | } |
| 141867 | 141846 | #endif /* SQLITE_ENABLE_SNAPSHOT */ |
| 141868 | 141847 | |
| 141869 | 141848 | /************** End of main.c ************************************************/ |
| | @@ -142013,11 +141992,11 @@ |
| 142013 | 141992 | ** |
| 142014 | 141993 | ** Each call to this routine overrides any prior callbacks registered |
| 142015 | 141994 | ** on the same "db". If xNotify==0 then any prior callbacks are immediately |
| 142016 | 141995 | ** cancelled. |
| 142017 | 141996 | */ |
| 142018 | | -SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify( |
| 141997 | +SQLITE_API int sqlite3_unlock_notify( |
| 142019 | 141998 | sqlite3 *db, |
| 142020 | 141999 | void (*xNotify)(void **, int), |
| 142021 | 142000 | void *pArg |
| 142022 | 142001 | ){ |
| 142023 | 142002 | int rc = SQLITE_OK; |
| | @@ -149016,11 +148995,11 @@ |
| 149016 | 148995 | ** Initialize API pointer table, if required. |
| 149017 | 148996 | */ |
| 149018 | 148997 | #ifdef _WIN32 |
| 149019 | 148998 | __declspec(dllexport) |
| 149020 | 148999 | #endif |
| 149021 | | -SQLITE_API int SQLITE_STDCALL sqlite3_fts3_init( |
| 149000 | +SQLITE_API int sqlite3_fts3_init( |
| 149022 | 149001 | sqlite3 *db, |
| 149023 | 149002 | char **pzErrMsg, |
| 149024 | 149003 | const sqlite3_api_routines *pApi |
| 149025 | 149004 | ){ |
| 149026 | 149005 | SQLITE_EXTENSION_INIT2(pApi) |
| | @@ -164817,11 +164796,11 @@ |
| 164817 | 164796 | } |
| 164818 | 164797 | |
| 164819 | 164798 | /* |
| 164820 | 164799 | ** Register a new geometry function for use with the r-tree MATCH operator. |
| 164821 | 164800 | */ |
| 164822 | | -SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback( |
| 164801 | +SQLITE_API int sqlite3_rtree_geometry_callback( |
| 164823 | 164802 | sqlite3 *db, /* Register SQL function on this connection */ |
| 164824 | 164803 | const char *zGeom, /* Name of the new SQL function */ |
| 164825 | 164804 | int (*xGeom)(sqlite3_rtree_geometry*,int,RtreeDValue*,int*), /* Callback */ |
| 164826 | 164805 | void *pContext /* Extra data associated with the callback */ |
| 164827 | 164806 | ){ |
| | @@ -164841,11 +164820,11 @@ |
| 164841 | 164820 | |
| 164842 | 164821 | /* |
| 164843 | 164822 | ** Register a new 2nd-generation geometry function for use with the |
| 164844 | 164823 | ** r-tree MATCH operator. |
| 164845 | 164824 | */ |
| 164846 | | -SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback( |
| 164825 | +SQLITE_API int sqlite3_rtree_query_callback( |
| 164847 | 164826 | sqlite3 *db, /* Register SQL function on this connection */ |
| 164848 | 164827 | const char *zQueryFunc, /* Name of new SQL function */ |
| 164849 | 164828 | int (*xQueryFunc)(sqlite3_rtree_query_info*), /* Callback */ |
| 164850 | 164829 | void *pContext, /* Extra data passed into the callback */ |
| 164851 | 164830 | void (*xDestructor)(void*) /* Destructor for the extra data */ |
| | @@ -164866,11 +164845,11 @@ |
| 164866 | 164845 | |
| 164867 | 164846 | #if !SQLITE_CORE |
| 164868 | 164847 | #ifdef _WIN32 |
| 164869 | 164848 | __declspec(dllexport) |
| 164870 | 164849 | #endif |
| 164871 | | -SQLITE_API int SQLITE_STDCALL sqlite3_rtree_init( |
| 164850 | +SQLITE_API int sqlite3_rtree_init( |
| 164872 | 164851 | sqlite3 *db, |
| 164873 | 164852 | char **pzErrMsg, |
| 164874 | 164853 | const sqlite3_api_routines *pApi |
| 164875 | 164854 | ){ |
| 164876 | 164855 | SQLITE_EXTENSION_INIT2(pApi) |
| | @@ -165417,11 +165396,11 @@ |
| 165417 | 165396 | |
| 165418 | 165397 | #if !SQLITE_CORE |
| 165419 | 165398 | #ifdef _WIN32 |
| 165420 | 165399 | __declspec(dllexport) |
| 165421 | 165400 | #endif |
| 165422 | | -SQLITE_API int SQLITE_STDCALL sqlite3_icu_init( |
| 165401 | +SQLITE_API int sqlite3_icu_init( |
| 165423 | 165402 | sqlite3 *db, |
| 165424 | 165403 | char **pzErrMsg, |
| 165425 | 165404 | const sqlite3_api_routines *pApi |
| 165426 | 165405 | ){ |
| 165427 | 165406 | SQLITE_EXTENSION_INIT2(pApi) |
| | @@ -166097,11 +166076,11 @@ |
| 166097 | 166076 | ** IMPORTANT NOTE FOR ZIPVFS USERS: The RBU extension works with all of |
| 166098 | 166077 | ** SQLite's built-in VFSs, including the multiplexor VFS. However it does |
| 166099 | 166078 | ** not work out of the box with zipvfs. Refer to the comment describing |
| 166100 | 166079 | ** the zipvfs_create_vfs() API below for details on using RBU with zipvfs. |
| 166101 | 166080 | */ |
| 166102 | | -SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_open( |
| 166081 | +SQLITE_API sqlite3rbu *sqlite3rbu_open( |
| 166103 | 166082 | const char *zTarget, |
| 166104 | 166083 | const char *zRbu, |
| 166105 | 166084 | const char *zState |
| 166106 | 166085 | ); |
| 166107 | 166086 | |
| | @@ -166136,11 +166115,11 @@ |
| 166136 | 166115 | ** As with sqlite3rbu_open(), Zipvfs users should rever to the comment |
| 166137 | 166116 | ** describing the sqlite3rbu_create_vfs() API function below for |
| 166138 | 166117 | ** a description of the complications associated with using RBU with |
| 166139 | 166118 | ** zipvfs databases. |
| 166140 | 166119 | */ |
| 166141 | | -SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_vacuum( |
| 166120 | +SQLITE_API sqlite3rbu *sqlite3rbu_vacuum( |
| 166142 | 166121 | const char *zTarget, |
| 166143 | 166122 | const char *zState |
| 166144 | 166123 | ); |
| 166145 | 166124 | |
| 166146 | 166125 | /* |
| | @@ -166172,11 +166151,11 @@ |
| 166172 | 166151 | ** when sqlite3rbu_close() is called. |
| 166173 | 166152 | ** |
| 166174 | 166153 | ** Database handles returned by this function remain valid until the next |
| 166175 | 166154 | ** call to any sqlite3rbu_xxx() function other than sqlite3rbu_db(). |
| 166176 | 166155 | */ |
| 166177 | | -SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3rbu_db(sqlite3rbu*, int bRbu); |
| 166156 | +SQLITE_API sqlite3 *sqlite3rbu_db(sqlite3rbu*, int bRbu); |
| 166178 | 166157 | |
| 166179 | 166158 | /* |
| 166180 | 166159 | ** Do some work towards applying the RBU update to the target db. |
| 166181 | 166160 | ** |
| 166182 | 166161 | ** Return SQLITE_DONE if the update has been completely applied, or |
| | @@ -166186,11 +166165,11 @@ |
| 166186 | 166165 | ** |
| 166187 | 166166 | ** Once a call to sqlite3rbu_step() has returned a value other than |
| 166188 | 166167 | ** SQLITE_OK, all subsequent calls on the same RBU handle are no-ops |
| 166189 | 166168 | ** that immediately return the same value. |
| 166190 | 166169 | */ |
| 166191 | | -SQLITE_API int SQLITE_STDCALL sqlite3rbu_step(sqlite3rbu *pRbu); |
| 166170 | +SQLITE_API int sqlite3rbu_step(sqlite3rbu *pRbu); |
| 166192 | 166171 | |
| 166193 | 166172 | /* |
| 166194 | 166173 | ** Force RBU to save its state to disk. |
| 166195 | 166174 | ** |
| 166196 | 166175 | ** If a power failure or application crash occurs during an update, following |
| | @@ -166198,11 +166177,11 @@ |
| 166198 | 166177 | ** was last saved. In other words, from the most recent successful call to |
| 166199 | 166178 | ** sqlite3rbu_close() or this function. |
| 166200 | 166179 | ** |
| 166201 | 166180 | ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. |
| 166202 | 166181 | */ |
| 166203 | | -SQLITE_API int SQLITE_STDCALL sqlite3rbu_savestate(sqlite3rbu *pRbu); |
| 166182 | +SQLITE_API int sqlite3rbu_savestate(sqlite3rbu *pRbu); |
| 166204 | 166183 | |
| 166205 | 166184 | /* |
| 166206 | 166185 | ** Close an RBU handle. |
| 166207 | 166186 | ** |
| 166208 | 166187 | ** If the RBU update has been completely applied, mark the RBU database |
| | @@ -166218,18 +166197,18 @@ |
| 166218 | 166197 | ** |
| 166219 | 166198 | ** Otherwise, if no error occurs, this function returns SQLITE_OK if the |
| 166220 | 166199 | ** update has been partially applied, or SQLITE_DONE if it has been |
| 166221 | 166200 | ** completely applied. |
| 166222 | 166201 | */ |
| 166223 | | -SQLITE_API int SQLITE_STDCALL sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg); |
| 166202 | +SQLITE_API int sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg); |
| 166224 | 166203 | |
| 166225 | 166204 | /* |
| 166226 | 166205 | ** Return the total number of key-value operations (inserts, deletes or |
| 166227 | 166206 | ** updates) that have been performed on the target database since the |
| 166228 | 166207 | ** current RBU update was started. |
| 166229 | 166208 | */ |
| 166230 | | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3rbu_progress(sqlite3rbu *pRbu); |
| 166209 | +SQLITE_API sqlite3_int64 sqlite3rbu_progress(sqlite3rbu *pRbu); |
| 166231 | 166210 | |
| 166232 | 166211 | /* |
| 166233 | 166212 | ** Obtain permyriadage (permyriadage is to 10000 as percentage is to 100) |
| 166234 | 166213 | ** progress indications for the two stages of an RBU update. This API may |
| 166235 | 166214 | ** be useful for driving GUI progress indicators and similar. |
| | @@ -166267,11 +166246,11 @@ |
| 166267 | 166246 | ** permyriadage progress of the same stage. If the rbu_count table does |
| 166268 | 166247 | ** not exist, then (*pnOne) is set to -1 during stage 1. If the rbu_count |
| 166269 | 166248 | ** table exists but is not correctly populated, the value of the *pnOne |
| 166270 | 166249 | ** output variable during stage 1 is undefined. |
| 166271 | 166250 | */ |
| 166272 | | -SQLITE_API void SQLITE_STDCALL sqlite3rbu_bp_progress(sqlite3rbu *pRbu, int *pnOne, int *pnTwo); |
| 166251 | +SQLITE_API void sqlite3rbu_bp_progress(sqlite3rbu *pRbu, int *pnOne, int *pnTwo); |
| 166273 | 166252 | |
| 166274 | 166253 | /* |
| 166275 | 166254 | ** Obtain an indication as to the current stage of an RBU update or vacuum. |
| 166276 | 166255 | ** This function always returns one of the SQLITE_RBU_STATE_XXX constants |
| 166277 | 166256 | ** defined in this file. Return values should be interpreted as follows: |
| | @@ -166305,11 +166284,11 @@ |
| 166305 | 166284 | #define SQLITE_RBU_STATE_MOVE 2 |
| 166306 | 166285 | #define SQLITE_RBU_STATE_CHECKPOINT 3 |
| 166307 | 166286 | #define SQLITE_RBU_STATE_DONE 4 |
| 166308 | 166287 | #define SQLITE_RBU_STATE_ERROR 5 |
| 166309 | 166288 | |
| 166310 | | -SQLITE_API int SQLITE_STDCALL sqlite3rbu_state(sqlite3rbu *pRbu); |
| 166289 | +SQLITE_API int sqlite3rbu_state(sqlite3rbu *pRbu); |
| 166311 | 166290 | |
| 166312 | 166291 | /* |
| 166313 | 166292 | ** Create an RBU VFS named zName that accesses the underlying file-system |
| 166314 | 166293 | ** via existing VFS zParent. Or, if the zParent parameter is passed NULL, |
| 166315 | 166294 | ** then the new RBU VFS uses the default system VFS to access the file-system. |
| | @@ -166349,21 +166328,21 @@ |
| 166349 | 166328 | ** The overhead of adding the "rbu" VFS to the system is negligible for |
| 166350 | 166329 | ** non-RBU users. There is no harm in an application accessing the |
| 166351 | 166330 | ** file-system via "rbu" all the time, even if it only uses RBU functionality |
| 166352 | 166331 | ** occasionally. |
| 166353 | 166332 | */ |
| 166354 | | -SQLITE_API int SQLITE_STDCALL sqlite3rbu_create_vfs(const char *zName, const char *zParent); |
| 166333 | +SQLITE_API int sqlite3rbu_create_vfs(const char *zName, const char *zParent); |
| 166355 | 166334 | |
| 166356 | 166335 | /* |
| 166357 | 166336 | ** Deregister and destroy an RBU vfs created by an earlier call to |
| 166358 | 166337 | ** sqlite3rbu_create_vfs(). |
| 166359 | 166338 | ** |
| 166360 | 166339 | ** VFS objects are not reference counted. If a VFS object is destroyed |
| 166361 | 166340 | ** before all database handles that use it have been closed, the results |
| 166362 | 166341 | ** are undefined. |
| 166363 | 166342 | */ |
| 166364 | | -SQLITE_API void SQLITE_STDCALL sqlite3rbu_destroy_vfs(const char *zName); |
| 166343 | +SQLITE_API void sqlite3rbu_destroy_vfs(const char *zName); |
| 166365 | 166344 | |
| 166366 | 166345 | #if 0 |
| 166367 | 166346 | } /* end of the 'extern "C"' block */ |
| 166368 | 166347 | #endif |
| 166369 | 166348 | |
| | @@ -169456,11 +169435,11 @@ |
| 169456 | 169435 | } |
| 169457 | 169436 | |
| 169458 | 169437 | /* |
| 169459 | 169438 | ** Step the RBU object. |
| 169460 | 169439 | */ |
| 169461 | | -SQLITE_API int SQLITE_STDCALL sqlite3rbu_step(sqlite3rbu *p){ |
| 169440 | +SQLITE_API int sqlite3rbu_step(sqlite3rbu *p){ |
| 169462 | 169441 | if( p ){ |
| 169463 | 169442 | switch( p->eStage ){ |
| 169464 | 169443 | case RBU_STAGE_OAL: { |
| 169465 | 169444 | RbuObjIter *pIter = &p->objiter; |
| 169466 | 169445 | |
| | @@ -169910,11 +169889,11 @@ |
| 169910 | 169889 | } |
| 169911 | 169890 | |
| 169912 | 169891 | /* |
| 169913 | 169892 | ** Open and return a new RBU handle. |
| 169914 | 169893 | */ |
| 169915 | | -SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_open( |
| 169894 | +SQLITE_API sqlite3rbu *sqlite3rbu_open( |
| 169916 | 169895 | const char *zTarget, |
| 169917 | 169896 | const char *zRbu, |
| 169918 | 169897 | const char *zState |
| 169919 | 169898 | ){ |
| 169920 | 169899 | if( zTarget==0 || zRbu==0 ){ return rbuMisuseError(); } |
| | @@ -169923,11 +169902,11 @@ |
| 169923 | 169902 | } |
| 169924 | 169903 | |
| 169925 | 169904 | /* |
| 169926 | 169905 | ** Open a handle to begin or resume an RBU VACUUM operation. |
| 169927 | 169906 | */ |
| 169928 | | -SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_vacuum( |
| 169907 | +SQLITE_API sqlite3rbu *sqlite3rbu_vacuum( |
| 169929 | 169908 | const char *zTarget, |
| 169930 | 169909 | const char *zState |
| 169931 | 169910 | ){ |
| 169932 | 169911 | if( zTarget==0 ){ return rbuMisuseError(); } |
| 169933 | 169912 | /* TODO: Check that both arguments are non-NULL */ |
| | @@ -169935,11 +169914,11 @@ |
| 169935 | 169914 | } |
| 169936 | 169915 | |
| 169937 | 169916 | /* |
| 169938 | 169917 | ** Return the database handle used by pRbu. |
| 169939 | 169918 | */ |
| 169940 | | -SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3rbu_db(sqlite3rbu *pRbu, int bRbu){ |
| 169919 | +SQLITE_API sqlite3 *sqlite3rbu_db(sqlite3rbu *pRbu, int bRbu){ |
| 169941 | 169920 | sqlite3 *db = 0; |
| 169942 | 169921 | if( pRbu ){ |
| 169943 | 169922 | db = (bRbu ? pRbu->dbRbu : pRbu->dbMain); |
| 169944 | 169923 | } |
| 169945 | 169924 | return db; |
| | @@ -169967,11 +169946,11 @@ |
| 169967 | 169946 | } |
| 169968 | 169947 | |
| 169969 | 169948 | /* |
| 169970 | 169949 | ** Close the RBU handle. |
| 169971 | 169950 | */ |
| 169972 | | -SQLITE_API int SQLITE_STDCALL sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){ |
| 169951 | +SQLITE_API int sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){ |
| 169973 | 169952 | int rc; |
| 169974 | 169953 | if( p ){ |
| 169975 | 169954 | |
| 169976 | 169955 | /* Commit the transaction to the *-oal file. */ |
| 169977 | 169956 | if( p->rc==SQLITE_OK && p->eStage==RBU_STAGE_OAL ){ |
| | @@ -170019,19 +169998,19 @@ |
| 170019 | 169998 | /* |
| 170020 | 169999 | ** Return the total number of key-value operations (inserts, deletes or |
| 170021 | 170000 | ** updates) that have been performed on the target database since the |
| 170022 | 170001 | ** current RBU update was started. |
| 170023 | 170002 | */ |
| 170024 | | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3rbu_progress(sqlite3rbu *pRbu){ |
| 170003 | +SQLITE_API sqlite3_int64 sqlite3rbu_progress(sqlite3rbu *pRbu){ |
| 170025 | 170004 | return pRbu->nProgress; |
| 170026 | 170005 | } |
| 170027 | 170006 | |
| 170028 | 170007 | /* |
| 170029 | 170008 | ** Return permyriadage progress indications for the two main stages of |
| 170030 | 170009 | ** an RBU update. |
| 170031 | 170010 | */ |
| 170032 | | -SQLITE_API void SQLITE_STDCALL sqlite3rbu_bp_progress(sqlite3rbu *p, int *pnOne, int *pnTwo){ |
| 170011 | +SQLITE_API void sqlite3rbu_bp_progress(sqlite3rbu *p, int *pnOne, int *pnTwo){ |
| 170033 | 170012 | const int MAX_PROGRESS = 10000; |
| 170034 | 170013 | switch( p->eStage ){ |
| 170035 | 170014 | case RBU_STAGE_OAL: |
| 170036 | 170015 | if( p->nPhaseOneStep>0 ){ |
| 170037 | 170016 | *pnOne = (int)(MAX_PROGRESS * (i64)p->nProgress/(i64)p->nPhaseOneStep); |
| | @@ -170062,11 +170041,11 @@ |
| 170062 | 170041 | } |
| 170063 | 170042 | |
| 170064 | 170043 | /* |
| 170065 | 170044 | ** Return the current state of the RBU vacuum or update operation. |
| 170066 | 170045 | */ |
| 170067 | | -SQLITE_API int SQLITE_STDCALL sqlite3rbu_state(sqlite3rbu *p){ |
| 170046 | +SQLITE_API int sqlite3rbu_state(sqlite3rbu *p){ |
| 170068 | 170047 | int aRes[] = { |
| 170069 | 170048 | 0, SQLITE_RBU_STATE_OAL, SQLITE_RBU_STATE_MOVE, |
| 170070 | 170049 | 0, SQLITE_RBU_STATE_CHECKPOINT, SQLITE_RBU_STATE_DONE |
| 170071 | 170050 | }; |
| 170072 | 170051 | |
| | @@ -170090,11 +170069,11 @@ |
| 170090 | 170069 | ); |
| 170091 | 170070 | return aRes[p->eStage]; |
| 170092 | 170071 | } |
| 170093 | 170072 | } |
| 170094 | 170073 | |
| 170095 | | -SQLITE_API int SQLITE_STDCALL sqlite3rbu_savestate(sqlite3rbu *p){ |
| 170074 | +SQLITE_API int sqlite3rbu_savestate(sqlite3rbu *p){ |
| 170096 | 170075 | int rc = p->rc; |
| 170097 | 170076 | if( rc==SQLITE_DONE ) return SQLITE_OK; |
| 170098 | 170077 | |
| 170099 | 170078 | assert( p->eStage>=RBU_STAGE_OAL && p->eStage<=RBU_STAGE_DONE ); |
| 170100 | 170079 | if( p->eStage==RBU_STAGE_OAL ){ |
| | @@ -170917,11 +170896,11 @@ |
| 170917 | 170896 | |
| 170918 | 170897 | /* |
| 170919 | 170898 | ** Deregister and destroy an RBU vfs created by an earlier call to |
| 170920 | 170899 | ** sqlite3rbu_create_vfs(). |
| 170921 | 170900 | */ |
| 170922 | | -SQLITE_API void SQLITE_STDCALL sqlite3rbu_destroy_vfs(const char *zName){ |
| 170901 | +SQLITE_API void sqlite3rbu_destroy_vfs(const char *zName){ |
| 170923 | 170902 | sqlite3_vfs *pVfs = sqlite3_vfs_find(zName); |
| 170924 | 170903 | if( pVfs && pVfs->xOpen==rbuVfsOpen ){ |
| 170925 | 170904 | sqlite3_mutex_free(((rbu_vfs*)pVfs)->mutex); |
| 170926 | 170905 | sqlite3_vfs_unregister(pVfs); |
| 170927 | 170906 | sqlite3_free(pVfs); |
| | @@ -170931,11 +170910,11 @@ |
| 170931 | 170910 | /* |
| 170932 | 170911 | ** Create an RBU VFS named zName that accesses the underlying file-system |
| 170933 | 170912 | ** via existing VFS zParent. The new object is registered as a non-default |
| 170934 | 170913 | ** VFS with SQLite before returning. |
| 170935 | 170914 | */ |
| 170936 | | -SQLITE_API int SQLITE_STDCALL sqlite3rbu_create_vfs(const char *zName, const char *zParent){ |
| 170915 | +SQLITE_API int sqlite3rbu_create_vfs(const char *zName, const char *zParent){ |
| 170937 | 170916 | |
| 170938 | 170917 | /* Template for VFS */ |
| 170939 | 170918 | static sqlite3_vfs vfs_template = { |
| 170940 | 170919 | 1, /* iVersion */ |
| 170941 | 170920 | 0, /* szOsFile */ |
| | @@ -173176,11 +173155,11 @@ |
| 173176 | 173155 | } |
| 173177 | 173156 | |
| 173178 | 173157 | return rc; |
| 173179 | 173158 | } |
| 173180 | 173159 | |
| 173181 | | -SQLITE_API int SQLITE_STDCALL sqlite3session_diff( |
| 173160 | +SQLITE_API int sqlite3session_diff( |
| 173182 | 173161 | sqlite3_session *pSession, |
| 173183 | 173162 | const char *zFrom, |
| 173184 | 173163 | const char *zTbl, |
| 173185 | 173164 | char **pzErrMsg |
| 173186 | 173165 | ){ |
| | @@ -173270,11 +173249,11 @@ |
| 173270 | 173249 | |
| 173271 | 173250 | /* |
| 173272 | 173251 | ** Create a session object. This session object will record changes to |
| 173273 | 173252 | ** database zDb attached to connection db. |
| 173274 | 173253 | */ |
| 173275 | | -SQLITE_API int SQLITE_STDCALL sqlite3session_create( |
| 173254 | +SQLITE_API int sqlite3session_create( |
| 173276 | 173255 | sqlite3 *db, /* Database handle */ |
| 173277 | 173256 | const char *zDb, /* Name of db (e.g. "main") */ |
| 173278 | 173257 | sqlite3_session **ppSession /* OUT: New session object */ |
| 173279 | 173258 | ){ |
| 173280 | 173259 | sqlite3_session *pNew; /* Newly allocated session object */ |
| | @@ -173332,11 +173311,11 @@ |
| 173332 | 173311 | } |
| 173333 | 173312 | |
| 173334 | 173313 | /* |
| 173335 | 173314 | ** Delete a session object previously allocated using sqlite3session_create(). |
| 173336 | 173315 | */ |
| 173337 | | -SQLITE_API void SQLITE_STDCALL sqlite3session_delete(sqlite3_session *pSession){ |
| 173316 | +SQLITE_API void sqlite3session_delete(sqlite3_session *pSession){ |
| 173338 | 173317 | sqlite3 *db = pSession->db; |
| 173339 | 173318 | sqlite3_session *pHead; |
| 173340 | 173319 | sqlite3_session **pp; |
| 173341 | 173320 | |
| 173342 | 173321 | /* Unlink the session from the linked list of sessions attached to the |
| | @@ -173361,11 +173340,11 @@ |
| 173361 | 173340 | } |
| 173362 | 173341 | |
| 173363 | 173342 | /* |
| 173364 | 173343 | ** Set a table filter on a Session Object. |
| 173365 | 173344 | */ |
| 173366 | | -SQLITE_API void SQLITE_STDCALL sqlite3session_table_filter( |
| 173345 | +SQLITE_API void sqlite3session_table_filter( |
| 173367 | 173346 | sqlite3_session *pSession, |
| 173368 | 173347 | int(*xFilter)(void*, const char*), |
| 173369 | 173348 | void *pCtx /* First argument passed to xFilter */ |
| 173370 | 173349 | ){ |
| 173371 | 173350 | pSession->bAutoAttach = 1; |
| | @@ -173379,11 +173358,11 @@ |
| 173379 | 173358 | ** |
| 173380 | 173359 | ** Only tables that have a PRIMARY KEY defined may be attached. It does |
| 173381 | 173360 | ** not matter if the PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias) |
| 173382 | 173361 | ** or not. |
| 173383 | 173362 | */ |
| 173384 | | -SQLITE_API int SQLITE_STDCALL sqlite3session_attach( |
| 173363 | +SQLITE_API int sqlite3session_attach( |
| 173385 | 173364 | sqlite3_session *pSession, /* Session object */ |
| 173386 | 173365 | const char *zName /* Table name */ |
| 173387 | 173366 | ){ |
| 173388 | 173367 | int rc = SQLITE_OK; |
| 173389 | 173368 | sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db)); |
| | @@ -174069,11 +174048,11 @@ |
| 174069 | 174048 | ** session object passed as the first argument. |
| 174070 | 174049 | ** |
| 174071 | 174050 | ** It is the responsibility of the caller to eventually free the buffer |
| 174072 | 174051 | ** using sqlite3_free(). |
| 174073 | 174052 | */ |
| 174074 | | -SQLITE_API int SQLITE_STDCALL sqlite3session_changeset( |
| 174053 | +SQLITE_API int sqlite3session_changeset( |
| 174075 | 174054 | sqlite3_session *pSession, /* Session object */ |
| 174076 | 174055 | int *pnChangeset, /* OUT: Size of buffer at *ppChangeset */ |
| 174077 | 174056 | void **ppChangeset /* OUT: Buffer containing changeset */ |
| 174078 | 174057 | ){ |
| 174079 | 174058 | return sessionGenerateChangeset(pSession, 0, 0, 0, pnChangeset, ppChangeset); |
| | @@ -174080,11 +174059,11 @@ |
| 174080 | 174059 | } |
| 174081 | 174060 | |
| 174082 | 174061 | /* |
| 174083 | 174062 | ** Streaming version of sqlite3session_changeset(). |
| 174084 | 174063 | */ |
| 174085 | | -SQLITE_API int SQLITE_STDCALL sqlite3session_changeset_strm( |
| 174064 | +SQLITE_API int sqlite3session_changeset_strm( |
| 174086 | 174065 | sqlite3_session *pSession, |
| 174087 | 174066 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 174088 | 174067 | void *pOut |
| 174089 | 174068 | ){ |
| 174090 | 174069 | return sessionGenerateChangeset(pSession, 0, xOutput, pOut, 0, 0); |
| | @@ -174091,11 +174070,11 @@ |
| 174091 | 174070 | } |
| 174092 | 174071 | |
| 174093 | 174072 | /* |
| 174094 | 174073 | ** Streaming version of sqlite3session_patchset(). |
| 174095 | 174074 | */ |
| 174096 | | -SQLITE_API int SQLITE_STDCALL sqlite3session_patchset_strm( |
| 174075 | +SQLITE_API int sqlite3session_patchset_strm( |
| 174097 | 174076 | sqlite3_session *pSession, |
| 174098 | 174077 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 174099 | 174078 | void *pOut |
| 174100 | 174079 | ){ |
| 174101 | 174080 | return sessionGenerateChangeset(pSession, 1, xOutput, pOut, 0, 0); |
| | @@ -174106,11 +174085,11 @@ |
| 174106 | 174085 | ** session object passed as the first argument. |
| 174107 | 174086 | ** |
| 174108 | 174087 | ** It is the responsibility of the caller to eventually free the buffer |
| 174109 | 174088 | ** using sqlite3_free(). |
| 174110 | 174089 | */ |
| 174111 | | -SQLITE_API int SQLITE_STDCALL sqlite3session_patchset( |
| 174090 | +SQLITE_API int sqlite3session_patchset( |
| 174112 | 174091 | sqlite3_session *pSession, /* Session object */ |
| 174113 | 174092 | int *pnPatchset, /* OUT: Size of buffer at *ppChangeset */ |
| 174114 | 174093 | void **ppPatchset /* OUT: Buffer containing changeset */ |
| 174115 | 174094 | ){ |
| 174116 | 174095 | return sessionGenerateChangeset(pSession, 1, 0, 0, pnPatchset, ppPatchset); |
| | @@ -174117,11 +174096,11 @@ |
| 174117 | 174096 | } |
| 174118 | 174097 | |
| 174119 | 174098 | /* |
| 174120 | 174099 | ** Enable or disable the session object passed as the first argument. |
| 174121 | 174100 | */ |
| 174122 | | -SQLITE_API int SQLITE_STDCALL sqlite3session_enable(sqlite3_session *pSession, int bEnable){ |
| 174101 | +SQLITE_API int sqlite3session_enable(sqlite3_session *pSession, int bEnable){ |
| 174123 | 174102 | int ret; |
| 174124 | 174103 | sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db)); |
| 174125 | 174104 | if( bEnable>=0 ){ |
| 174126 | 174105 | pSession->bEnable = bEnable; |
| 174127 | 174106 | } |
| | @@ -174131,11 +174110,11 @@ |
| 174131 | 174110 | } |
| 174132 | 174111 | |
| 174133 | 174112 | /* |
| 174134 | 174113 | ** Enable or disable the session object passed as the first argument. |
| 174135 | 174114 | */ |
| 174136 | | -SQLITE_API int SQLITE_STDCALL sqlite3session_indirect(sqlite3_session *pSession, int bIndirect){ |
| 174115 | +SQLITE_API int sqlite3session_indirect(sqlite3_session *pSession, int bIndirect){ |
| 174137 | 174116 | int ret; |
| 174138 | 174117 | sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db)); |
| 174139 | 174118 | if( bIndirect>=0 ){ |
| 174140 | 174119 | pSession->bIndirect = bIndirect; |
| 174141 | 174120 | } |
| | @@ -174146,11 +174125,11 @@ |
| 174146 | 174125 | |
| 174147 | 174126 | /* |
| 174148 | 174127 | ** Return true if there have been no changes to monitored tables recorded |
| 174149 | 174128 | ** by the session object passed as the only argument. |
| 174150 | 174129 | */ |
| 174151 | | -SQLITE_API int SQLITE_STDCALL sqlite3session_isempty(sqlite3_session *pSession){ |
| 174130 | +SQLITE_API int sqlite3session_isempty(sqlite3_session *pSession){ |
| 174152 | 174131 | int ret = 0; |
| 174153 | 174132 | SessionTable *pTab; |
| 174154 | 174133 | |
| 174155 | 174134 | sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db)); |
| 174156 | 174135 | for(pTab=pSession->pTable; pTab && ret==0; pTab=pTab->pNext){ |
| | @@ -174196,11 +174175,11 @@ |
| 174196 | 174175 | } |
| 174197 | 174176 | |
| 174198 | 174177 | /* |
| 174199 | 174178 | ** Create an iterator used to iterate through the contents of a changeset. |
| 174200 | 174179 | */ |
| 174201 | | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_start( |
| 174180 | +SQLITE_API int sqlite3changeset_start( |
| 174202 | 174181 | sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */ |
| 174203 | 174182 | int nChangeset, /* Size of buffer pChangeset in bytes */ |
| 174204 | 174183 | void *pChangeset /* Pointer to buffer containing changeset */ |
| 174205 | 174184 | ){ |
| 174206 | 174185 | return sessionChangesetStart(pp, 0, 0, nChangeset, pChangeset); |
| | @@ -174207,11 +174186,11 @@ |
| 174207 | 174186 | } |
| 174208 | 174187 | |
| 174209 | 174188 | /* |
| 174210 | 174189 | ** Streaming version of sqlite3changeset_start(). |
| 174211 | 174190 | */ |
| 174212 | | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_start_strm( |
| 174191 | +SQLITE_API int sqlite3changeset_start_strm( |
| 174213 | 174192 | sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */ |
| 174214 | 174193 | int (*xInput)(void *pIn, void *pData, int *pnData), |
| 174215 | 174194 | void *pIn |
| 174216 | 174195 | ){ |
| 174217 | 174196 | return sessionChangesetStart(pp, xInput, pIn, 0, 0); |
| | @@ -174628,20 +174607,20 @@ |
| 174628 | 174607 | ** or SQLITE_CORRUPT. |
| 174629 | 174608 | ** |
| 174630 | 174609 | ** This function may not be called on iterators passed to a conflict handler |
| 174631 | 174610 | ** callback by changeset_apply(). |
| 174632 | 174611 | */ |
| 174633 | | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_next(sqlite3_changeset_iter *p){ |
| 174612 | +SQLITE_API int sqlite3changeset_next(sqlite3_changeset_iter *p){ |
| 174634 | 174613 | return sessionChangesetNext(p, 0, 0); |
| 174635 | 174614 | } |
| 174636 | 174615 | |
| 174637 | 174616 | /* |
| 174638 | 174617 | ** The following function extracts information on the current change |
| 174639 | 174618 | ** from a changeset iterator. It may only be called after changeset_next() |
| 174640 | 174619 | ** has returned SQLITE_ROW. |
| 174641 | 174620 | */ |
| 174642 | | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_op( |
| 174621 | +SQLITE_API int sqlite3changeset_op( |
| 174643 | 174622 | sqlite3_changeset_iter *pIter, /* Iterator handle */ |
| 174644 | 174623 | const char **pzTab, /* OUT: Pointer to table name */ |
| 174645 | 174624 | int *pnCol, /* OUT: Number of columns in table */ |
| 174646 | 174625 | int *pOp, /* OUT: SQLITE_INSERT, DELETE or UPDATE */ |
| 174647 | 174626 | int *pbIndirect /* OUT: True if change is indirect */ |
| | @@ -174657,11 +174636,11 @@ |
| 174657 | 174636 | ** Return information regarding the PRIMARY KEY and number of columns in |
| 174658 | 174637 | ** the database table affected by the change that pIter currently points |
| 174659 | 174638 | ** to. This function may only be called after changeset_next() returns |
| 174660 | 174639 | ** SQLITE_ROW. |
| 174661 | 174640 | */ |
| 174662 | | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_pk( |
| 174641 | +SQLITE_API int sqlite3changeset_pk( |
| 174663 | 174642 | sqlite3_changeset_iter *pIter, /* Iterator object */ |
| 174664 | 174643 | unsigned char **pabPK, /* OUT: Array of boolean - true for PK cols */ |
| 174665 | 174644 | int *pnCol /* OUT: Number of entries in output array */ |
| 174666 | 174645 | ){ |
| 174667 | 174646 | *pabPK = pIter->abPK; |
| | @@ -174680,11 +174659,11 @@ |
| 174680 | 174659 | ** was not modified and is not a PK column), set *ppValue to NULL. |
| 174681 | 174660 | ** |
| 174682 | 174661 | ** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is |
| 174683 | 174662 | ** not modified. Otherwise, SQLITE_OK. |
| 174684 | 174663 | */ |
| 174685 | | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_old( |
| 174664 | +SQLITE_API int sqlite3changeset_old( |
| 174686 | 174665 | sqlite3_changeset_iter *pIter, /* Changeset iterator */ |
| 174687 | 174666 | int iVal, /* Index of old.* value to retrieve */ |
| 174688 | 174667 | sqlite3_value **ppValue /* OUT: Old value (or NULL pointer) */ |
| 174689 | 174668 | ){ |
| 174690 | 174669 | if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_DELETE ){ |
| | @@ -174708,11 +174687,11 @@ |
| 174708 | 174687 | ** was not modified), set *ppValue to NULL. |
| 174709 | 174688 | ** |
| 174710 | 174689 | ** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is |
| 174711 | 174690 | ** not modified. Otherwise, SQLITE_OK. |
| 174712 | 174691 | */ |
| 174713 | | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_new( |
| 174692 | +SQLITE_API int sqlite3changeset_new( |
| 174714 | 174693 | sqlite3_changeset_iter *pIter, /* Changeset iterator */ |
| 174715 | 174694 | int iVal, /* Index of new.* value to retrieve */ |
| 174716 | 174695 | sqlite3_value **ppValue /* OUT: New value (or NULL pointer) */ |
| 174717 | 174696 | ){ |
| 174718 | 174697 | if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_INSERT ){ |
| | @@ -174742,11 +174721,11 @@ |
| 174742 | 174721 | ** containing the iVal'th value of the conflicting record. |
| 174743 | 174722 | ** |
| 174744 | 174723 | ** If value iVal is out-of-range or some other error occurs, an SQLite error |
| 174745 | 174724 | ** code is returned. Otherwise, SQLITE_OK. |
| 174746 | 174725 | */ |
| 174747 | | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_conflict( |
| 174726 | +SQLITE_API int sqlite3changeset_conflict( |
| 174748 | 174727 | sqlite3_changeset_iter *pIter, /* Changeset iterator */ |
| 174749 | 174728 | int iVal, /* Index of conflict record value to fetch */ |
| 174750 | 174729 | sqlite3_value **ppValue /* OUT: Value from conflicting row */ |
| 174751 | 174730 | ){ |
| 174752 | 174731 | if( !pIter->pConflict ){ |
| | @@ -174765,11 +174744,11 @@ |
| 174765 | 174744 | ** it sets the output variable to the total number of known foreign key |
| 174766 | 174745 | ** violations in the destination database and returns SQLITE_OK. |
| 174767 | 174746 | ** |
| 174768 | 174747 | ** In all other cases this function returns SQLITE_MISUSE. |
| 174769 | 174748 | */ |
| 174770 | | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_fk_conflicts( |
| 174749 | +SQLITE_API int sqlite3changeset_fk_conflicts( |
| 174771 | 174750 | sqlite3_changeset_iter *pIter, /* Changeset iterator */ |
| 174772 | 174751 | int *pnOut /* OUT: Number of FK violations */ |
| 174773 | 174752 | ){ |
| 174774 | 174753 | if( pIter->pConflict || pIter->apValue ){ |
| 174775 | 174754 | return SQLITE_MISUSE; |
| | @@ -174783,11 +174762,11 @@ |
| 174783 | 174762 | ** Finalize an iterator allocated with sqlite3changeset_start(). |
| 174784 | 174763 | ** |
| 174785 | 174764 | ** This function may not be called on iterators passed to a conflict handler |
| 174786 | 174765 | ** callback by changeset_apply(). |
| 174787 | 174766 | */ |
| 174788 | | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_finalize(sqlite3_changeset_iter *p){ |
| 174767 | +SQLITE_API int sqlite3changeset_finalize(sqlite3_changeset_iter *p){ |
| 174789 | 174768 | int rc = SQLITE_OK; |
| 174790 | 174769 | if( p ){ |
| 174791 | 174770 | int i; /* Used to iterate through p->apValue[] */ |
| 174792 | 174771 | rc = p->rc; |
| 174793 | 174772 | if( p->apValue ){ |
| | @@ -174957,11 +174936,11 @@ |
| 174957 | 174936 | |
| 174958 | 174937 | |
| 174959 | 174938 | /* |
| 174960 | 174939 | ** Invert a changeset object. |
| 174961 | 174940 | */ |
| 174962 | | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_invert( |
| 174941 | +SQLITE_API int sqlite3changeset_invert( |
| 174963 | 174942 | int nChangeset, /* Number of bytes in input */ |
| 174964 | 174943 | const void *pChangeset, /* Input changeset */ |
| 174965 | 174944 | int *pnInverted, /* OUT: Number of bytes in output changeset */ |
| 174966 | 174945 | void **ppInverted /* OUT: Inverse of pChangeset */ |
| 174967 | 174946 | ){ |
| | @@ -174976,11 +174955,11 @@ |
| 174976 | 174955 | } |
| 174977 | 174956 | |
| 174978 | 174957 | /* |
| 174979 | 174958 | ** Streaming version of sqlite3changeset_invert(). |
| 174980 | 174959 | */ |
| 174981 | | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_invert_strm( |
| 174960 | +SQLITE_API int sqlite3changeset_invert_strm( |
| 174982 | 174961 | int (*xInput)(void *pIn, void *pData, int *pnData), |
| 174983 | 174962 | void *pIn, |
| 174984 | 174963 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 174985 | 174964 | void *pOut |
| 174986 | 174965 | ){ |
| | @@ -175856,11 +175835,11 @@ |
| 175856 | 175835 | /* |
| 175857 | 175836 | ** Apply the changeset passed via pChangeset/nChangeset to the main database |
| 175858 | 175837 | ** attached to handle "db". Invoke the supplied conflict handler callback |
| 175859 | 175838 | ** to resolve any conflicts encountered while applying the change. |
| 175860 | 175839 | */ |
| 175861 | | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_apply( |
| 175840 | +SQLITE_API int sqlite3changeset_apply( |
| 175862 | 175841 | sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 175863 | 175842 | int nChangeset, /* Size of changeset in bytes */ |
| 175864 | 175843 | void *pChangeset, /* Changeset blob */ |
| 175865 | 175844 | int(*xFilter)( |
| 175866 | 175845 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| | @@ -175884,11 +175863,11 @@ |
| 175884 | 175863 | /* |
| 175885 | 175864 | ** Apply the changeset passed via xInput/pIn to the main database |
| 175886 | 175865 | ** attached to handle "db". Invoke the supplied conflict handler callback |
| 175887 | 175866 | ** to resolve any conflicts encountered while applying the change. |
| 175888 | 175867 | */ |
| 175889 | | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_apply_strm( |
| 175868 | +SQLITE_API int sqlite3changeset_apply_strm( |
| 175890 | 175869 | sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 175891 | 175870 | int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */ |
| 175892 | 175871 | void *pIn, /* First arg for xInput */ |
| 175893 | 175872 | int(*xFilter)( |
| 175894 | 175873 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| | @@ -176219,11 +176198,11 @@ |
| 176219 | 176198 | } |
| 176220 | 176199 | |
| 176221 | 176200 | /* |
| 176222 | 176201 | ** Allocate a new, empty, sqlite3_changegroup. |
| 176223 | 176202 | */ |
| 176224 | | -SQLITE_API int SQLITE_STDCALL sqlite3changegroup_new(sqlite3_changegroup **pp){ |
| 176203 | +SQLITE_API int sqlite3changegroup_new(sqlite3_changegroup **pp){ |
| 176225 | 176204 | int rc = SQLITE_OK; /* Return code */ |
| 176226 | 176205 | sqlite3_changegroup *p; /* New object */ |
| 176227 | 176206 | p = (sqlite3_changegroup*)sqlite3_malloc(sizeof(sqlite3_changegroup)); |
| 176228 | 176207 | if( p==0 ){ |
| 176229 | 176208 | rc = SQLITE_NOMEM; |
| | @@ -176236,11 +176215,11 @@ |
| 176236 | 176215 | |
| 176237 | 176216 | /* |
| 176238 | 176217 | ** Add the changeset currently stored in buffer pData, size nData bytes, |
| 176239 | 176218 | ** to changeset-group p. |
| 176240 | 176219 | */ |
| 176241 | | -SQLITE_API int SQLITE_STDCALL sqlite3changegroup_add(sqlite3_changegroup *pGrp, int nData, void *pData){ |
| 176220 | +SQLITE_API int sqlite3changegroup_add(sqlite3_changegroup *pGrp, int nData, void *pData){ |
| 176242 | 176221 | sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */ |
| 176243 | 176222 | int rc; /* Return code */ |
| 176244 | 176223 | |
| 176245 | 176224 | rc = sqlite3changeset_start(&pIter, nData, pData); |
| 176246 | 176225 | if( rc==SQLITE_OK ){ |
| | @@ -176252,11 +176231,11 @@ |
| 176252 | 176231 | |
| 176253 | 176232 | /* |
| 176254 | 176233 | ** Obtain a buffer containing a changeset representing the concatenation |
| 176255 | 176234 | ** of all changesets added to the group so far. |
| 176256 | 176235 | */ |
| 176257 | | -SQLITE_API int SQLITE_STDCALL sqlite3changegroup_output( |
| 176236 | +SQLITE_API int sqlite3changegroup_output( |
| 176258 | 176237 | sqlite3_changegroup *pGrp, |
| 176259 | 176238 | int *pnData, |
| 176260 | 176239 | void **ppData |
| 176261 | 176240 | ){ |
| 176262 | 176241 | return sessionChangegroupOutput(pGrp, 0, 0, pnData, ppData); |
| | @@ -176263,11 +176242,11 @@ |
| 176263 | 176242 | } |
| 176264 | 176243 | |
| 176265 | 176244 | /* |
| 176266 | 176245 | ** Streaming versions of changegroup_add(). |
| 176267 | 176246 | */ |
| 176268 | | -SQLITE_API int SQLITE_STDCALL sqlite3changegroup_add_strm( |
| 176247 | +SQLITE_API int sqlite3changegroup_add_strm( |
| 176269 | 176248 | sqlite3_changegroup *pGrp, |
| 176270 | 176249 | int (*xInput)(void *pIn, void *pData, int *pnData), |
| 176271 | 176250 | void *pIn |
| 176272 | 176251 | ){ |
| 176273 | 176252 | sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */ |
| | @@ -176282,11 +176261,11 @@ |
| 176282 | 176261 | } |
| 176283 | 176262 | |
| 176284 | 176263 | /* |
| 176285 | 176264 | ** Streaming versions of changegroup_output(). |
| 176286 | 176265 | */ |
| 176287 | | -SQLITE_API int SQLITE_STDCALL sqlite3changegroup_output_strm( |
| 176266 | +SQLITE_API int sqlite3changegroup_output_strm( |
| 176288 | 176267 | sqlite3_changegroup *pGrp, |
| 176289 | 176268 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 176290 | 176269 | void *pOut |
| 176291 | 176270 | ){ |
| 176292 | 176271 | return sessionChangegroupOutput(pGrp, xOutput, pOut, 0, 0); |
| | @@ -176293,21 +176272,21 @@ |
| 176293 | 176272 | } |
| 176294 | 176273 | |
| 176295 | 176274 | /* |
| 176296 | 176275 | ** Delete a changegroup object. |
| 176297 | 176276 | */ |
| 176298 | | -SQLITE_API void SQLITE_STDCALL sqlite3changegroup_delete(sqlite3_changegroup *pGrp){ |
| 176277 | +SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup *pGrp){ |
| 176299 | 176278 | if( pGrp ){ |
| 176300 | 176279 | sessionDeleteTable(pGrp->pList); |
| 176301 | 176280 | sqlite3_free(pGrp); |
| 176302 | 176281 | } |
| 176303 | 176282 | } |
| 176304 | 176283 | |
| 176305 | 176284 | /* |
| 176306 | 176285 | ** Combine two changesets together. |
| 176307 | 176286 | */ |
| 176308 | | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_concat( |
| 176287 | +SQLITE_API int sqlite3changeset_concat( |
| 176309 | 176288 | int nLeft, /* Number of bytes in lhs input */ |
| 176310 | 176289 | void *pLeft, /* Lhs input changeset */ |
| 176311 | 176290 | int nRight /* Number of bytes in rhs input */, |
| 176312 | 176291 | void *pRight, /* Rhs input changeset */ |
| 176313 | 176292 | int *pnOut, /* OUT: Number of bytes in output changeset */ |
| | @@ -176332,11 +176311,11 @@ |
| 176332 | 176311 | } |
| 176333 | 176312 | |
| 176334 | 176313 | /* |
| 176335 | 176314 | ** Streaming version of sqlite3changeset_concat(). |
| 176336 | 176315 | */ |
| 176337 | | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_concat_strm( |
| 176316 | +SQLITE_API int sqlite3changeset_concat_strm( |
| 176338 | 176317 | int (*xInputA)(void *pIn, void *pData, int *pnData), |
| 176339 | 176318 | void *pInA, |
| 176340 | 176319 | int (*xInputB)(void *pIn, void *pData, int *pnData), |
| 176341 | 176320 | void *pInB, |
| 176342 | 176321 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| | @@ -178564,11 +178543,11 @@ |
| 178564 | 178543 | |
| 178565 | 178544 | #ifndef SQLITE_CORE |
| 178566 | 178545 | #ifdef _WIN32 |
| 178567 | 178546 | __declspec(dllexport) |
| 178568 | 178547 | #endif |
| 178569 | | -SQLITE_API int SQLITE_STDCALL sqlite3_json_init( |
| 178548 | +SQLITE_API int sqlite3_json_init( |
| 178570 | 178549 | sqlite3 *db, |
| 178571 | 178550 | char **pzErrMsg, |
| 178572 | 178551 | const sqlite3_api_routines *pApi |
| 178573 | 178552 | ){ |
| 178574 | 178553 | SQLITE_EXTENSION_INIT2(pApi); |
| | @@ -184048,18 +184027,18 @@ |
| 184048 | 184027 | Fts5ExprNode *pNode |
| 184049 | 184028 | ){ |
| 184050 | 184029 | Fts5ExprNearset *pNear = pNode->pNear; |
| 184051 | 184030 | int i, j; |
| 184052 | 184031 | int rc = SQLITE_OK; |
| 184032 | + int bEof = 1; |
| 184053 | 184033 | |
| 184054 | 184034 | assert( pNode->bNomatch==0 ); |
| 184055 | 184035 | for(i=0; rc==SQLITE_OK && i<pNear->nPhrase; i++){ |
| 184056 | 184036 | Fts5ExprPhrase *pPhrase = pNear->apPhrase[i]; |
| 184057 | 184037 | for(j=0; j<pPhrase->nTerm; j++){ |
| 184058 | 184038 | Fts5ExprTerm *pTerm = &pPhrase->aTerm[j]; |
| 184059 | 184039 | Fts5ExprTerm *p; |
| 184060 | | - int bEof = 1; |
| 184061 | 184040 | |
| 184062 | 184041 | for(p=pTerm; p && rc==SQLITE_OK; p=p->pSynonym){ |
| 184063 | 184042 | if( p->pIter ){ |
| 184064 | 184043 | sqlite3Fts5IterClose(p->pIter); |
| 184065 | 184044 | p->pIter = 0; |
| | @@ -184075,17 +184054,16 @@ |
| 184075 | 184054 | if( p->pIter && 0==sqlite3Fts5IterEof(p->pIter) ){ |
| 184076 | 184055 | bEof = 0; |
| 184077 | 184056 | } |
| 184078 | 184057 | } |
| 184079 | 184058 | |
| 184080 | | - if( bEof ){ |
| 184081 | | - pNode->bEof = 1; |
| 184082 | | - return rc; |
| 184083 | | - } |
| 184059 | + if( bEof ) break; |
| 184084 | 184060 | } |
| 184061 | + if( bEof ) break; |
| 184085 | 184062 | } |
| 184086 | 184063 | |
| 184064 | + pNode->bEof = bEof; |
| 184087 | 184065 | return rc; |
| 184088 | 184066 | } |
| 184089 | 184067 | |
| 184090 | 184068 | /* |
| 184091 | 184069 | ** If pExpr is an ASC iterator, this function returns a value with the |
| | @@ -184932,11 +184910,10 @@ |
| 184932 | 184910 | int iPhrase, |
| 184933 | 184911 | Fts5Expr **ppNew |
| 184934 | 184912 | ){ |
| 184935 | 184913 | int rc = SQLITE_OK; /* Return code */ |
| 184936 | 184914 | Fts5ExprPhrase *pOrig; /* The phrase extracted from pExpr */ |
| 184937 | | - int i; /* Used to iterate through phrase terms */ |
| 184938 | 184915 | Fts5Expr *pNew = 0; /* Expression to return via *ppNew */ |
| 184939 | 184916 | TokenCtx sCtx = {0,0}; /* Context object for fts5ParseTokenize */ |
| 184940 | 184917 | |
| 184941 | 184918 | pOrig = pExpr->apExprPhrase[iPhrase]; |
| 184942 | 184919 | pNew = (Fts5Expr*)sqlite3Fts5MallocZero(&rc, sizeof(Fts5Expr)); |
| | @@ -184962,22 +184939,29 @@ |
| 184962 | 184939 | } |
| 184963 | 184940 | pNew->pRoot->pNear->pColset = pColset; |
| 184964 | 184941 | } |
| 184965 | 184942 | } |
| 184966 | 184943 | |
| 184967 | | - for(i=0; rc==SQLITE_OK && i<pOrig->nTerm; i++){ |
| 184968 | | - int tflags = 0; |
| 184969 | | - Fts5ExprTerm *p; |
| 184970 | | - for(p=&pOrig->aTerm[i]; p && rc==SQLITE_OK; p=p->pSynonym){ |
| 184971 | | - const char *zTerm = p->zTerm; |
| 184972 | | - rc = fts5ParseTokenize((void*)&sCtx, tflags, zTerm, (int)strlen(zTerm), |
| 184973 | | - 0, 0); |
| 184974 | | - tflags = FTS5_TOKEN_COLOCATED; |
| 184975 | | - } |
| 184976 | | - if( rc==SQLITE_OK ){ |
| 184977 | | - sCtx.pPhrase->aTerm[i].bPrefix = pOrig->aTerm[i].bPrefix; |
| 184978 | | - } |
| 184944 | + if( pOrig->nTerm ){ |
| 184945 | + int i; /* Used to iterate through phrase terms */ |
| 184946 | + for(i=0; rc==SQLITE_OK && i<pOrig->nTerm; i++){ |
| 184947 | + int tflags = 0; |
| 184948 | + Fts5ExprTerm *p; |
| 184949 | + for(p=&pOrig->aTerm[i]; p && rc==SQLITE_OK; p=p->pSynonym){ |
| 184950 | + const char *zTerm = p->zTerm; |
| 184951 | + rc = fts5ParseTokenize((void*)&sCtx, tflags, zTerm, (int)strlen(zTerm), |
| 184952 | + 0, 0); |
| 184953 | + tflags = FTS5_TOKEN_COLOCATED; |
| 184954 | + } |
| 184955 | + if( rc==SQLITE_OK ){ |
| 184956 | + sCtx.pPhrase->aTerm[i].bPrefix = pOrig->aTerm[i].bPrefix; |
| 184957 | + } |
| 184958 | + } |
| 184959 | + }else{ |
| 184960 | + /* This happens when parsing a token or quoted phrase that contains |
| 184961 | + ** no token characters at all. (e.g ... MATCH '""'). */ |
| 184962 | + sCtx.pPhrase = sqlite3Fts5MallocZero(&rc, sizeof(Fts5ExprPhrase)); |
| 184979 | 184963 | } |
| 184980 | 184964 | |
| 184981 | 184965 | if( rc==SQLITE_OK ){ |
| 184982 | 184966 | /* All the allocations succeeded. Put the expression object together. */ |
| 184983 | 184967 | pNew->pIndex = pExpr->pIndex; |
| | @@ -195613,11 +195597,11 @@ |
| 195613 | 195597 | int nArg, /* Number of args */ |
| 195614 | 195598 | sqlite3_value **apUnused /* Function arguments */ |
| 195615 | 195599 | ){ |
| 195616 | 195600 | assert( nArg==0 ); |
| 195617 | 195601 | UNUSED_PARAM2(nArg, apUnused); |
| 195618 | | - sqlite3_result_text(pCtx, "fts5: 2016-09-10 14:43:07 8a9d128119fde36c175735be56876d30e5c8586f", -1, SQLITE_TRANSIENT); |
| 195602 | + sqlite3_result_text(pCtx, "fts5: 2016-09-21 19:43:34 0741812d7fcd558479e4849fbb3ba8d03738d018", -1, SQLITE_TRANSIENT); |
| 195619 | 195603 | } |
| 195620 | 195604 | |
| 195621 | 195605 | static int fts5Init(sqlite3 *db){ |
| 195622 | 195606 | static const sqlite3_module fts5Mod = { |
| 195623 | 195607 | /* iVersion */ 2, |
| | @@ -195701,11 +195685,11 @@ |
| 195701 | 195685 | */ |
| 195702 | 195686 | #ifndef SQLITE_CORE |
| 195703 | 195687 | #ifdef _WIN32 |
| 195704 | 195688 | __declspec(dllexport) |
| 195705 | 195689 | #endif |
| 195706 | | -SQLITE_API int SQLITE_STDCALL sqlite3_fts_init( |
| 195690 | +SQLITE_API int sqlite3_fts_init( |
| 195707 | 195691 | sqlite3 *db, |
| 195708 | 195692 | char **pzErrMsg, |
| 195709 | 195693 | const sqlite3_api_routines *pApi |
| 195710 | 195694 | ){ |
| 195711 | 195695 | SQLITE_EXTENSION_INIT2(pApi); |
| | @@ -195714,11 +195698,11 @@ |
| 195714 | 195698 | } |
| 195715 | 195699 | |
| 195716 | 195700 | #ifdef _WIN32 |
| 195717 | 195701 | __declspec(dllexport) |
| 195718 | 195702 | #endif |
| 195719 | | -SQLITE_API int SQLITE_STDCALL sqlite3_fts5_init( |
| 195703 | +SQLITE_API int sqlite3_fts5_init( |
| 195720 | 195704 | sqlite3 *db, |
| 195721 | 195705 | char **pzErrMsg, |
| 195722 | 195706 | const sqlite3_api_routines *pApi |
| 195723 | 195707 | ){ |
| 195724 | 195708 | SQLITE_EXTENSION_INIT2(pApi); |
| | @@ -199095,12 +199079,23 @@ |
| 199095 | 199079 | pInfo->aConstraintUsage[iTermLe].argvIndex = ++nArg; |
| 199096 | 199080 | pInfo->estimatedCost = pInfo->estimatedCost / 2; |
| 199097 | 199081 | } |
| 199098 | 199082 | } |
| 199099 | 199083 | |
| 199100 | | - pInfo->idxNum = idxNum; |
| 199084 | + /* This virtual table always delivers results in ascending order of |
| 199085 | + ** the "term" column (column 0). So if the user has requested this |
| 199086 | + ** specifically - "ORDER BY term" or "ORDER BY term ASC" - set the |
| 199087 | + ** sqlite3_index_info.orderByConsumed flag to tell the core the results |
| 199088 | + ** are already in sorted order. */ |
| 199089 | + if( pInfo->nOrderBy==1 |
| 199090 | + && pInfo->aOrderBy[0].iColumn==0 |
| 199091 | + && pInfo->aOrderBy[0].desc==0 |
| 199092 | + ){ |
| 199093 | + pInfo->orderByConsumed = 1; |
| 199094 | + } |
| 199101 | 199095 | |
| 199096 | + pInfo->idxNum = idxNum; |
| 199102 | 199097 | return SQLITE_OK; |
| 199103 | 199098 | } |
| 199104 | 199099 | |
| 199105 | 199100 | /* |
| 199106 | 199101 | ** Implementation of xOpen method. |
| 199107 | 199102 | |