Fossil SCM
Use ~/.fossil4 as the configuration database to avoid conflicts with the original fossil. Adjust SQL because INTEGER PRIMARY KEY does not auto-fill as with SQLite3.
Commit
3f624d490b0696b85301eb7f618203bd03942625
Parent
6823912746f3a22…
4 files changed
+2
-2
+25
-65
+24
-64
+3
-2
M
src/db.c
+2
-2
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -763,13 +763,13 @@ | ||
| 763 | 763 | } |
| 764 | 764 | #endif |
| 765 | 765 | g.zHome = mprintf("%/", zHome); |
| 766 | 766 | #if defined(_WIN32) |
| 767 | 767 | /* . filenames give some window systems problems and many apps problems */ |
| 768 | - zDbName = mprintf("%//_fossil", zHome); | |
| 768 | + zDbName = mprintf("%//_fossil4", zHome); | |
| 769 | 769 | #else |
| 770 | - zDbName = mprintf("%s/.fossil", zHome); | |
| 770 | + zDbName = mprintf("%s/.fossil4", zHome); | |
| 771 | 771 | #endif |
| 772 | 772 | if( file_size(zDbName)<1024*3 ){ |
| 773 | 773 | db_init_database(zDbName, zConfigSchema, (char*)0); |
| 774 | 774 | } |
| 775 | 775 | g.useAttach = useAttach; |
| 776 | 776 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -763,13 +763,13 @@ | |
| 763 | } |
| 764 | #endif |
| 765 | g.zHome = mprintf("%/", zHome); |
| 766 | #if defined(_WIN32) |
| 767 | /* . filenames give some window systems problems and many apps problems */ |
| 768 | zDbName = mprintf("%//_fossil", zHome); |
| 769 | #else |
| 770 | zDbName = mprintf("%s/.fossil", zHome); |
| 771 | #endif |
| 772 | if( file_size(zDbName)<1024*3 ){ |
| 773 | db_init_database(zDbName, zConfigSchema, (char*)0); |
| 774 | } |
| 775 | g.useAttach = useAttach; |
| 776 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -763,13 +763,13 @@ | |
| 763 | } |
| 764 | #endif |
| 765 | g.zHome = mprintf("%/", zHome); |
| 766 | #if defined(_WIN32) |
| 767 | /* . filenames give some window systems problems and many apps problems */ |
| 768 | zDbName = mprintf("%//_fossil4", zHome); |
| 769 | #else |
| 770 | zDbName = mprintf("%s/.fossil4", zHome); |
| 771 | #endif |
| 772 | if( file_size(zDbName)<1024*3 ){ |
| 773 | db_init_database(zDbName, zConfigSchema, (char*)0); |
| 774 | } |
| 775 | g.useAttach = useAttach; |
| 776 |
+25
-65
| --- src/sqlite4.c | ||
| +++ src/sqlite4.c | ||
| @@ -714,11 +714,11 @@ | ||
| 714 | 714 | ** [sqlite4_libversion_number()], [sqlite4_sourceid()], |
| 715 | 715 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 716 | 716 | */ |
| 717 | 717 | #define SQLITE_VERSION "4.0.0" |
| 718 | 718 | #define SQLITE_VERSION_NUMBER 4000000 |
| 719 | -#define SQLITE_SOURCE_ID "2012-06-26 20:17:04 f19a93d9f9d862741bc7fbb05e292d430864b2b1" | |
| 719 | +#define SQLITE_SOURCE_ID "2012-06-27 13:56:22 bd2216554bbcf5eee88dc17d0d6ae165a7eddbe4" | |
| 720 | 720 | |
| 721 | 721 | /* |
| 722 | 722 | ** CAPIREF: Run-Time Library Version Numbers |
| 723 | 723 | ** KEYWORDS: sqlite4_version, sqlite4_sourceid |
| 724 | 724 | ** |
| @@ -807,11 +807,11 @@ | ||
| 807 | 807 | ** Each open SQLite database is represented by a pointer to an instance of |
| 808 | 808 | ** the opaque structure named "sqlite4". It is useful to think of an sqlite4 |
| 809 | 809 | ** pointer as an object. The [sqlite4_open()] |
| 810 | 810 | ** interface is its constructors, and [sqlite4_close()] |
| 811 | 811 | ** is its destructor. There are many other interfaces (such as |
| 812 | -** [sqlite4_prepare_v2()], [sqlite4_create_function()], and | |
| 812 | +** [sqlite4_prepare], [sqlite4_create_function()], and | |
| 813 | 813 | ** [sqlite4_busy_timeout()] to name but three) that are methods on an |
| 814 | 814 | ** sqlite4 object. |
| 815 | 815 | */ |
| 816 | 816 | typedef struct sqlite4 sqlite4; |
| 817 | 817 | |
| @@ -894,11 +894,11 @@ | ||
| 894 | 894 | |
| 895 | 895 | /* |
| 896 | 896 | ** CAPIREF: One-Step Query Execution Interface |
| 897 | 897 | ** |
| 898 | 898 | ** The sqlite4_exec() interface is a convenience wrapper around |
| 899 | -** [sqlite4_prepare_v2()], [sqlite4_step()], and [sqlite4_finalize()], | |
| 899 | +** [sqlite4_prepare()], [sqlite4_step()], and [sqlite4_finalize()], | |
| 900 | 900 | ** that allows an application to run multiple statements of SQL |
| 901 | 901 | ** without having to use a lot of C code. |
| 902 | 902 | ** |
| 903 | 903 | ** ^The sqlite4_exec() interface runs zero or more UTF-8 encoded, |
| 904 | 904 | ** semicolon-separate SQL statements passed into its 2nd argument, |
| @@ -1706,26 +1706,26 @@ | ||
| 1706 | 1706 | ** CAPIREF: Compile-Time Authorization Callbacks |
| 1707 | 1707 | ** |
| 1708 | 1708 | ** ^This routine registers an authorizer callback with a particular |
| 1709 | 1709 | ** [database connection], supplied in the first argument. |
| 1710 | 1710 | ** ^The authorizer callback is invoked as SQL statements are being compiled |
| 1711 | -** by [sqlite4_prepare()] or its variants [sqlite4_prepare_v2()], | |
| 1711 | +** by [sqlite4_prepare()] or its variants [sqlite4_prepare()], | |
| 1712 | 1712 | ** [sqlite4_prepare16()] and [sqlite4_prepare16_v2()]. ^At various |
| 1713 | 1713 | ** points during the compilation process, as logic is being created |
| 1714 | 1714 | ** to perform various actions, the authorizer callback is invoked to |
| 1715 | 1715 | ** see if those actions are allowed. ^The authorizer callback should |
| 1716 | 1716 | ** return [SQLITE_OK] to allow the action, [SQLITE_IGNORE] to disallow the |
| 1717 | 1717 | ** specific action but allow the SQL statement to continue to be |
| 1718 | 1718 | ** compiled, or [SQLITE_DENY] to cause the entire SQL statement to be |
| 1719 | 1719 | ** rejected with an error. ^If the authorizer callback returns |
| 1720 | 1720 | ** any value other than [SQLITE_IGNORE], [SQLITE_OK], or [SQLITE_DENY] |
| 1721 | -** then the [sqlite4_prepare_v2()] or equivalent call that triggered | |
| 1721 | +** then the [sqlite4_prepare()] or equivalent call that triggered | |
| 1722 | 1722 | ** the authorizer will fail with an error message. |
| 1723 | 1723 | ** |
| 1724 | 1724 | ** When the callback returns [SQLITE_OK], that means the operation |
| 1725 | 1725 | ** requested is ok. ^When the callback returns [SQLITE_DENY], the |
| 1726 | -** [sqlite4_prepare_v2()] or equivalent call that triggered the | |
| 1726 | +** [sqlite4_prepare()] or equivalent call that triggered the | |
| 1727 | 1727 | ** authorizer will fail with an error message explaining that |
| 1728 | 1728 | ** access is denied. |
| 1729 | 1729 | ** |
| 1730 | 1730 | ** ^The first parameter to the authorizer callback is a copy of the third |
| 1731 | 1731 | ** parameter to the sqlite4_set_authorizer() interface. ^The second parameter |
| @@ -1766,23 +1766,23 @@ | ||
| 1766 | 1766 | ** previous call.)^ ^Disable the authorizer by installing a NULL callback. |
| 1767 | 1767 | ** The authorizer is disabled by default. |
| 1768 | 1768 | ** |
| 1769 | 1769 | ** The authorizer callback must not do anything that will modify |
| 1770 | 1770 | ** the database connection that invoked the authorizer callback. |
| 1771 | -** Note that [sqlite4_prepare_v2()] and [sqlite4_step()] both modify their | |
| 1771 | +** Note that [sqlite4_prepare()] and [sqlite4_step()] both modify their | |
| 1772 | 1772 | ** database connections for the meaning of "modify" in this paragraph. |
| 1773 | 1773 | ** |
| 1774 | -** ^When [sqlite4_prepare_v2()] is used to prepare a statement, the | |
| 1774 | +** ^When [sqlite4_prepare()] is used to prepare a statement, the | |
| 1775 | 1775 | ** statement might be re-prepared during [sqlite4_step()] due to a |
| 1776 | 1776 | ** schema change. Hence, the application should ensure that the |
| 1777 | 1777 | ** correct authorizer callback remains in place during the [sqlite4_step()]. |
| 1778 | 1778 | ** |
| 1779 | 1779 | ** ^Note that the authorizer callback is invoked only during |
| 1780 | 1780 | ** [sqlite4_prepare()] or its variants. Authorization is not |
| 1781 | 1781 | ** performed during statement evaluation in [sqlite4_step()], unless |
| 1782 | 1782 | ** as stated in the previous paragraph, sqlite4_step() invokes |
| 1783 | -** sqlite4_prepare_v2() to reprepare a statement after a schema change. | |
| 1783 | +** sqlite4_prepare() to reprepare a statement after a schema change. | |
| 1784 | 1784 | */ |
| 1785 | 1785 | SQLITE_API int sqlite4_set_authorizer( |
| 1786 | 1786 | sqlite4*, |
| 1787 | 1787 | int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), |
| 1788 | 1788 | void *pUserData |
| @@ -1910,11 +1910,11 @@ | ||
| 1910 | 1910 | ** interrupted. This feature can be used to implement a |
| 1911 | 1911 | ** "Cancel" button on a GUI progress dialog box. |
| 1912 | 1912 | ** |
| 1913 | 1913 | ** The progress handler callback must not do anything that will modify |
| 1914 | 1914 | ** the database connection that invoked the progress handler. |
| 1915 | -** Note that [sqlite4_prepare_v2()] and [sqlite4_step()] both modify their | |
| 1915 | +** Note that [sqlite4_prepare()] and [sqlite4_step()] both modify their | |
| 1916 | 1916 | ** database connections for the meaning of "modify" in this paragraph. |
| 1917 | 1917 | ** |
| 1918 | 1918 | */ |
| 1919 | 1919 | SQLITE_API void sqlite4_progress_handler(sqlite4*, int, int(*)(void*), void*); |
| 1920 | 1920 | |
| @@ -2027,11 +2027,11 @@ | ||
| 2027 | 2027 | ** "compiled SQL statement" or simply as a "statement". |
| 2028 | 2028 | ** |
| 2029 | 2029 | ** The life of a statement object goes something like this: |
| 2030 | 2030 | ** |
| 2031 | 2031 | ** <ol> |
| 2032 | -** <li> Create the object using [sqlite4_prepare_v2()] or a related | |
| 2032 | +** <li> Create the object using [sqlite4_prepare()] or a related | |
| 2033 | 2033 | ** function. |
| 2034 | 2034 | ** <li> Bind values to [host parameters] using the sqlite4_bind_*() |
| 2035 | 2035 | ** interfaces. |
| 2036 | 2036 | ** <li> Run the SQL by calling [sqlite4_step()] one or more times. |
| 2037 | 2037 | ** <li> Reset the statement using [sqlite4_reset()] then go back |
| @@ -2159,13 +2159,13 @@ | ||
| 2159 | 2159 | ** The first argument, "db", is a [database connection] obtained from a |
| 2160 | 2160 | ** prior successful call to [sqlite4_open()]. |
| 2161 | 2161 | ** The database connection must not have been closed. |
| 2162 | 2162 | ** |
| 2163 | 2163 | ** The second argument, "zSql", is the statement to be compiled, encoded |
| 2164 | -** as either UTF-8 or UTF-16. The sqlite4_prepare() and sqlite4_prepare_v2() | |
| 2165 | -** interfaces use UTF-8, and sqlite4_prepare16() and sqlite4_prepare16_v2() | |
| 2166 | -** use UTF-16. | |
| 2164 | +** as either UTF-8 or UTF-16. The sqlite4_prepare() | |
| 2165 | +** interface uses UTF-8, and sqlite4_prepare16() | |
| 2166 | +** uses UTF-16. | |
| 2167 | 2167 | ** |
| 2168 | 2168 | ** ^If the nByte argument is less than zero, then zSql is read up to the |
| 2169 | 2169 | ** first zero terminator. ^If nByte is non-negative, then it is the maximum |
| 2170 | 2170 | ** number of bytes read from zSql. ^When nByte is non-negative, the |
| 2171 | 2171 | ** zSql string ends at either the first '\000' or '\u0000' character or |
| @@ -2203,11 +2203,11 @@ | ||
| 2203 | 2203 | /* |
| 2204 | 2204 | ** CAPIREF: Retrieving Statement SQL |
| 2205 | 2205 | ** |
| 2206 | 2206 | ** ^This interface can be used to retrieve a saved copy of the original |
| 2207 | 2207 | ** SQL text used to create a [prepared statement] if that statement was |
| 2208 | -** compiled using either [sqlite4_prepare_v2()] or [sqlite4_prepare16_v2()]. | |
| 2208 | +** compiled using either [sqlite4_prepare()] or [sqlite4_prepare16_v2()]. | |
| 2209 | 2209 | */ |
| 2210 | 2210 | SQLITE_API const char *sqlite4_sql(sqlite4_stmt *pStmt); |
| 2211 | 2211 | |
| 2212 | 2212 | /* |
| 2213 | 2213 | ** CAPIREF: Determine If An SQL Statement Writes The Database |
| @@ -2315,11 +2315,11 @@ | ||
| 2315 | 2315 | /* |
| 2316 | 2316 | ** CAPIREF: Binding Values To Prepared Statements |
| 2317 | 2317 | ** KEYWORDS: {host parameter} {host parameters} {host parameter name} |
| 2318 | 2318 | ** KEYWORDS: {SQL parameter} {SQL parameters} {parameter binding} |
| 2319 | 2319 | ** |
| 2320 | -** ^(In the SQL statement text input to [sqlite4_prepare_v2()] and its variants, | |
| 2320 | +** ^(In the SQL statement text input to [sqlite4_prepare()] and its variants, | |
| 2321 | 2321 | ** literals may be replaced by a [parameter] that matches one of following |
| 2322 | 2322 | ** templates: |
| 2323 | 2323 | ** |
| 2324 | 2324 | ** <ul> |
| 2325 | 2325 | ** <li> ? |
| @@ -2334,11 +2334,11 @@ | ||
| 2334 | 2334 | ** parameters (also called "host parameter names" or "SQL parameters") |
| 2335 | 2335 | ** can be set using the sqlite4_bind_*() routines defined here. |
| 2336 | 2336 | ** |
| 2337 | 2337 | ** ^The first argument to the sqlite4_bind_*() routines is always |
| 2338 | 2338 | ** a pointer to the [sqlite4_stmt] object returned from |
| 2339 | -** [sqlite4_prepare_v2()] or its variants. | |
| 2339 | +** [sqlite4_prepare()] or its variants. | |
| 2340 | 2340 | ** |
| 2341 | 2341 | ** ^The second argument is the index of the SQL parameter to be set. |
| 2342 | 2342 | ** ^The leftmost SQL parameter has an index of 1. ^When the same named |
| 2343 | 2343 | ** SQL parameter is used more than once, second and subsequent |
| 2344 | 2344 | ** occurrences have the same index as the first occurrence. |
| @@ -2608,26 +2608,15 @@ | ||
| 2608 | 2608 | SQLITE_API const void *sqlite4_column_decltype16(sqlite4_stmt*,int); |
| 2609 | 2609 | |
| 2610 | 2610 | /* |
| 2611 | 2611 | ** CAPIREF: Evaluate An SQL Statement |
| 2612 | 2612 | ** |
| 2613 | -** After a [prepared statement] has been prepared using either | |
| 2614 | -** [sqlite4_prepare_v2()] or [sqlite4_prepare16_v2()] or one of the legacy | |
| 2615 | -** interfaces [sqlite4_prepare()] or [sqlite4_prepare16()], this function | |
| 2616 | -** must be called one or more times to evaluate the statement. | |
| 2617 | -** | |
| 2618 | -** The details of the behavior of the sqlite4_step() interface depend | |
| 2619 | -** on whether the statement was prepared using the newer "v2" interface | |
| 2620 | -** [sqlite4_prepare_v2()] and [sqlite4_prepare16_v2()] or the older legacy | |
| 2621 | -** interface [sqlite4_prepare()] and [sqlite4_prepare16()]. The use of the | |
| 2622 | -** new "v2" interface is recommended for new applications but the legacy | |
| 2623 | -** interface will continue to be supported. | |
| 2624 | -** | |
| 2625 | -** ^In the legacy interface, the return value will be either [SQLITE_BUSY], | |
| 2626 | -** [SQLITE_DONE], [SQLITE_ROW], [SQLITE_ERROR], or [SQLITE_MISUSE]. | |
| 2627 | -** ^With the "v2" interface, any of the other [result codes] or | |
| 2628 | -** [extended result codes] might be returned as well. | |
| 2613 | +** After a [prepared statement] has been prepared using [sqlite4_prepare()], | |
| 2614 | +** this function must be called one or more times to evaluate the statement. | |
| 2615 | +** | |
| 2616 | +** ^This routine can return any of the other [result codes] or | |
| 2617 | +** [extended result codes]. | |
| 2629 | 2618 | ** |
| 2630 | 2619 | ** ^[SQLITE_BUSY] means that the database engine was unable to acquire the |
| 2631 | 2620 | ** database locks it needs to do its job. ^If the statement is a [COMMIT] |
| 2632 | 2621 | ** or occurs outside of an explicit transaction, then you can retry the |
| 2633 | 2622 | ** statement. If the statement is not a [COMMIT] and occurs within an |
| @@ -2645,46 +2634,17 @@ | ||
| 2645 | 2634 | ** sqlite4_step() is called again to retrieve the next row of data. |
| 2646 | 2635 | ** |
| 2647 | 2636 | ** ^[SQLITE_ERROR] means that a run-time error (such as a constraint |
| 2648 | 2637 | ** violation) has occurred. sqlite4_step() should not be called again on |
| 2649 | 2638 | ** the VM. More information may be found by calling [sqlite4_errmsg()]. |
| 2650 | -** ^With the legacy interface, a more specific error code (for example, | |
| 2651 | -** [SQLITE_INTERRUPT], [SQLITE_SCHEMA], [SQLITE_CORRUPT], and so forth) | |
| 2652 | -** can be obtained by calling [sqlite4_reset()] on the | |
| 2653 | -** [prepared statement]. ^In the "v2" interface, | |
| 2654 | -** the more specific error code is returned directly by sqlite4_step(). | |
| 2655 | 2639 | ** |
| 2656 | 2640 | ** [SQLITE_MISUSE] means that the this routine was called inappropriately. |
| 2657 | 2641 | ** Perhaps it was called on a [prepared statement] that has |
| 2658 | 2642 | ** already been [sqlite4_finalize | finalized] or on one that had |
| 2659 | 2643 | ** previously returned [SQLITE_ERROR] or [SQLITE_DONE]. Or it could |
| 2660 | 2644 | ** be the case that the same database connection is being used by two or |
| 2661 | 2645 | ** more threads at the same moment in time. |
| 2662 | -** | |
| 2663 | -** For all versions of SQLite up to and including 3.6.23.1, a call to | |
| 2664 | -** [sqlite4_reset()] was required after sqlite4_step() returned anything | |
| 2665 | -** other than [SQLITE_ROW] before any subsequent invocation of | |
| 2666 | -** sqlite4_step(). Failure to reset the prepared statement using | |
| 2667 | -** [sqlite4_reset()] would result in an [SQLITE_MISUSE] return from | |
| 2668 | -** sqlite4_step(). But after version 3.6.23.1, sqlite4_step() began | |
| 2669 | -** calling [sqlite4_reset()] automatically in this circumstance rather | |
| 2670 | -** than returning [SQLITE_MISUSE]. This is not considered a compatibility | |
| 2671 | -** break because any application that ever receives an SQLITE_MISUSE error | |
| 2672 | -** is broken by definition. The [SQLITE_OMIT_AUTORESET] compile-time option | |
| 2673 | -** can be used to restore the legacy behavior. | |
| 2674 | -** | |
| 2675 | -** <b>Goofy Interface Alert:</b> In the legacy interface, the sqlite4_step() | |
| 2676 | -** API always returns a generic error code, [SQLITE_ERROR], following any | |
| 2677 | -** error other than [SQLITE_BUSY] and [SQLITE_MISUSE]. You must call | |
| 2678 | -** [sqlite4_reset()] or [sqlite4_finalize()] in order to find one of the | |
| 2679 | -** specific [error codes] that better describes the error. | |
| 2680 | -** We admit that this is a goofy design. The problem has been fixed | |
| 2681 | -** with the "v2" interface. If you prepare all of your SQL statements | |
| 2682 | -** using either [sqlite4_prepare_v2()] or [sqlite4_prepare16_v2()] instead | |
| 2683 | -** of the legacy [sqlite4_prepare()] and [sqlite4_prepare16()] interfaces, | |
| 2684 | -** then the more specific [error codes] are returned directly | |
| 2685 | -** by sqlite4_step(). The use of the "v2" interface is recommended. | |
| 2686 | 2646 | */ |
| 2687 | 2647 | SQLITE_API int sqlite4_step(sqlite4_stmt*); |
| 2688 | 2648 | |
| 2689 | 2649 | /* |
| 2690 | 2650 | ** CAPIREF: Number of columns in a result set |
| @@ -2735,11 +2695,11 @@ | ||
| 2735 | 2695 | ** These routines form the "result set" interface. |
| 2736 | 2696 | ** |
| 2737 | 2697 | ** ^These routines return information about a single column of the current |
| 2738 | 2698 | ** result row of a query. ^In every case the first argument is a pointer |
| 2739 | 2699 | ** to the [prepared statement] that is being evaluated (the [sqlite4_stmt*] |
| 2740 | -** that was returned from [sqlite4_prepare_v2()] or one of its variants) | |
| 2700 | +** that was returned from [sqlite4_prepare()]. | |
| 2741 | 2701 | ** and the second argument is the index of the column for which information |
| 2742 | 2702 | ** should be returned. ^The leftmost column of the result set has the index 0. |
| 2743 | 2703 | ** ^The number of columns in the result can be determined using |
| 2744 | 2704 | ** [sqlite4_column_count()]. |
| 2745 | 2705 | ** |
| @@ -3593,11 +3553,11 @@ | ||
| 3593 | 3553 | ** |
| 3594 | 3554 | ** ^The sqlite4_db_handle interface returns the [database connection] handle |
| 3595 | 3555 | ** to which a [prepared statement] belongs. ^The [database connection] |
| 3596 | 3556 | ** returned by sqlite4_db_handle is the same [database connection] |
| 3597 | 3557 | ** that was the first argument |
| 3598 | -** to the [sqlite4_prepare_v2()] call (or its variants) that was used to | |
| 3558 | +** to the [sqlite4_prepare()] call (or its variants) that was used to | |
| 3599 | 3559 | ** create the statement in the first place. |
| 3600 | 3560 | */ |
| 3601 | 3561 | SQLITE_API sqlite4 *sqlite4_db_handle(sqlite4_stmt*); |
| 3602 | 3562 | |
| 3603 | 3563 | /* |
| @@ -65153,11 +65113,11 @@ | ||
| 65153 | 65113 | azColName[i], SQLITE_STATIC); |
| 65154 | 65114 | } |
| 65155 | 65115 | } |
| 65156 | 65116 | #endif |
| 65157 | 65117 | |
| 65158 | - if( db->init.busy==0 ){ | |
| 65118 | + if( /*db->init.busy==0*/ 1 ){ | |
| 65159 | 65119 | Vdbe *pVdbe = pParse->pVdbe; |
| 65160 | 65120 | sqlite4VdbeSetSql(pVdbe, zSql, (int)(pParse->zTail-zSql)); |
| 65161 | 65121 | } |
| 65162 | 65122 | if( pParse->pVdbe && (rc!=SQLITE_OK || db->mallocFailed) ){ |
| 65163 | 65123 | sqlite4VdbeFinalize(pParse->pVdbe); |
| 65164 | 65124 |
| --- src/sqlite4.c | |
| +++ src/sqlite4.c | |
| @@ -714,11 +714,11 @@ | |
| 714 | ** [sqlite4_libversion_number()], [sqlite4_sourceid()], |
| 715 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 716 | */ |
| 717 | #define SQLITE_VERSION "4.0.0" |
| 718 | #define SQLITE_VERSION_NUMBER 4000000 |
| 719 | #define SQLITE_SOURCE_ID "2012-06-26 20:17:04 f19a93d9f9d862741bc7fbb05e292d430864b2b1" |
| 720 | |
| 721 | /* |
| 722 | ** CAPIREF: Run-Time Library Version Numbers |
| 723 | ** KEYWORDS: sqlite4_version, sqlite4_sourceid |
| 724 | ** |
| @@ -807,11 +807,11 @@ | |
| 807 | ** Each open SQLite database is represented by a pointer to an instance of |
| 808 | ** the opaque structure named "sqlite4". It is useful to think of an sqlite4 |
| 809 | ** pointer as an object. The [sqlite4_open()] |
| 810 | ** interface is its constructors, and [sqlite4_close()] |
| 811 | ** is its destructor. There are many other interfaces (such as |
| 812 | ** [sqlite4_prepare_v2()], [sqlite4_create_function()], and |
| 813 | ** [sqlite4_busy_timeout()] to name but three) that are methods on an |
| 814 | ** sqlite4 object. |
| 815 | */ |
| 816 | typedef struct sqlite4 sqlite4; |
| 817 | |
| @@ -894,11 +894,11 @@ | |
| 894 | |
| 895 | /* |
| 896 | ** CAPIREF: One-Step Query Execution Interface |
| 897 | ** |
| 898 | ** The sqlite4_exec() interface is a convenience wrapper around |
| 899 | ** [sqlite4_prepare_v2()], [sqlite4_step()], and [sqlite4_finalize()], |
| 900 | ** that allows an application to run multiple statements of SQL |
| 901 | ** without having to use a lot of C code. |
| 902 | ** |
| 903 | ** ^The sqlite4_exec() interface runs zero or more UTF-8 encoded, |
| 904 | ** semicolon-separate SQL statements passed into its 2nd argument, |
| @@ -1706,26 +1706,26 @@ | |
| 1706 | ** CAPIREF: Compile-Time Authorization Callbacks |
| 1707 | ** |
| 1708 | ** ^This routine registers an authorizer callback with a particular |
| 1709 | ** [database connection], supplied in the first argument. |
| 1710 | ** ^The authorizer callback is invoked as SQL statements are being compiled |
| 1711 | ** by [sqlite4_prepare()] or its variants [sqlite4_prepare_v2()], |
| 1712 | ** [sqlite4_prepare16()] and [sqlite4_prepare16_v2()]. ^At various |
| 1713 | ** points during the compilation process, as logic is being created |
| 1714 | ** to perform various actions, the authorizer callback is invoked to |
| 1715 | ** see if those actions are allowed. ^The authorizer callback should |
| 1716 | ** return [SQLITE_OK] to allow the action, [SQLITE_IGNORE] to disallow the |
| 1717 | ** specific action but allow the SQL statement to continue to be |
| 1718 | ** compiled, or [SQLITE_DENY] to cause the entire SQL statement to be |
| 1719 | ** rejected with an error. ^If the authorizer callback returns |
| 1720 | ** any value other than [SQLITE_IGNORE], [SQLITE_OK], or [SQLITE_DENY] |
| 1721 | ** then the [sqlite4_prepare_v2()] or equivalent call that triggered |
| 1722 | ** the authorizer will fail with an error message. |
| 1723 | ** |
| 1724 | ** When the callback returns [SQLITE_OK], that means the operation |
| 1725 | ** requested is ok. ^When the callback returns [SQLITE_DENY], the |
| 1726 | ** [sqlite4_prepare_v2()] or equivalent call that triggered the |
| 1727 | ** authorizer will fail with an error message explaining that |
| 1728 | ** access is denied. |
| 1729 | ** |
| 1730 | ** ^The first parameter to the authorizer callback is a copy of the third |
| 1731 | ** parameter to the sqlite4_set_authorizer() interface. ^The second parameter |
| @@ -1766,23 +1766,23 @@ | |
| 1766 | ** previous call.)^ ^Disable the authorizer by installing a NULL callback. |
| 1767 | ** The authorizer is disabled by default. |
| 1768 | ** |
| 1769 | ** The authorizer callback must not do anything that will modify |
| 1770 | ** the database connection that invoked the authorizer callback. |
| 1771 | ** Note that [sqlite4_prepare_v2()] and [sqlite4_step()] both modify their |
| 1772 | ** database connections for the meaning of "modify" in this paragraph. |
| 1773 | ** |
| 1774 | ** ^When [sqlite4_prepare_v2()] is used to prepare a statement, the |
| 1775 | ** statement might be re-prepared during [sqlite4_step()] due to a |
| 1776 | ** schema change. Hence, the application should ensure that the |
| 1777 | ** correct authorizer callback remains in place during the [sqlite4_step()]. |
| 1778 | ** |
| 1779 | ** ^Note that the authorizer callback is invoked only during |
| 1780 | ** [sqlite4_prepare()] or its variants. Authorization is not |
| 1781 | ** performed during statement evaluation in [sqlite4_step()], unless |
| 1782 | ** as stated in the previous paragraph, sqlite4_step() invokes |
| 1783 | ** sqlite4_prepare_v2() to reprepare a statement after a schema change. |
| 1784 | */ |
| 1785 | SQLITE_API int sqlite4_set_authorizer( |
| 1786 | sqlite4*, |
| 1787 | int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), |
| 1788 | void *pUserData |
| @@ -1910,11 +1910,11 @@ | |
| 1910 | ** interrupted. This feature can be used to implement a |
| 1911 | ** "Cancel" button on a GUI progress dialog box. |
| 1912 | ** |
| 1913 | ** The progress handler callback must not do anything that will modify |
| 1914 | ** the database connection that invoked the progress handler. |
| 1915 | ** Note that [sqlite4_prepare_v2()] and [sqlite4_step()] both modify their |
| 1916 | ** database connections for the meaning of "modify" in this paragraph. |
| 1917 | ** |
| 1918 | */ |
| 1919 | SQLITE_API void sqlite4_progress_handler(sqlite4*, int, int(*)(void*), void*); |
| 1920 | |
| @@ -2027,11 +2027,11 @@ | |
| 2027 | ** "compiled SQL statement" or simply as a "statement". |
| 2028 | ** |
| 2029 | ** The life of a statement object goes something like this: |
| 2030 | ** |
| 2031 | ** <ol> |
| 2032 | ** <li> Create the object using [sqlite4_prepare_v2()] or a related |
| 2033 | ** function. |
| 2034 | ** <li> Bind values to [host parameters] using the sqlite4_bind_*() |
| 2035 | ** interfaces. |
| 2036 | ** <li> Run the SQL by calling [sqlite4_step()] one or more times. |
| 2037 | ** <li> Reset the statement using [sqlite4_reset()] then go back |
| @@ -2159,13 +2159,13 @@ | |
| 2159 | ** The first argument, "db", is a [database connection] obtained from a |
| 2160 | ** prior successful call to [sqlite4_open()]. |
| 2161 | ** The database connection must not have been closed. |
| 2162 | ** |
| 2163 | ** The second argument, "zSql", is the statement to be compiled, encoded |
| 2164 | ** as either UTF-8 or UTF-16. The sqlite4_prepare() and sqlite4_prepare_v2() |
| 2165 | ** interfaces use UTF-8, and sqlite4_prepare16() and sqlite4_prepare16_v2() |
| 2166 | ** use UTF-16. |
| 2167 | ** |
| 2168 | ** ^If the nByte argument is less than zero, then zSql is read up to the |
| 2169 | ** first zero terminator. ^If nByte is non-negative, then it is the maximum |
| 2170 | ** number of bytes read from zSql. ^When nByte is non-negative, the |
| 2171 | ** zSql string ends at either the first '\000' or '\u0000' character or |
| @@ -2203,11 +2203,11 @@ | |
| 2203 | /* |
| 2204 | ** CAPIREF: Retrieving Statement SQL |
| 2205 | ** |
| 2206 | ** ^This interface can be used to retrieve a saved copy of the original |
| 2207 | ** SQL text used to create a [prepared statement] if that statement was |
| 2208 | ** compiled using either [sqlite4_prepare_v2()] or [sqlite4_prepare16_v2()]. |
| 2209 | */ |
| 2210 | SQLITE_API const char *sqlite4_sql(sqlite4_stmt *pStmt); |
| 2211 | |
| 2212 | /* |
| 2213 | ** CAPIREF: Determine If An SQL Statement Writes The Database |
| @@ -2315,11 +2315,11 @@ | |
| 2315 | /* |
| 2316 | ** CAPIREF: Binding Values To Prepared Statements |
| 2317 | ** KEYWORDS: {host parameter} {host parameters} {host parameter name} |
| 2318 | ** KEYWORDS: {SQL parameter} {SQL parameters} {parameter binding} |
| 2319 | ** |
| 2320 | ** ^(In the SQL statement text input to [sqlite4_prepare_v2()] and its variants, |
| 2321 | ** literals may be replaced by a [parameter] that matches one of following |
| 2322 | ** templates: |
| 2323 | ** |
| 2324 | ** <ul> |
| 2325 | ** <li> ? |
| @@ -2334,11 +2334,11 @@ | |
| 2334 | ** parameters (also called "host parameter names" or "SQL parameters") |
| 2335 | ** can be set using the sqlite4_bind_*() routines defined here. |
| 2336 | ** |
| 2337 | ** ^The first argument to the sqlite4_bind_*() routines is always |
| 2338 | ** a pointer to the [sqlite4_stmt] object returned from |
| 2339 | ** [sqlite4_prepare_v2()] or its variants. |
| 2340 | ** |
| 2341 | ** ^The second argument is the index of the SQL parameter to be set. |
| 2342 | ** ^The leftmost SQL parameter has an index of 1. ^When the same named |
| 2343 | ** SQL parameter is used more than once, second and subsequent |
| 2344 | ** occurrences have the same index as the first occurrence. |
| @@ -2608,26 +2608,15 @@ | |
| 2608 | SQLITE_API const void *sqlite4_column_decltype16(sqlite4_stmt*,int); |
| 2609 | |
| 2610 | /* |
| 2611 | ** CAPIREF: Evaluate An SQL Statement |
| 2612 | ** |
| 2613 | ** After a [prepared statement] has been prepared using either |
| 2614 | ** [sqlite4_prepare_v2()] or [sqlite4_prepare16_v2()] or one of the legacy |
| 2615 | ** interfaces [sqlite4_prepare()] or [sqlite4_prepare16()], this function |
| 2616 | ** must be called one or more times to evaluate the statement. |
| 2617 | ** |
| 2618 | ** The details of the behavior of the sqlite4_step() interface depend |
| 2619 | ** on whether the statement was prepared using the newer "v2" interface |
| 2620 | ** [sqlite4_prepare_v2()] and [sqlite4_prepare16_v2()] or the older legacy |
| 2621 | ** interface [sqlite4_prepare()] and [sqlite4_prepare16()]. The use of the |
| 2622 | ** new "v2" interface is recommended for new applications but the legacy |
| 2623 | ** interface will continue to be supported. |
| 2624 | ** |
| 2625 | ** ^In the legacy interface, the return value will be either [SQLITE_BUSY], |
| 2626 | ** [SQLITE_DONE], [SQLITE_ROW], [SQLITE_ERROR], or [SQLITE_MISUSE]. |
| 2627 | ** ^With the "v2" interface, any of the other [result codes] or |
| 2628 | ** [extended result codes] might be returned as well. |
| 2629 | ** |
| 2630 | ** ^[SQLITE_BUSY] means that the database engine was unable to acquire the |
| 2631 | ** database locks it needs to do its job. ^If the statement is a [COMMIT] |
| 2632 | ** or occurs outside of an explicit transaction, then you can retry the |
| 2633 | ** statement. If the statement is not a [COMMIT] and occurs within an |
| @@ -2645,46 +2634,17 @@ | |
| 2645 | ** sqlite4_step() is called again to retrieve the next row of data. |
| 2646 | ** |
| 2647 | ** ^[SQLITE_ERROR] means that a run-time error (such as a constraint |
| 2648 | ** violation) has occurred. sqlite4_step() should not be called again on |
| 2649 | ** the VM. More information may be found by calling [sqlite4_errmsg()]. |
| 2650 | ** ^With the legacy interface, a more specific error code (for example, |
| 2651 | ** [SQLITE_INTERRUPT], [SQLITE_SCHEMA], [SQLITE_CORRUPT], and so forth) |
| 2652 | ** can be obtained by calling [sqlite4_reset()] on the |
| 2653 | ** [prepared statement]. ^In the "v2" interface, |
| 2654 | ** the more specific error code is returned directly by sqlite4_step(). |
| 2655 | ** |
| 2656 | ** [SQLITE_MISUSE] means that the this routine was called inappropriately. |
| 2657 | ** Perhaps it was called on a [prepared statement] that has |
| 2658 | ** already been [sqlite4_finalize | finalized] or on one that had |
| 2659 | ** previously returned [SQLITE_ERROR] or [SQLITE_DONE]. Or it could |
| 2660 | ** be the case that the same database connection is being used by two or |
| 2661 | ** more threads at the same moment in time. |
| 2662 | ** |
| 2663 | ** For all versions of SQLite up to and including 3.6.23.1, a call to |
| 2664 | ** [sqlite4_reset()] was required after sqlite4_step() returned anything |
| 2665 | ** other than [SQLITE_ROW] before any subsequent invocation of |
| 2666 | ** sqlite4_step(). Failure to reset the prepared statement using |
| 2667 | ** [sqlite4_reset()] would result in an [SQLITE_MISUSE] return from |
| 2668 | ** sqlite4_step(). But after version 3.6.23.1, sqlite4_step() began |
| 2669 | ** calling [sqlite4_reset()] automatically in this circumstance rather |
| 2670 | ** than returning [SQLITE_MISUSE]. This is not considered a compatibility |
| 2671 | ** break because any application that ever receives an SQLITE_MISUSE error |
| 2672 | ** is broken by definition. The [SQLITE_OMIT_AUTORESET] compile-time option |
| 2673 | ** can be used to restore the legacy behavior. |
| 2674 | ** |
| 2675 | ** <b>Goofy Interface Alert:</b> In the legacy interface, the sqlite4_step() |
| 2676 | ** API always returns a generic error code, [SQLITE_ERROR], following any |
| 2677 | ** error other than [SQLITE_BUSY] and [SQLITE_MISUSE]. You must call |
| 2678 | ** [sqlite4_reset()] or [sqlite4_finalize()] in order to find one of the |
| 2679 | ** specific [error codes] that better describes the error. |
| 2680 | ** We admit that this is a goofy design. The problem has been fixed |
| 2681 | ** with the "v2" interface. If you prepare all of your SQL statements |
| 2682 | ** using either [sqlite4_prepare_v2()] or [sqlite4_prepare16_v2()] instead |
| 2683 | ** of the legacy [sqlite4_prepare()] and [sqlite4_prepare16()] interfaces, |
| 2684 | ** then the more specific [error codes] are returned directly |
| 2685 | ** by sqlite4_step(). The use of the "v2" interface is recommended. |
| 2686 | */ |
| 2687 | SQLITE_API int sqlite4_step(sqlite4_stmt*); |
| 2688 | |
| 2689 | /* |
| 2690 | ** CAPIREF: Number of columns in a result set |
| @@ -2735,11 +2695,11 @@ | |
| 2735 | ** These routines form the "result set" interface. |
| 2736 | ** |
| 2737 | ** ^These routines return information about a single column of the current |
| 2738 | ** result row of a query. ^In every case the first argument is a pointer |
| 2739 | ** to the [prepared statement] that is being evaluated (the [sqlite4_stmt*] |
| 2740 | ** that was returned from [sqlite4_prepare_v2()] or one of its variants) |
| 2741 | ** and the second argument is the index of the column for which information |
| 2742 | ** should be returned. ^The leftmost column of the result set has the index 0. |
| 2743 | ** ^The number of columns in the result can be determined using |
| 2744 | ** [sqlite4_column_count()]. |
| 2745 | ** |
| @@ -3593,11 +3553,11 @@ | |
| 3593 | ** |
| 3594 | ** ^The sqlite4_db_handle interface returns the [database connection] handle |
| 3595 | ** to which a [prepared statement] belongs. ^The [database connection] |
| 3596 | ** returned by sqlite4_db_handle is the same [database connection] |
| 3597 | ** that was the first argument |
| 3598 | ** to the [sqlite4_prepare_v2()] call (or its variants) that was used to |
| 3599 | ** create the statement in the first place. |
| 3600 | */ |
| 3601 | SQLITE_API sqlite4 *sqlite4_db_handle(sqlite4_stmt*); |
| 3602 | |
| 3603 | /* |
| @@ -65153,11 +65113,11 @@ | |
| 65153 | azColName[i], SQLITE_STATIC); |
| 65154 | } |
| 65155 | } |
| 65156 | #endif |
| 65157 | |
| 65158 | if( db->init.busy==0 ){ |
| 65159 | Vdbe *pVdbe = pParse->pVdbe; |
| 65160 | sqlite4VdbeSetSql(pVdbe, zSql, (int)(pParse->zTail-zSql)); |
| 65161 | } |
| 65162 | if( pParse->pVdbe && (rc!=SQLITE_OK || db->mallocFailed) ){ |
| 65163 | sqlite4VdbeFinalize(pParse->pVdbe); |
| 65164 |
| --- src/sqlite4.c | |
| +++ src/sqlite4.c | |
| @@ -714,11 +714,11 @@ | |
| 714 | ** [sqlite4_libversion_number()], [sqlite4_sourceid()], |
| 715 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 716 | */ |
| 717 | #define SQLITE_VERSION "4.0.0" |
| 718 | #define SQLITE_VERSION_NUMBER 4000000 |
| 719 | #define SQLITE_SOURCE_ID "2012-06-27 13:56:22 bd2216554bbcf5eee88dc17d0d6ae165a7eddbe4" |
| 720 | |
| 721 | /* |
| 722 | ** CAPIREF: Run-Time Library Version Numbers |
| 723 | ** KEYWORDS: sqlite4_version, sqlite4_sourceid |
| 724 | ** |
| @@ -807,11 +807,11 @@ | |
| 807 | ** Each open SQLite database is represented by a pointer to an instance of |
| 808 | ** the opaque structure named "sqlite4". It is useful to think of an sqlite4 |
| 809 | ** pointer as an object. The [sqlite4_open()] |
| 810 | ** interface is its constructors, and [sqlite4_close()] |
| 811 | ** is its destructor. There are many other interfaces (such as |
| 812 | ** [sqlite4_prepare], [sqlite4_create_function()], and |
| 813 | ** [sqlite4_busy_timeout()] to name but three) that are methods on an |
| 814 | ** sqlite4 object. |
| 815 | */ |
| 816 | typedef struct sqlite4 sqlite4; |
| 817 | |
| @@ -894,11 +894,11 @@ | |
| 894 | |
| 895 | /* |
| 896 | ** CAPIREF: One-Step Query Execution Interface |
| 897 | ** |
| 898 | ** The sqlite4_exec() interface is a convenience wrapper around |
| 899 | ** [sqlite4_prepare()], [sqlite4_step()], and [sqlite4_finalize()], |
| 900 | ** that allows an application to run multiple statements of SQL |
| 901 | ** without having to use a lot of C code. |
| 902 | ** |
| 903 | ** ^The sqlite4_exec() interface runs zero or more UTF-8 encoded, |
| 904 | ** semicolon-separate SQL statements passed into its 2nd argument, |
| @@ -1706,26 +1706,26 @@ | |
| 1706 | ** CAPIREF: Compile-Time Authorization Callbacks |
| 1707 | ** |
| 1708 | ** ^This routine registers an authorizer callback with a particular |
| 1709 | ** [database connection], supplied in the first argument. |
| 1710 | ** ^The authorizer callback is invoked as SQL statements are being compiled |
| 1711 | ** by [sqlite4_prepare()] or its variants [sqlite4_prepare()], |
| 1712 | ** [sqlite4_prepare16()] and [sqlite4_prepare16_v2()]. ^At various |
| 1713 | ** points during the compilation process, as logic is being created |
| 1714 | ** to perform various actions, the authorizer callback is invoked to |
| 1715 | ** see if those actions are allowed. ^The authorizer callback should |
| 1716 | ** return [SQLITE_OK] to allow the action, [SQLITE_IGNORE] to disallow the |
| 1717 | ** specific action but allow the SQL statement to continue to be |
| 1718 | ** compiled, or [SQLITE_DENY] to cause the entire SQL statement to be |
| 1719 | ** rejected with an error. ^If the authorizer callback returns |
| 1720 | ** any value other than [SQLITE_IGNORE], [SQLITE_OK], or [SQLITE_DENY] |
| 1721 | ** then the [sqlite4_prepare()] or equivalent call that triggered |
| 1722 | ** the authorizer will fail with an error message. |
| 1723 | ** |
| 1724 | ** When the callback returns [SQLITE_OK], that means the operation |
| 1725 | ** requested is ok. ^When the callback returns [SQLITE_DENY], the |
| 1726 | ** [sqlite4_prepare()] or equivalent call that triggered the |
| 1727 | ** authorizer will fail with an error message explaining that |
| 1728 | ** access is denied. |
| 1729 | ** |
| 1730 | ** ^The first parameter to the authorizer callback is a copy of the third |
| 1731 | ** parameter to the sqlite4_set_authorizer() interface. ^The second parameter |
| @@ -1766,23 +1766,23 @@ | |
| 1766 | ** previous call.)^ ^Disable the authorizer by installing a NULL callback. |
| 1767 | ** The authorizer is disabled by default. |
| 1768 | ** |
| 1769 | ** The authorizer callback must not do anything that will modify |
| 1770 | ** the database connection that invoked the authorizer callback. |
| 1771 | ** Note that [sqlite4_prepare()] and [sqlite4_step()] both modify their |
| 1772 | ** database connections for the meaning of "modify" in this paragraph. |
| 1773 | ** |
| 1774 | ** ^When [sqlite4_prepare()] is used to prepare a statement, the |
| 1775 | ** statement might be re-prepared during [sqlite4_step()] due to a |
| 1776 | ** schema change. Hence, the application should ensure that the |
| 1777 | ** correct authorizer callback remains in place during the [sqlite4_step()]. |
| 1778 | ** |
| 1779 | ** ^Note that the authorizer callback is invoked only during |
| 1780 | ** [sqlite4_prepare()] or its variants. Authorization is not |
| 1781 | ** performed during statement evaluation in [sqlite4_step()], unless |
| 1782 | ** as stated in the previous paragraph, sqlite4_step() invokes |
| 1783 | ** sqlite4_prepare() to reprepare a statement after a schema change. |
| 1784 | */ |
| 1785 | SQLITE_API int sqlite4_set_authorizer( |
| 1786 | sqlite4*, |
| 1787 | int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), |
| 1788 | void *pUserData |
| @@ -1910,11 +1910,11 @@ | |
| 1910 | ** interrupted. This feature can be used to implement a |
| 1911 | ** "Cancel" button on a GUI progress dialog box. |
| 1912 | ** |
| 1913 | ** The progress handler callback must not do anything that will modify |
| 1914 | ** the database connection that invoked the progress handler. |
| 1915 | ** Note that [sqlite4_prepare()] and [sqlite4_step()] both modify their |
| 1916 | ** database connections for the meaning of "modify" in this paragraph. |
| 1917 | ** |
| 1918 | */ |
| 1919 | SQLITE_API void sqlite4_progress_handler(sqlite4*, int, int(*)(void*), void*); |
| 1920 | |
| @@ -2027,11 +2027,11 @@ | |
| 2027 | ** "compiled SQL statement" or simply as a "statement". |
| 2028 | ** |
| 2029 | ** The life of a statement object goes something like this: |
| 2030 | ** |
| 2031 | ** <ol> |
| 2032 | ** <li> Create the object using [sqlite4_prepare()] or a related |
| 2033 | ** function. |
| 2034 | ** <li> Bind values to [host parameters] using the sqlite4_bind_*() |
| 2035 | ** interfaces. |
| 2036 | ** <li> Run the SQL by calling [sqlite4_step()] one or more times. |
| 2037 | ** <li> Reset the statement using [sqlite4_reset()] then go back |
| @@ -2159,13 +2159,13 @@ | |
| 2159 | ** The first argument, "db", is a [database connection] obtained from a |
| 2160 | ** prior successful call to [sqlite4_open()]. |
| 2161 | ** The database connection must not have been closed. |
| 2162 | ** |
| 2163 | ** The second argument, "zSql", is the statement to be compiled, encoded |
| 2164 | ** as either UTF-8 or UTF-16. The sqlite4_prepare() |
| 2165 | ** interface uses UTF-8, and sqlite4_prepare16() |
| 2166 | ** uses UTF-16. |
| 2167 | ** |
| 2168 | ** ^If the nByte argument is less than zero, then zSql is read up to the |
| 2169 | ** first zero terminator. ^If nByte is non-negative, then it is the maximum |
| 2170 | ** number of bytes read from zSql. ^When nByte is non-negative, the |
| 2171 | ** zSql string ends at either the first '\000' or '\u0000' character or |
| @@ -2203,11 +2203,11 @@ | |
| 2203 | /* |
| 2204 | ** CAPIREF: Retrieving Statement SQL |
| 2205 | ** |
| 2206 | ** ^This interface can be used to retrieve a saved copy of the original |
| 2207 | ** SQL text used to create a [prepared statement] if that statement was |
| 2208 | ** compiled using either [sqlite4_prepare()] or [sqlite4_prepare16_v2()]. |
| 2209 | */ |
| 2210 | SQLITE_API const char *sqlite4_sql(sqlite4_stmt *pStmt); |
| 2211 | |
| 2212 | /* |
| 2213 | ** CAPIREF: Determine If An SQL Statement Writes The Database |
| @@ -2315,11 +2315,11 @@ | |
| 2315 | /* |
| 2316 | ** CAPIREF: Binding Values To Prepared Statements |
| 2317 | ** KEYWORDS: {host parameter} {host parameters} {host parameter name} |
| 2318 | ** KEYWORDS: {SQL parameter} {SQL parameters} {parameter binding} |
| 2319 | ** |
| 2320 | ** ^(In the SQL statement text input to [sqlite4_prepare()] and its variants, |
| 2321 | ** literals may be replaced by a [parameter] that matches one of following |
| 2322 | ** templates: |
| 2323 | ** |
| 2324 | ** <ul> |
| 2325 | ** <li> ? |
| @@ -2334,11 +2334,11 @@ | |
| 2334 | ** parameters (also called "host parameter names" or "SQL parameters") |
| 2335 | ** can be set using the sqlite4_bind_*() routines defined here. |
| 2336 | ** |
| 2337 | ** ^The first argument to the sqlite4_bind_*() routines is always |
| 2338 | ** a pointer to the [sqlite4_stmt] object returned from |
| 2339 | ** [sqlite4_prepare()] or its variants. |
| 2340 | ** |
| 2341 | ** ^The second argument is the index of the SQL parameter to be set. |
| 2342 | ** ^The leftmost SQL parameter has an index of 1. ^When the same named |
| 2343 | ** SQL parameter is used more than once, second and subsequent |
| 2344 | ** occurrences have the same index as the first occurrence. |
| @@ -2608,26 +2608,15 @@ | |
| 2608 | SQLITE_API const void *sqlite4_column_decltype16(sqlite4_stmt*,int); |
| 2609 | |
| 2610 | /* |
| 2611 | ** CAPIREF: Evaluate An SQL Statement |
| 2612 | ** |
| 2613 | ** After a [prepared statement] has been prepared using [sqlite4_prepare()], |
| 2614 | ** this function must be called one or more times to evaluate the statement. |
| 2615 | ** |
| 2616 | ** ^This routine can return any of the other [result codes] or |
| 2617 | ** [extended result codes]. |
| 2618 | ** |
| 2619 | ** ^[SQLITE_BUSY] means that the database engine was unable to acquire the |
| 2620 | ** database locks it needs to do its job. ^If the statement is a [COMMIT] |
| 2621 | ** or occurs outside of an explicit transaction, then you can retry the |
| 2622 | ** statement. If the statement is not a [COMMIT] and occurs within an |
| @@ -2645,46 +2634,17 @@ | |
| 2634 | ** sqlite4_step() is called again to retrieve the next row of data. |
| 2635 | ** |
| 2636 | ** ^[SQLITE_ERROR] means that a run-time error (such as a constraint |
| 2637 | ** violation) has occurred. sqlite4_step() should not be called again on |
| 2638 | ** the VM. More information may be found by calling [sqlite4_errmsg()]. |
| 2639 | ** |
| 2640 | ** [SQLITE_MISUSE] means that the this routine was called inappropriately. |
| 2641 | ** Perhaps it was called on a [prepared statement] that has |
| 2642 | ** already been [sqlite4_finalize | finalized] or on one that had |
| 2643 | ** previously returned [SQLITE_ERROR] or [SQLITE_DONE]. Or it could |
| 2644 | ** be the case that the same database connection is being used by two or |
| 2645 | ** more threads at the same moment in time. |
| 2646 | */ |
| 2647 | SQLITE_API int sqlite4_step(sqlite4_stmt*); |
| 2648 | |
| 2649 | /* |
| 2650 | ** CAPIREF: Number of columns in a result set |
| @@ -2735,11 +2695,11 @@ | |
| 2695 | ** These routines form the "result set" interface. |
| 2696 | ** |
| 2697 | ** ^These routines return information about a single column of the current |
| 2698 | ** result row of a query. ^In every case the first argument is a pointer |
| 2699 | ** to the [prepared statement] that is being evaluated (the [sqlite4_stmt*] |
| 2700 | ** that was returned from [sqlite4_prepare()]. |
| 2701 | ** and the second argument is the index of the column for which information |
| 2702 | ** should be returned. ^The leftmost column of the result set has the index 0. |
| 2703 | ** ^The number of columns in the result can be determined using |
| 2704 | ** [sqlite4_column_count()]. |
| 2705 | ** |
| @@ -3593,11 +3553,11 @@ | |
| 3553 | ** |
| 3554 | ** ^The sqlite4_db_handle interface returns the [database connection] handle |
| 3555 | ** to which a [prepared statement] belongs. ^The [database connection] |
| 3556 | ** returned by sqlite4_db_handle is the same [database connection] |
| 3557 | ** that was the first argument |
| 3558 | ** to the [sqlite4_prepare()] call (or its variants) that was used to |
| 3559 | ** create the statement in the first place. |
| 3560 | */ |
| 3561 | SQLITE_API sqlite4 *sqlite4_db_handle(sqlite4_stmt*); |
| 3562 | |
| 3563 | /* |
| @@ -65153,11 +65113,11 @@ | |
| 65113 | azColName[i], SQLITE_STATIC); |
| 65114 | } |
| 65115 | } |
| 65116 | #endif |
| 65117 | |
| 65118 | if( /*db->init.busy==0*/ 1 ){ |
| 65119 | Vdbe *pVdbe = pParse->pVdbe; |
| 65120 | sqlite4VdbeSetSql(pVdbe, zSql, (int)(pParse->zTail-zSql)); |
| 65121 | } |
| 65122 | if( pParse->pVdbe && (rc!=SQLITE_OK || db->mallocFailed) ){ |
| 65123 | sqlite4VdbeFinalize(pParse->pVdbe); |
| 65124 |
+24
-64
| --- src/sqlite4.h | ||
| +++ src/sqlite4.h | ||
| @@ -158,11 +158,11 @@ | ||
| 158 | 158 | ** [sqlite4_libversion_number()], [sqlite4_sourceid()], |
| 159 | 159 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 160 | 160 | */ |
| 161 | 161 | #define SQLITE_VERSION "4.0.0" |
| 162 | 162 | #define SQLITE_VERSION_NUMBER 4000000 |
| 163 | -#define SQLITE_SOURCE_ID "2012-06-26 20:17:04 f19a93d9f9d862741bc7fbb05e292d430864b2b1" | |
| 163 | +#define SQLITE_SOURCE_ID "2012-06-27 13:56:22 bd2216554bbcf5eee88dc17d0d6ae165a7eddbe4" | |
| 164 | 164 | |
| 165 | 165 | /* |
| 166 | 166 | ** CAPIREF: Run-Time Library Version Numbers |
| 167 | 167 | ** KEYWORDS: sqlite4_version, sqlite4_sourceid |
| 168 | 168 | ** |
| @@ -251,11 +251,11 @@ | ||
| 251 | 251 | ** Each open SQLite database is represented by a pointer to an instance of |
| 252 | 252 | ** the opaque structure named "sqlite4". It is useful to think of an sqlite4 |
| 253 | 253 | ** pointer as an object. The [sqlite4_open()] |
| 254 | 254 | ** interface is its constructors, and [sqlite4_close()] |
| 255 | 255 | ** is its destructor. There are many other interfaces (such as |
| 256 | -** [sqlite4_prepare_v2()], [sqlite4_create_function()], and | |
| 256 | +** [sqlite4_prepare], [sqlite4_create_function()], and | |
| 257 | 257 | ** [sqlite4_busy_timeout()] to name but three) that are methods on an |
| 258 | 258 | ** sqlite4 object. |
| 259 | 259 | */ |
| 260 | 260 | typedef struct sqlite4 sqlite4; |
| 261 | 261 | |
| @@ -338,11 +338,11 @@ | ||
| 338 | 338 | |
| 339 | 339 | /* |
| 340 | 340 | ** CAPIREF: One-Step Query Execution Interface |
| 341 | 341 | ** |
| 342 | 342 | ** The sqlite4_exec() interface is a convenience wrapper around |
| 343 | -** [sqlite4_prepare_v2()], [sqlite4_step()], and [sqlite4_finalize()], | |
| 343 | +** [sqlite4_prepare()], [sqlite4_step()], and [sqlite4_finalize()], | |
| 344 | 344 | ** that allows an application to run multiple statements of SQL |
| 345 | 345 | ** without having to use a lot of C code. |
| 346 | 346 | ** |
| 347 | 347 | ** ^The sqlite4_exec() interface runs zero or more UTF-8 encoded, |
| 348 | 348 | ** semicolon-separate SQL statements passed into its 2nd argument, |
| @@ -1150,26 +1150,26 @@ | ||
| 1150 | 1150 | ** CAPIREF: Compile-Time Authorization Callbacks |
| 1151 | 1151 | ** |
| 1152 | 1152 | ** ^This routine registers an authorizer callback with a particular |
| 1153 | 1153 | ** [database connection], supplied in the first argument. |
| 1154 | 1154 | ** ^The authorizer callback is invoked as SQL statements are being compiled |
| 1155 | -** by [sqlite4_prepare()] or its variants [sqlite4_prepare_v2()], | |
| 1155 | +** by [sqlite4_prepare()] or its variants [sqlite4_prepare()], | |
| 1156 | 1156 | ** [sqlite4_prepare16()] and [sqlite4_prepare16_v2()]. ^At various |
| 1157 | 1157 | ** points during the compilation process, as logic is being created |
| 1158 | 1158 | ** to perform various actions, the authorizer callback is invoked to |
| 1159 | 1159 | ** see if those actions are allowed. ^The authorizer callback should |
| 1160 | 1160 | ** return [SQLITE_OK] to allow the action, [SQLITE_IGNORE] to disallow the |
| 1161 | 1161 | ** specific action but allow the SQL statement to continue to be |
| 1162 | 1162 | ** compiled, or [SQLITE_DENY] to cause the entire SQL statement to be |
| 1163 | 1163 | ** rejected with an error. ^If the authorizer callback returns |
| 1164 | 1164 | ** any value other than [SQLITE_IGNORE], [SQLITE_OK], or [SQLITE_DENY] |
| 1165 | -** then the [sqlite4_prepare_v2()] or equivalent call that triggered | |
| 1165 | +** then the [sqlite4_prepare()] or equivalent call that triggered | |
| 1166 | 1166 | ** the authorizer will fail with an error message. |
| 1167 | 1167 | ** |
| 1168 | 1168 | ** When the callback returns [SQLITE_OK], that means the operation |
| 1169 | 1169 | ** requested is ok. ^When the callback returns [SQLITE_DENY], the |
| 1170 | -** [sqlite4_prepare_v2()] or equivalent call that triggered the | |
| 1170 | +** [sqlite4_prepare()] or equivalent call that triggered the | |
| 1171 | 1171 | ** authorizer will fail with an error message explaining that |
| 1172 | 1172 | ** access is denied. |
| 1173 | 1173 | ** |
| 1174 | 1174 | ** ^The first parameter to the authorizer callback is a copy of the third |
| 1175 | 1175 | ** parameter to the sqlite4_set_authorizer() interface. ^The second parameter |
| @@ -1210,23 +1210,23 @@ | ||
| 1210 | 1210 | ** previous call.)^ ^Disable the authorizer by installing a NULL callback. |
| 1211 | 1211 | ** The authorizer is disabled by default. |
| 1212 | 1212 | ** |
| 1213 | 1213 | ** The authorizer callback must not do anything that will modify |
| 1214 | 1214 | ** the database connection that invoked the authorizer callback. |
| 1215 | -** Note that [sqlite4_prepare_v2()] and [sqlite4_step()] both modify their | |
| 1215 | +** Note that [sqlite4_prepare()] and [sqlite4_step()] both modify their | |
| 1216 | 1216 | ** database connections for the meaning of "modify" in this paragraph. |
| 1217 | 1217 | ** |
| 1218 | -** ^When [sqlite4_prepare_v2()] is used to prepare a statement, the | |
| 1218 | +** ^When [sqlite4_prepare()] is used to prepare a statement, the | |
| 1219 | 1219 | ** statement might be re-prepared during [sqlite4_step()] due to a |
| 1220 | 1220 | ** schema change. Hence, the application should ensure that the |
| 1221 | 1221 | ** correct authorizer callback remains in place during the [sqlite4_step()]. |
| 1222 | 1222 | ** |
| 1223 | 1223 | ** ^Note that the authorizer callback is invoked only during |
| 1224 | 1224 | ** [sqlite4_prepare()] or its variants. Authorization is not |
| 1225 | 1225 | ** performed during statement evaluation in [sqlite4_step()], unless |
| 1226 | 1226 | ** as stated in the previous paragraph, sqlite4_step() invokes |
| 1227 | -** sqlite4_prepare_v2() to reprepare a statement after a schema change. | |
| 1227 | +** sqlite4_prepare() to reprepare a statement after a schema change. | |
| 1228 | 1228 | */ |
| 1229 | 1229 | SQLITE_API int sqlite4_set_authorizer( |
| 1230 | 1230 | sqlite4*, |
| 1231 | 1231 | int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), |
| 1232 | 1232 | void *pUserData |
| @@ -1354,11 +1354,11 @@ | ||
| 1354 | 1354 | ** interrupted. This feature can be used to implement a |
| 1355 | 1355 | ** "Cancel" button on a GUI progress dialog box. |
| 1356 | 1356 | ** |
| 1357 | 1357 | ** The progress handler callback must not do anything that will modify |
| 1358 | 1358 | ** the database connection that invoked the progress handler. |
| 1359 | -** Note that [sqlite4_prepare_v2()] and [sqlite4_step()] both modify their | |
| 1359 | +** Note that [sqlite4_prepare()] and [sqlite4_step()] both modify their | |
| 1360 | 1360 | ** database connections for the meaning of "modify" in this paragraph. |
| 1361 | 1361 | ** |
| 1362 | 1362 | */ |
| 1363 | 1363 | SQLITE_API void sqlite4_progress_handler(sqlite4*, int, int(*)(void*), void*); |
| 1364 | 1364 | |
| @@ -1471,11 +1471,11 @@ | ||
| 1471 | 1471 | ** "compiled SQL statement" or simply as a "statement". |
| 1472 | 1472 | ** |
| 1473 | 1473 | ** The life of a statement object goes something like this: |
| 1474 | 1474 | ** |
| 1475 | 1475 | ** <ol> |
| 1476 | -** <li> Create the object using [sqlite4_prepare_v2()] or a related | |
| 1476 | +** <li> Create the object using [sqlite4_prepare()] or a related | |
| 1477 | 1477 | ** function. |
| 1478 | 1478 | ** <li> Bind values to [host parameters] using the sqlite4_bind_*() |
| 1479 | 1479 | ** interfaces. |
| 1480 | 1480 | ** <li> Run the SQL by calling [sqlite4_step()] one or more times. |
| 1481 | 1481 | ** <li> Reset the statement using [sqlite4_reset()] then go back |
| @@ -1603,13 +1603,13 @@ | ||
| 1603 | 1603 | ** The first argument, "db", is a [database connection] obtained from a |
| 1604 | 1604 | ** prior successful call to [sqlite4_open()]. |
| 1605 | 1605 | ** The database connection must not have been closed. |
| 1606 | 1606 | ** |
| 1607 | 1607 | ** The second argument, "zSql", is the statement to be compiled, encoded |
| 1608 | -** as either UTF-8 or UTF-16. The sqlite4_prepare() and sqlite4_prepare_v2() | |
| 1609 | -** interfaces use UTF-8, and sqlite4_prepare16() and sqlite4_prepare16_v2() | |
| 1610 | -** use UTF-16. | |
| 1608 | +** as either UTF-8 or UTF-16. The sqlite4_prepare() | |
| 1609 | +** interface uses UTF-8, and sqlite4_prepare16() | |
| 1610 | +** uses UTF-16. | |
| 1611 | 1611 | ** |
| 1612 | 1612 | ** ^If the nByte argument is less than zero, then zSql is read up to the |
| 1613 | 1613 | ** first zero terminator. ^If nByte is non-negative, then it is the maximum |
| 1614 | 1614 | ** number of bytes read from zSql. ^When nByte is non-negative, the |
| 1615 | 1615 | ** zSql string ends at either the first '\000' or '\u0000' character or |
| @@ -1647,11 +1647,11 @@ | ||
| 1647 | 1647 | /* |
| 1648 | 1648 | ** CAPIREF: Retrieving Statement SQL |
| 1649 | 1649 | ** |
| 1650 | 1650 | ** ^This interface can be used to retrieve a saved copy of the original |
| 1651 | 1651 | ** SQL text used to create a [prepared statement] if that statement was |
| 1652 | -** compiled using either [sqlite4_prepare_v2()] or [sqlite4_prepare16_v2()]. | |
| 1652 | +** compiled using either [sqlite4_prepare()] or [sqlite4_prepare16_v2()]. | |
| 1653 | 1653 | */ |
| 1654 | 1654 | SQLITE_API const char *sqlite4_sql(sqlite4_stmt *pStmt); |
| 1655 | 1655 | |
| 1656 | 1656 | /* |
| 1657 | 1657 | ** CAPIREF: Determine If An SQL Statement Writes The Database |
| @@ -1759,11 +1759,11 @@ | ||
| 1759 | 1759 | /* |
| 1760 | 1760 | ** CAPIREF: Binding Values To Prepared Statements |
| 1761 | 1761 | ** KEYWORDS: {host parameter} {host parameters} {host parameter name} |
| 1762 | 1762 | ** KEYWORDS: {SQL parameter} {SQL parameters} {parameter binding} |
| 1763 | 1763 | ** |
| 1764 | -** ^(In the SQL statement text input to [sqlite4_prepare_v2()] and its variants, | |
| 1764 | +** ^(In the SQL statement text input to [sqlite4_prepare()] and its variants, | |
| 1765 | 1765 | ** literals may be replaced by a [parameter] that matches one of following |
| 1766 | 1766 | ** templates: |
| 1767 | 1767 | ** |
| 1768 | 1768 | ** <ul> |
| 1769 | 1769 | ** <li> ? |
| @@ -1778,11 +1778,11 @@ | ||
| 1778 | 1778 | ** parameters (also called "host parameter names" or "SQL parameters") |
| 1779 | 1779 | ** can be set using the sqlite4_bind_*() routines defined here. |
| 1780 | 1780 | ** |
| 1781 | 1781 | ** ^The first argument to the sqlite4_bind_*() routines is always |
| 1782 | 1782 | ** a pointer to the [sqlite4_stmt] object returned from |
| 1783 | -** [sqlite4_prepare_v2()] or its variants. | |
| 1783 | +** [sqlite4_prepare()] or its variants. | |
| 1784 | 1784 | ** |
| 1785 | 1785 | ** ^The second argument is the index of the SQL parameter to be set. |
| 1786 | 1786 | ** ^The leftmost SQL parameter has an index of 1. ^When the same named |
| 1787 | 1787 | ** SQL parameter is used more than once, second and subsequent |
| 1788 | 1788 | ** occurrences have the same index as the first occurrence. |
| @@ -2052,26 +2052,15 @@ | ||
| 2052 | 2052 | SQLITE_API const void *sqlite4_column_decltype16(sqlite4_stmt*,int); |
| 2053 | 2053 | |
| 2054 | 2054 | /* |
| 2055 | 2055 | ** CAPIREF: Evaluate An SQL Statement |
| 2056 | 2056 | ** |
| 2057 | -** After a [prepared statement] has been prepared using either | |
| 2058 | -** [sqlite4_prepare_v2()] or [sqlite4_prepare16_v2()] or one of the legacy | |
| 2059 | -** interfaces [sqlite4_prepare()] or [sqlite4_prepare16()], this function | |
| 2060 | -** must be called one or more times to evaluate the statement. | |
| 2061 | -** | |
| 2062 | -** The details of the behavior of the sqlite4_step() interface depend | |
| 2063 | -** on whether the statement was prepared using the newer "v2" interface | |
| 2064 | -** [sqlite4_prepare_v2()] and [sqlite4_prepare16_v2()] or the older legacy | |
| 2065 | -** interface [sqlite4_prepare()] and [sqlite4_prepare16()]. The use of the | |
| 2066 | -** new "v2" interface is recommended for new applications but the legacy | |
| 2067 | -** interface will continue to be supported. | |
| 2068 | -** | |
| 2069 | -** ^In the legacy interface, the return value will be either [SQLITE_BUSY], | |
| 2070 | -** [SQLITE_DONE], [SQLITE_ROW], [SQLITE_ERROR], or [SQLITE_MISUSE]. | |
| 2071 | -** ^With the "v2" interface, any of the other [result codes] or | |
| 2072 | -** [extended result codes] might be returned as well. | |
| 2057 | +** After a [prepared statement] has been prepared using [sqlite4_prepare()], | |
| 2058 | +** this function must be called one or more times to evaluate the statement. | |
| 2059 | +** | |
| 2060 | +** ^This routine can return any of the other [result codes] or | |
| 2061 | +** [extended result codes]. | |
| 2073 | 2062 | ** |
| 2074 | 2063 | ** ^[SQLITE_BUSY] means that the database engine was unable to acquire the |
| 2075 | 2064 | ** database locks it needs to do its job. ^If the statement is a [COMMIT] |
| 2076 | 2065 | ** or occurs outside of an explicit transaction, then you can retry the |
| 2077 | 2066 | ** statement. If the statement is not a [COMMIT] and occurs within an |
| @@ -2089,46 +2078,17 @@ | ||
| 2089 | 2078 | ** sqlite4_step() is called again to retrieve the next row of data. |
| 2090 | 2079 | ** |
| 2091 | 2080 | ** ^[SQLITE_ERROR] means that a run-time error (such as a constraint |
| 2092 | 2081 | ** violation) has occurred. sqlite4_step() should not be called again on |
| 2093 | 2082 | ** the VM. More information may be found by calling [sqlite4_errmsg()]. |
| 2094 | -** ^With the legacy interface, a more specific error code (for example, | |
| 2095 | -** [SQLITE_INTERRUPT], [SQLITE_SCHEMA], [SQLITE_CORRUPT], and so forth) | |
| 2096 | -** can be obtained by calling [sqlite4_reset()] on the | |
| 2097 | -** [prepared statement]. ^In the "v2" interface, | |
| 2098 | -** the more specific error code is returned directly by sqlite4_step(). | |
| 2099 | 2083 | ** |
| 2100 | 2084 | ** [SQLITE_MISUSE] means that the this routine was called inappropriately. |
| 2101 | 2085 | ** Perhaps it was called on a [prepared statement] that has |
| 2102 | 2086 | ** already been [sqlite4_finalize | finalized] or on one that had |
| 2103 | 2087 | ** previously returned [SQLITE_ERROR] or [SQLITE_DONE]. Or it could |
| 2104 | 2088 | ** be the case that the same database connection is being used by two or |
| 2105 | 2089 | ** more threads at the same moment in time. |
| 2106 | -** | |
| 2107 | -** For all versions of SQLite up to and including 3.6.23.1, a call to | |
| 2108 | -** [sqlite4_reset()] was required after sqlite4_step() returned anything | |
| 2109 | -** other than [SQLITE_ROW] before any subsequent invocation of | |
| 2110 | -** sqlite4_step(). Failure to reset the prepared statement using | |
| 2111 | -** [sqlite4_reset()] would result in an [SQLITE_MISUSE] return from | |
| 2112 | -** sqlite4_step(). But after version 3.6.23.1, sqlite4_step() began | |
| 2113 | -** calling [sqlite4_reset()] automatically in this circumstance rather | |
| 2114 | -** than returning [SQLITE_MISUSE]. This is not considered a compatibility | |
| 2115 | -** break because any application that ever receives an SQLITE_MISUSE error | |
| 2116 | -** is broken by definition. The [SQLITE_OMIT_AUTORESET] compile-time option | |
| 2117 | -** can be used to restore the legacy behavior. | |
| 2118 | -** | |
| 2119 | -** <b>Goofy Interface Alert:</b> In the legacy interface, the sqlite4_step() | |
| 2120 | -** API always returns a generic error code, [SQLITE_ERROR], following any | |
| 2121 | -** error other than [SQLITE_BUSY] and [SQLITE_MISUSE]. You must call | |
| 2122 | -** [sqlite4_reset()] or [sqlite4_finalize()] in order to find one of the | |
| 2123 | -** specific [error codes] that better describes the error. | |
| 2124 | -** We admit that this is a goofy design. The problem has been fixed | |
| 2125 | -** with the "v2" interface. If you prepare all of your SQL statements | |
| 2126 | -** using either [sqlite4_prepare_v2()] or [sqlite4_prepare16_v2()] instead | |
| 2127 | -** of the legacy [sqlite4_prepare()] and [sqlite4_prepare16()] interfaces, | |
| 2128 | -** then the more specific [error codes] are returned directly | |
| 2129 | -** by sqlite4_step(). The use of the "v2" interface is recommended. | |
| 2130 | 2090 | */ |
| 2131 | 2091 | SQLITE_API int sqlite4_step(sqlite4_stmt*); |
| 2132 | 2092 | |
| 2133 | 2093 | /* |
| 2134 | 2094 | ** CAPIREF: Number of columns in a result set |
| @@ -2179,11 +2139,11 @@ | ||
| 2179 | 2139 | ** These routines form the "result set" interface. |
| 2180 | 2140 | ** |
| 2181 | 2141 | ** ^These routines return information about a single column of the current |
| 2182 | 2142 | ** result row of a query. ^In every case the first argument is a pointer |
| 2183 | 2143 | ** to the [prepared statement] that is being evaluated (the [sqlite4_stmt*] |
| 2184 | -** that was returned from [sqlite4_prepare_v2()] or one of its variants) | |
| 2144 | +** that was returned from [sqlite4_prepare()]. | |
| 2185 | 2145 | ** and the second argument is the index of the column for which information |
| 2186 | 2146 | ** should be returned. ^The leftmost column of the result set has the index 0. |
| 2187 | 2147 | ** ^The number of columns in the result can be determined using |
| 2188 | 2148 | ** [sqlite4_column_count()]. |
| 2189 | 2149 | ** |
| @@ -3037,11 +2997,11 @@ | ||
| 3037 | 2997 | ** |
| 3038 | 2998 | ** ^The sqlite4_db_handle interface returns the [database connection] handle |
| 3039 | 2999 | ** to which a [prepared statement] belongs. ^The [database connection] |
| 3040 | 3000 | ** returned by sqlite4_db_handle is the same [database connection] |
| 3041 | 3001 | ** that was the first argument |
| 3042 | -** to the [sqlite4_prepare_v2()] call (or its variants) that was used to | |
| 3002 | +** to the [sqlite4_prepare()] call (or its variants) that was used to | |
| 3043 | 3003 | ** create the statement in the first place. |
| 3044 | 3004 | */ |
| 3045 | 3005 | SQLITE_API sqlite4 *sqlite4_db_handle(sqlite4_stmt*); |
| 3046 | 3006 | |
| 3047 | 3007 | /* |
| 3048 | 3008 |
| --- src/sqlite4.h | |
| +++ src/sqlite4.h | |
| @@ -158,11 +158,11 @@ | |
| 158 | ** [sqlite4_libversion_number()], [sqlite4_sourceid()], |
| 159 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 160 | */ |
| 161 | #define SQLITE_VERSION "4.0.0" |
| 162 | #define SQLITE_VERSION_NUMBER 4000000 |
| 163 | #define SQLITE_SOURCE_ID "2012-06-26 20:17:04 f19a93d9f9d862741bc7fbb05e292d430864b2b1" |
| 164 | |
| 165 | /* |
| 166 | ** CAPIREF: Run-Time Library Version Numbers |
| 167 | ** KEYWORDS: sqlite4_version, sqlite4_sourceid |
| 168 | ** |
| @@ -251,11 +251,11 @@ | |
| 251 | ** Each open SQLite database is represented by a pointer to an instance of |
| 252 | ** the opaque structure named "sqlite4". It is useful to think of an sqlite4 |
| 253 | ** pointer as an object. The [sqlite4_open()] |
| 254 | ** interface is its constructors, and [sqlite4_close()] |
| 255 | ** is its destructor. There are many other interfaces (such as |
| 256 | ** [sqlite4_prepare_v2()], [sqlite4_create_function()], and |
| 257 | ** [sqlite4_busy_timeout()] to name but three) that are methods on an |
| 258 | ** sqlite4 object. |
| 259 | */ |
| 260 | typedef struct sqlite4 sqlite4; |
| 261 | |
| @@ -338,11 +338,11 @@ | |
| 338 | |
| 339 | /* |
| 340 | ** CAPIREF: One-Step Query Execution Interface |
| 341 | ** |
| 342 | ** The sqlite4_exec() interface is a convenience wrapper around |
| 343 | ** [sqlite4_prepare_v2()], [sqlite4_step()], and [sqlite4_finalize()], |
| 344 | ** that allows an application to run multiple statements of SQL |
| 345 | ** without having to use a lot of C code. |
| 346 | ** |
| 347 | ** ^The sqlite4_exec() interface runs zero or more UTF-8 encoded, |
| 348 | ** semicolon-separate SQL statements passed into its 2nd argument, |
| @@ -1150,26 +1150,26 @@ | |
| 1150 | ** CAPIREF: Compile-Time Authorization Callbacks |
| 1151 | ** |
| 1152 | ** ^This routine registers an authorizer callback with a particular |
| 1153 | ** [database connection], supplied in the first argument. |
| 1154 | ** ^The authorizer callback is invoked as SQL statements are being compiled |
| 1155 | ** by [sqlite4_prepare()] or its variants [sqlite4_prepare_v2()], |
| 1156 | ** [sqlite4_prepare16()] and [sqlite4_prepare16_v2()]. ^At various |
| 1157 | ** points during the compilation process, as logic is being created |
| 1158 | ** to perform various actions, the authorizer callback is invoked to |
| 1159 | ** see if those actions are allowed. ^The authorizer callback should |
| 1160 | ** return [SQLITE_OK] to allow the action, [SQLITE_IGNORE] to disallow the |
| 1161 | ** specific action but allow the SQL statement to continue to be |
| 1162 | ** compiled, or [SQLITE_DENY] to cause the entire SQL statement to be |
| 1163 | ** rejected with an error. ^If the authorizer callback returns |
| 1164 | ** any value other than [SQLITE_IGNORE], [SQLITE_OK], or [SQLITE_DENY] |
| 1165 | ** then the [sqlite4_prepare_v2()] or equivalent call that triggered |
| 1166 | ** the authorizer will fail with an error message. |
| 1167 | ** |
| 1168 | ** When the callback returns [SQLITE_OK], that means the operation |
| 1169 | ** requested is ok. ^When the callback returns [SQLITE_DENY], the |
| 1170 | ** [sqlite4_prepare_v2()] or equivalent call that triggered the |
| 1171 | ** authorizer will fail with an error message explaining that |
| 1172 | ** access is denied. |
| 1173 | ** |
| 1174 | ** ^The first parameter to the authorizer callback is a copy of the third |
| 1175 | ** parameter to the sqlite4_set_authorizer() interface. ^The second parameter |
| @@ -1210,23 +1210,23 @@ | |
| 1210 | ** previous call.)^ ^Disable the authorizer by installing a NULL callback. |
| 1211 | ** The authorizer is disabled by default. |
| 1212 | ** |
| 1213 | ** The authorizer callback must not do anything that will modify |
| 1214 | ** the database connection that invoked the authorizer callback. |
| 1215 | ** Note that [sqlite4_prepare_v2()] and [sqlite4_step()] both modify their |
| 1216 | ** database connections for the meaning of "modify" in this paragraph. |
| 1217 | ** |
| 1218 | ** ^When [sqlite4_prepare_v2()] is used to prepare a statement, the |
| 1219 | ** statement might be re-prepared during [sqlite4_step()] due to a |
| 1220 | ** schema change. Hence, the application should ensure that the |
| 1221 | ** correct authorizer callback remains in place during the [sqlite4_step()]. |
| 1222 | ** |
| 1223 | ** ^Note that the authorizer callback is invoked only during |
| 1224 | ** [sqlite4_prepare()] or its variants. Authorization is not |
| 1225 | ** performed during statement evaluation in [sqlite4_step()], unless |
| 1226 | ** as stated in the previous paragraph, sqlite4_step() invokes |
| 1227 | ** sqlite4_prepare_v2() to reprepare a statement after a schema change. |
| 1228 | */ |
| 1229 | SQLITE_API int sqlite4_set_authorizer( |
| 1230 | sqlite4*, |
| 1231 | int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), |
| 1232 | void *pUserData |
| @@ -1354,11 +1354,11 @@ | |
| 1354 | ** interrupted. This feature can be used to implement a |
| 1355 | ** "Cancel" button on a GUI progress dialog box. |
| 1356 | ** |
| 1357 | ** The progress handler callback must not do anything that will modify |
| 1358 | ** the database connection that invoked the progress handler. |
| 1359 | ** Note that [sqlite4_prepare_v2()] and [sqlite4_step()] both modify their |
| 1360 | ** database connections for the meaning of "modify" in this paragraph. |
| 1361 | ** |
| 1362 | */ |
| 1363 | SQLITE_API void sqlite4_progress_handler(sqlite4*, int, int(*)(void*), void*); |
| 1364 | |
| @@ -1471,11 +1471,11 @@ | |
| 1471 | ** "compiled SQL statement" or simply as a "statement". |
| 1472 | ** |
| 1473 | ** The life of a statement object goes something like this: |
| 1474 | ** |
| 1475 | ** <ol> |
| 1476 | ** <li> Create the object using [sqlite4_prepare_v2()] or a related |
| 1477 | ** function. |
| 1478 | ** <li> Bind values to [host parameters] using the sqlite4_bind_*() |
| 1479 | ** interfaces. |
| 1480 | ** <li> Run the SQL by calling [sqlite4_step()] one or more times. |
| 1481 | ** <li> Reset the statement using [sqlite4_reset()] then go back |
| @@ -1603,13 +1603,13 @@ | |
| 1603 | ** The first argument, "db", is a [database connection] obtained from a |
| 1604 | ** prior successful call to [sqlite4_open()]. |
| 1605 | ** The database connection must not have been closed. |
| 1606 | ** |
| 1607 | ** The second argument, "zSql", is the statement to be compiled, encoded |
| 1608 | ** as either UTF-8 or UTF-16. The sqlite4_prepare() and sqlite4_prepare_v2() |
| 1609 | ** interfaces use UTF-8, and sqlite4_prepare16() and sqlite4_prepare16_v2() |
| 1610 | ** use UTF-16. |
| 1611 | ** |
| 1612 | ** ^If the nByte argument is less than zero, then zSql is read up to the |
| 1613 | ** first zero terminator. ^If nByte is non-negative, then it is the maximum |
| 1614 | ** number of bytes read from zSql. ^When nByte is non-negative, the |
| 1615 | ** zSql string ends at either the first '\000' or '\u0000' character or |
| @@ -1647,11 +1647,11 @@ | |
| 1647 | /* |
| 1648 | ** CAPIREF: Retrieving Statement SQL |
| 1649 | ** |
| 1650 | ** ^This interface can be used to retrieve a saved copy of the original |
| 1651 | ** SQL text used to create a [prepared statement] if that statement was |
| 1652 | ** compiled using either [sqlite4_prepare_v2()] or [sqlite4_prepare16_v2()]. |
| 1653 | */ |
| 1654 | SQLITE_API const char *sqlite4_sql(sqlite4_stmt *pStmt); |
| 1655 | |
| 1656 | /* |
| 1657 | ** CAPIREF: Determine If An SQL Statement Writes The Database |
| @@ -1759,11 +1759,11 @@ | |
| 1759 | /* |
| 1760 | ** CAPIREF: Binding Values To Prepared Statements |
| 1761 | ** KEYWORDS: {host parameter} {host parameters} {host parameter name} |
| 1762 | ** KEYWORDS: {SQL parameter} {SQL parameters} {parameter binding} |
| 1763 | ** |
| 1764 | ** ^(In the SQL statement text input to [sqlite4_prepare_v2()] and its variants, |
| 1765 | ** literals may be replaced by a [parameter] that matches one of following |
| 1766 | ** templates: |
| 1767 | ** |
| 1768 | ** <ul> |
| 1769 | ** <li> ? |
| @@ -1778,11 +1778,11 @@ | |
| 1778 | ** parameters (also called "host parameter names" or "SQL parameters") |
| 1779 | ** can be set using the sqlite4_bind_*() routines defined here. |
| 1780 | ** |
| 1781 | ** ^The first argument to the sqlite4_bind_*() routines is always |
| 1782 | ** a pointer to the [sqlite4_stmt] object returned from |
| 1783 | ** [sqlite4_prepare_v2()] or its variants. |
| 1784 | ** |
| 1785 | ** ^The second argument is the index of the SQL parameter to be set. |
| 1786 | ** ^The leftmost SQL parameter has an index of 1. ^When the same named |
| 1787 | ** SQL parameter is used more than once, second and subsequent |
| 1788 | ** occurrences have the same index as the first occurrence. |
| @@ -2052,26 +2052,15 @@ | |
| 2052 | SQLITE_API const void *sqlite4_column_decltype16(sqlite4_stmt*,int); |
| 2053 | |
| 2054 | /* |
| 2055 | ** CAPIREF: Evaluate An SQL Statement |
| 2056 | ** |
| 2057 | ** After a [prepared statement] has been prepared using either |
| 2058 | ** [sqlite4_prepare_v2()] or [sqlite4_prepare16_v2()] or one of the legacy |
| 2059 | ** interfaces [sqlite4_prepare()] or [sqlite4_prepare16()], this function |
| 2060 | ** must be called one or more times to evaluate the statement. |
| 2061 | ** |
| 2062 | ** The details of the behavior of the sqlite4_step() interface depend |
| 2063 | ** on whether the statement was prepared using the newer "v2" interface |
| 2064 | ** [sqlite4_prepare_v2()] and [sqlite4_prepare16_v2()] or the older legacy |
| 2065 | ** interface [sqlite4_prepare()] and [sqlite4_prepare16()]. The use of the |
| 2066 | ** new "v2" interface is recommended for new applications but the legacy |
| 2067 | ** interface will continue to be supported. |
| 2068 | ** |
| 2069 | ** ^In the legacy interface, the return value will be either [SQLITE_BUSY], |
| 2070 | ** [SQLITE_DONE], [SQLITE_ROW], [SQLITE_ERROR], or [SQLITE_MISUSE]. |
| 2071 | ** ^With the "v2" interface, any of the other [result codes] or |
| 2072 | ** [extended result codes] might be returned as well. |
| 2073 | ** |
| 2074 | ** ^[SQLITE_BUSY] means that the database engine was unable to acquire the |
| 2075 | ** database locks it needs to do its job. ^If the statement is a [COMMIT] |
| 2076 | ** or occurs outside of an explicit transaction, then you can retry the |
| 2077 | ** statement. If the statement is not a [COMMIT] and occurs within an |
| @@ -2089,46 +2078,17 @@ | |
| 2089 | ** sqlite4_step() is called again to retrieve the next row of data. |
| 2090 | ** |
| 2091 | ** ^[SQLITE_ERROR] means that a run-time error (such as a constraint |
| 2092 | ** violation) has occurred. sqlite4_step() should not be called again on |
| 2093 | ** the VM. More information may be found by calling [sqlite4_errmsg()]. |
| 2094 | ** ^With the legacy interface, a more specific error code (for example, |
| 2095 | ** [SQLITE_INTERRUPT], [SQLITE_SCHEMA], [SQLITE_CORRUPT], and so forth) |
| 2096 | ** can be obtained by calling [sqlite4_reset()] on the |
| 2097 | ** [prepared statement]. ^In the "v2" interface, |
| 2098 | ** the more specific error code is returned directly by sqlite4_step(). |
| 2099 | ** |
| 2100 | ** [SQLITE_MISUSE] means that the this routine was called inappropriately. |
| 2101 | ** Perhaps it was called on a [prepared statement] that has |
| 2102 | ** already been [sqlite4_finalize | finalized] or on one that had |
| 2103 | ** previously returned [SQLITE_ERROR] or [SQLITE_DONE]. Or it could |
| 2104 | ** be the case that the same database connection is being used by two or |
| 2105 | ** more threads at the same moment in time. |
| 2106 | ** |
| 2107 | ** For all versions of SQLite up to and including 3.6.23.1, a call to |
| 2108 | ** [sqlite4_reset()] was required after sqlite4_step() returned anything |
| 2109 | ** other than [SQLITE_ROW] before any subsequent invocation of |
| 2110 | ** sqlite4_step(). Failure to reset the prepared statement using |
| 2111 | ** [sqlite4_reset()] would result in an [SQLITE_MISUSE] return from |
| 2112 | ** sqlite4_step(). But after version 3.6.23.1, sqlite4_step() began |
| 2113 | ** calling [sqlite4_reset()] automatically in this circumstance rather |
| 2114 | ** than returning [SQLITE_MISUSE]. This is not considered a compatibility |
| 2115 | ** break because any application that ever receives an SQLITE_MISUSE error |
| 2116 | ** is broken by definition. The [SQLITE_OMIT_AUTORESET] compile-time option |
| 2117 | ** can be used to restore the legacy behavior. |
| 2118 | ** |
| 2119 | ** <b>Goofy Interface Alert:</b> In the legacy interface, the sqlite4_step() |
| 2120 | ** API always returns a generic error code, [SQLITE_ERROR], following any |
| 2121 | ** error other than [SQLITE_BUSY] and [SQLITE_MISUSE]. You must call |
| 2122 | ** [sqlite4_reset()] or [sqlite4_finalize()] in order to find one of the |
| 2123 | ** specific [error codes] that better describes the error. |
| 2124 | ** We admit that this is a goofy design. The problem has been fixed |
| 2125 | ** with the "v2" interface. If you prepare all of your SQL statements |
| 2126 | ** using either [sqlite4_prepare_v2()] or [sqlite4_prepare16_v2()] instead |
| 2127 | ** of the legacy [sqlite4_prepare()] and [sqlite4_prepare16()] interfaces, |
| 2128 | ** then the more specific [error codes] are returned directly |
| 2129 | ** by sqlite4_step(). The use of the "v2" interface is recommended. |
| 2130 | */ |
| 2131 | SQLITE_API int sqlite4_step(sqlite4_stmt*); |
| 2132 | |
| 2133 | /* |
| 2134 | ** CAPIREF: Number of columns in a result set |
| @@ -2179,11 +2139,11 @@ | |
| 2179 | ** These routines form the "result set" interface. |
| 2180 | ** |
| 2181 | ** ^These routines return information about a single column of the current |
| 2182 | ** result row of a query. ^In every case the first argument is a pointer |
| 2183 | ** to the [prepared statement] that is being evaluated (the [sqlite4_stmt*] |
| 2184 | ** that was returned from [sqlite4_prepare_v2()] or one of its variants) |
| 2185 | ** and the second argument is the index of the column for which information |
| 2186 | ** should be returned. ^The leftmost column of the result set has the index 0. |
| 2187 | ** ^The number of columns in the result can be determined using |
| 2188 | ** [sqlite4_column_count()]. |
| 2189 | ** |
| @@ -3037,11 +2997,11 @@ | |
| 3037 | ** |
| 3038 | ** ^The sqlite4_db_handle interface returns the [database connection] handle |
| 3039 | ** to which a [prepared statement] belongs. ^The [database connection] |
| 3040 | ** returned by sqlite4_db_handle is the same [database connection] |
| 3041 | ** that was the first argument |
| 3042 | ** to the [sqlite4_prepare_v2()] call (or its variants) that was used to |
| 3043 | ** create the statement in the first place. |
| 3044 | */ |
| 3045 | SQLITE_API sqlite4 *sqlite4_db_handle(sqlite4_stmt*); |
| 3046 | |
| 3047 | /* |
| 3048 |
| --- src/sqlite4.h | |
| +++ src/sqlite4.h | |
| @@ -158,11 +158,11 @@ | |
| 158 | ** [sqlite4_libversion_number()], [sqlite4_sourceid()], |
| 159 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 160 | */ |
| 161 | #define SQLITE_VERSION "4.0.0" |
| 162 | #define SQLITE_VERSION_NUMBER 4000000 |
| 163 | #define SQLITE_SOURCE_ID "2012-06-27 13:56:22 bd2216554bbcf5eee88dc17d0d6ae165a7eddbe4" |
| 164 | |
| 165 | /* |
| 166 | ** CAPIREF: Run-Time Library Version Numbers |
| 167 | ** KEYWORDS: sqlite4_version, sqlite4_sourceid |
| 168 | ** |
| @@ -251,11 +251,11 @@ | |
| 251 | ** Each open SQLite database is represented by a pointer to an instance of |
| 252 | ** the opaque structure named "sqlite4". It is useful to think of an sqlite4 |
| 253 | ** pointer as an object. The [sqlite4_open()] |
| 254 | ** interface is its constructors, and [sqlite4_close()] |
| 255 | ** is its destructor. There are many other interfaces (such as |
| 256 | ** [sqlite4_prepare], [sqlite4_create_function()], and |
| 257 | ** [sqlite4_busy_timeout()] to name but three) that are methods on an |
| 258 | ** sqlite4 object. |
| 259 | */ |
| 260 | typedef struct sqlite4 sqlite4; |
| 261 | |
| @@ -338,11 +338,11 @@ | |
| 338 | |
| 339 | /* |
| 340 | ** CAPIREF: One-Step Query Execution Interface |
| 341 | ** |
| 342 | ** The sqlite4_exec() interface is a convenience wrapper around |
| 343 | ** [sqlite4_prepare()], [sqlite4_step()], and [sqlite4_finalize()], |
| 344 | ** that allows an application to run multiple statements of SQL |
| 345 | ** without having to use a lot of C code. |
| 346 | ** |
| 347 | ** ^The sqlite4_exec() interface runs zero or more UTF-8 encoded, |
| 348 | ** semicolon-separate SQL statements passed into its 2nd argument, |
| @@ -1150,26 +1150,26 @@ | |
| 1150 | ** CAPIREF: Compile-Time Authorization Callbacks |
| 1151 | ** |
| 1152 | ** ^This routine registers an authorizer callback with a particular |
| 1153 | ** [database connection], supplied in the first argument. |
| 1154 | ** ^The authorizer callback is invoked as SQL statements are being compiled |
| 1155 | ** by [sqlite4_prepare()] or its variants [sqlite4_prepare()], |
| 1156 | ** [sqlite4_prepare16()] and [sqlite4_prepare16_v2()]. ^At various |
| 1157 | ** points during the compilation process, as logic is being created |
| 1158 | ** to perform various actions, the authorizer callback is invoked to |
| 1159 | ** see if those actions are allowed. ^The authorizer callback should |
| 1160 | ** return [SQLITE_OK] to allow the action, [SQLITE_IGNORE] to disallow the |
| 1161 | ** specific action but allow the SQL statement to continue to be |
| 1162 | ** compiled, or [SQLITE_DENY] to cause the entire SQL statement to be |
| 1163 | ** rejected with an error. ^If the authorizer callback returns |
| 1164 | ** any value other than [SQLITE_IGNORE], [SQLITE_OK], or [SQLITE_DENY] |
| 1165 | ** then the [sqlite4_prepare()] or equivalent call that triggered |
| 1166 | ** the authorizer will fail with an error message. |
| 1167 | ** |
| 1168 | ** When the callback returns [SQLITE_OK], that means the operation |
| 1169 | ** requested is ok. ^When the callback returns [SQLITE_DENY], the |
| 1170 | ** [sqlite4_prepare()] or equivalent call that triggered the |
| 1171 | ** authorizer will fail with an error message explaining that |
| 1172 | ** access is denied. |
| 1173 | ** |
| 1174 | ** ^The first parameter to the authorizer callback is a copy of the third |
| 1175 | ** parameter to the sqlite4_set_authorizer() interface. ^The second parameter |
| @@ -1210,23 +1210,23 @@ | |
| 1210 | ** previous call.)^ ^Disable the authorizer by installing a NULL callback. |
| 1211 | ** The authorizer is disabled by default. |
| 1212 | ** |
| 1213 | ** The authorizer callback must not do anything that will modify |
| 1214 | ** the database connection that invoked the authorizer callback. |
| 1215 | ** Note that [sqlite4_prepare()] and [sqlite4_step()] both modify their |
| 1216 | ** database connections for the meaning of "modify" in this paragraph. |
| 1217 | ** |
| 1218 | ** ^When [sqlite4_prepare()] is used to prepare a statement, the |
| 1219 | ** statement might be re-prepared during [sqlite4_step()] due to a |
| 1220 | ** schema change. Hence, the application should ensure that the |
| 1221 | ** correct authorizer callback remains in place during the [sqlite4_step()]. |
| 1222 | ** |
| 1223 | ** ^Note that the authorizer callback is invoked only during |
| 1224 | ** [sqlite4_prepare()] or its variants. Authorization is not |
| 1225 | ** performed during statement evaluation in [sqlite4_step()], unless |
| 1226 | ** as stated in the previous paragraph, sqlite4_step() invokes |
| 1227 | ** sqlite4_prepare() to reprepare a statement after a schema change. |
| 1228 | */ |
| 1229 | SQLITE_API int sqlite4_set_authorizer( |
| 1230 | sqlite4*, |
| 1231 | int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), |
| 1232 | void *pUserData |
| @@ -1354,11 +1354,11 @@ | |
| 1354 | ** interrupted. This feature can be used to implement a |
| 1355 | ** "Cancel" button on a GUI progress dialog box. |
| 1356 | ** |
| 1357 | ** The progress handler callback must not do anything that will modify |
| 1358 | ** the database connection that invoked the progress handler. |
| 1359 | ** Note that [sqlite4_prepare()] and [sqlite4_step()] both modify their |
| 1360 | ** database connections for the meaning of "modify" in this paragraph. |
| 1361 | ** |
| 1362 | */ |
| 1363 | SQLITE_API void sqlite4_progress_handler(sqlite4*, int, int(*)(void*), void*); |
| 1364 | |
| @@ -1471,11 +1471,11 @@ | |
| 1471 | ** "compiled SQL statement" or simply as a "statement". |
| 1472 | ** |
| 1473 | ** The life of a statement object goes something like this: |
| 1474 | ** |
| 1475 | ** <ol> |
| 1476 | ** <li> Create the object using [sqlite4_prepare()] or a related |
| 1477 | ** function. |
| 1478 | ** <li> Bind values to [host parameters] using the sqlite4_bind_*() |
| 1479 | ** interfaces. |
| 1480 | ** <li> Run the SQL by calling [sqlite4_step()] one or more times. |
| 1481 | ** <li> Reset the statement using [sqlite4_reset()] then go back |
| @@ -1603,13 +1603,13 @@ | |
| 1603 | ** The first argument, "db", is a [database connection] obtained from a |
| 1604 | ** prior successful call to [sqlite4_open()]. |
| 1605 | ** The database connection must not have been closed. |
| 1606 | ** |
| 1607 | ** The second argument, "zSql", is the statement to be compiled, encoded |
| 1608 | ** as either UTF-8 or UTF-16. The sqlite4_prepare() |
| 1609 | ** interface uses UTF-8, and sqlite4_prepare16() |
| 1610 | ** uses UTF-16. |
| 1611 | ** |
| 1612 | ** ^If the nByte argument is less than zero, then zSql is read up to the |
| 1613 | ** first zero terminator. ^If nByte is non-negative, then it is the maximum |
| 1614 | ** number of bytes read from zSql. ^When nByte is non-negative, the |
| 1615 | ** zSql string ends at either the first '\000' or '\u0000' character or |
| @@ -1647,11 +1647,11 @@ | |
| 1647 | /* |
| 1648 | ** CAPIREF: Retrieving Statement SQL |
| 1649 | ** |
| 1650 | ** ^This interface can be used to retrieve a saved copy of the original |
| 1651 | ** SQL text used to create a [prepared statement] if that statement was |
| 1652 | ** compiled using either [sqlite4_prepare()] or [sqlite4_prepare16_v2()]. |
| 1653 | */ |
| 1654 | SQLITE_API const char *sqlite4_sql(sqlite4_stmt *pStmt); |
| 1655 | |
| 1656 | /* |
| 1657 | ** CAPIREF: Determine If An SQL Statement Writes The Database |
| @@ -1759,11 +1759,11 @@ | |
| 1759 | /* |
| 1760 | ** CAPIREF: Binding Values To Prepared Statements |
| 1761 | ** KEYWORDS: {host parameter} {host parameters} {host parameter name} |
| 1762 | ** KEYWORDS: {SQL parameter} {SQL parameters} {parameter binding} |
| 1763 | ** |
| 1764 | ** ^(In the SQL statement text input to [sqlite4_prepare()] and its variants, |
| 1765 | ** literals may be replaced by a [parameter] that matches one of following |
| 1766 | ** templates: |
| 1767 | ** |
| 1768 | ** <ul> |
| 1769 | ** <li> ? |
| @@ -1778,11 +1778,11 @@ | |
| 1778 | ** parameters (also called "host parameter names" or "SQL parameters") |
| 1779 | ** can be set using the sqlite4_bind_*() routines defined here. |
| 1780 | ** |
| 1781 | ** ^The first argument to the sqlite4_bind_*() routines is always |
| 1782 | ** a pointer to the [sqlite4_stmt] object returned from |
| 1783 | ** [sqlite4_prepare()] or its variants. |
| 1784 | ** |
| 1785 | ** ^The second argument is the index of the SQL parameter to be set. |
| 1786 | ** ^The leftmost SQL parameter has an index of 1. ^When the same named |
| 1787 | ** SQL parameter is used more than once, second and subsequent |
| 1788 | ** occurrences have the same index as the first occurrence. |
| @@ -2052,26 +2052,15 @@ | |
| 2052 | SQLITE_API const void *sqlite4_column_decltype16(sqlite4_stmt*,int); |
| 2053 | |
| 2054 | /* |
| 2055 | ** CAPIREF: Evaluate An SQL Statement |
| 2056 | ** |
| 2057 | ** After a [prepared statement] has been prepared using [sqlite4_prepare()], |
| 2058 | ** this function must be called one or more times to evaluate the statement. |
| 2059 | ** |
| 2060 | ** ^This routine can return any of the other [result codes] or |
| 2061 | ** [extended result codes]. |
| 2062 | ** |
| 2063 | ** ^[SQLITE_BUSY] means that the database engine was unable to acquire the |
| 2064 | ** database locks it needs to do its job. ^If the statement is a [COMMIT] |
| 2065 | ** or occurs outside of an explicit transaction, then you can retry the |
| 2066 | ** statement. If the statement is not a [COMMIT] and occurs within an |
| @@ -2089,46 +2078,17 @@ | |
| 2078 | ** sqlite4_step() is called again to retrieve the next row of data. |
| 2079 | ** |
| 2080 | ** ^[SQLITE_ERROR] means that a run-time error (such as a constraint |
| 2081 | ** violation) has occurred. sqlite4_step() should not be called again on |
| 2082 | ** the VM. More information may be found by calling [sqlite4_errmsg()]. |
| 2083 | ** |
| 2084 | ** [SQLITE_MISUSE] means that the this routine was called inappropriately. |
| 2085 | ** Perhaps it was called on a [prepared statement] that has |
| 2086 | ** already been [sqlite4_finalize | finalized] or on one that had |
| 2087 | ** previously returned [SQLITE_ERROR] or [SQLITE_DONE]. Or it could |
| 2088 | ** be the case that the same database connection is being used by two or |
| 2089 | ** more threads at the same moment in time. |
| 2090 | */ |
| 2091 | SQLITE_API int sqlite4_step(sqlite4_stmt*); |
| 2092 | |
| 2093 | /* |
| 2094 | ** CAPIREF: Number of columns in a result set |
| @@ -2179,11 +2139,11 @@ | |
| 2139 | ** These routines form the "result set" interface. |
| 2140 | ** |
| 2141 | ** ^These routines return information about a single column of the current |
| 2142 | ** result row of a query. ^In every case the first argument is a pointer |
| 2143 | ** to the [prepared statement] that is being evaluated (the [sqlite4_stmt*] |
| 2144 | ** that was returned from [sqlite4_prepare()]. |
| 2145 | ** and the second argument is the index of the column for which information |
| 2146 | ** should be returned. ^The leftmost column of the result set has the index 0. |
| 2147 | ** ^The number of columns in the result can be determined using |
| 2148 | ** [sqlite4_column_count()]. |
| 2149 | ** |
| @@ -3037,11 +2997,11 @@ | |
| 2997 | ** |
| 2998 | ** ^The sqlite4_db_handle interface returns the [database connection] handle |
| 2999 | ** to which a [prepared statement] belongs. ^The [database connection] |
| 3000 | ** returned by sqlite4_db_handle is the same [database connection] |
| 3001 | ** that was the first argument |
| 3002 | ** to the [sqlite4_prepare()] call (or its variants) that was used to |
| 3003 | ** create the statement in the first place. |
| 3004 | */ |
| 3005 | SQLITE_API sqlite4 *sqlite4_db_handle(sqlite4_stmt*); |
| 3006 | |
| 3007 | /* |
| 3008 |
+3
-2
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -90,12 +90,13 @@ | ||
| 90 | 90 | db_begin_transaction(); |
| 91 | 91 | p = manifest_get(vid, CFTYPE_MANIFEST); |
| 92 | 92 | if( p==0 ) return; |
| 93 | 93 | db_multi_exec("DELETE FROM vfile WHERE vid=%d", vid); |
| 94 | 94 | db_prepare(&ins, |
| 95 | - "INSERT INTO vfile(vid,isexe,islink,rid,mrid,pathname) " | |
| 96 | - " VALUES(:vid,:isexe,:islink,:id,:id,:name)"); | |
| 95 | + "INSERT INTO vfile(id,vid,isexe,islink,rid,mrid,pathname) " | |
| 96 | + " VALUES(1+(SELECT coalesce(max(id),0) FROM vfile)," | |
| 97 | + ":vid,:isexe,:islink,:id,:id,:name)"); | |
| 97 | 98 | db_prepare(&ridq, "SELECT rid,size FROM blob WHERE uuid=:uuid"); |
| 98 | 99 | db_bind_int(&ins, ":vid", vid); |
| 99 | 100 | manifest_file_rewind(p); |
| 100 | 101 | while( (pFile = manifest_file_next(p,0))!=0 ){ |
| 101 | 102 | if( pFile->zUuid==0 || uuid_is_shunned(pFile->zUuid) ) continue; |
| 102 | 103 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -90,12 +90,13 @@ | |
| 90 | db_begin_transaction(); |
| 91 | p = manifest_get(vid, CFTYPE_MANIFEST); |
| 92 | if( p==0 ) return; |
| 93 | db_multi_exec("DELETE FROM vfile WHERE vid=%d", vid); |
| 94 | db_prepare(&ins, |
| 95 | "INSERT INTO vfile(vid,isexe,islink,rid,mrid,pathname) " |
| 96 | " VALUES(:vid,:isexe,:islink,:id,:id,:name)"); |
| 97 | db_prepare(&ridq, "SELECT rid,size FROM blob WHERE uuid=:uuid"); |
| 98 | db_bind_int(&ins, ":vid", vid); |
| 99 | manifest_file_rewind(p); |
| 100 | while( (pFile = manifest_file_next(p,0))!=0 ){ |
| 101 | if( pFile->zUuid==0 || uuid_is_shunned(pFile->zUuid) ) continue; |
| 102 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -90,12 +90,13 @@ | |
| 90 | db_begin_transaction(); |
| 91 | p = manifest_get(vid, CFTYPE_MANIFEST); |
| 92 | if( p==0 ) return; |
| 93 | db_multi_exec("DELETE FROM vfile WHERE vid=%d", vid); |
| 94 | db_prepare(&ins, |
| 95 | "INSERT INTO vfile(id,vid,isexe,islink,rid,mrid,pathname) " |
| 96 | " VALUES(1+(SELECT coalesce(max(id),0) FROM vfile)," |
| 97 | ":vid,:isexe,:islink,:id,:id,:name)"); |
| 98 | db_prepare(&ridq, "SELECT rid,size FROM blob WHERE uuid=:uuid"); |
| 99 | db_bind_int(&ins, ":vid", vid); |
| 100 | manifest_file_rewind(p); |
| 101 | while( (pFile = manifest_file_next(p,0))!=0 ){ |
| 102 | if( pFile->zUuid==0 || uuid_is_shunned(pFile->zUuid) ) continue; |
| 103 |