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.

drh 2012-06-27 13:59 sqlite4
Commit 3f624d490b0696b85301eb7f618203bd03942625
4 files changed +2 -2 +25 -65 +24 -64 +3 -2
+2 -2
--- src/db.c
+++ src/db.c
@@ -763,13 +763,13 @@
763763
}
764764
#endif
765765
g.zHome = mprintf("%/", zHome);
766766
#if defined(_WIN32)
767767
/* . filenames give some window systems problems and many apps problems */
768
- zDbName = mprintf("%//_fossil", zHome);
768
+ zDbName = mprintf("%//_fossil4", zHome);
769769
#else
770
- zDbName = mprintf("%s/.fossil", zHome);
770
+ zDbName = mprintf("%s/.fossil4", zHome);
771771
#endif
772772
if( file_size(zDbName)<1024*3 ){
773773
db_init_database(zDbName, zConfigSchema, (char*)0);
774774
}
775775
g.useAttach = useAttach;
776776
--- 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 @@
714714
** [sqlite4_libversion_number()], [sqlite4_sourceid()],
715715
** [sqlite_version()] and [sqlite_source_id()].
716716
*/
717717
#define SQLITE_VERSION "4.0.0"
718718
#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"
720720
721721
/*
722722
** CAPIREF: Run-Time Library Version Numbers
723723
** KEYWORDS: sqlite4_version, sqlite4_sourceid
724724
**
@@ -807,11 +807,11 @@
807807
** Each open SQLite database is represented by a pointer to an instance of
808808
** the opaque structure named "sqlite4". It is useful to think of an sqlite4
809809
** pointer as an object. The [sqlite4_open()]
810810
** interface is its constructors, and [sqlite4_close()]
811811
** 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
813813
** [sqlite4_busy_timeout()] to name but three) that are methods on an
814814
** sqlite4 object.
815815
*/
816816
typedef struct sqlite4 sqlite4;
817817
@@ -894,11 +894,11 @@
894894
895895
/*
896896
** CAPIREF: One-Step Query Execution Interface
897897
**
898898
** 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()],
900900
** that allows an application to run multiple statements of SQL
901901
** without having to use a lot of C code.
902902
**
903903
** ^The sqlite4_exec() interface runs zero or more UTF-8 encoded,
904904
** semicolon-separate SQL statements passed into its 2nd argument,
@@ -1706,26 +1706,26 @@
17061706
** CAPIREF: Compile-Time Authorization Callbacks
17071707
**
17081708
** ^This routine registers an authorizer callback with a particular
17091709
** [database connection], supplied in the first argument.
17101710
** ^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()],
17121712
** [sqlite4_prepare16()] and [sqlite4_prepare16_v2()]. ^At various
17131713
** points during the compilation process, as logic is being created
17141714
** to perform various actions, the authorizer callback is invoked to
17151715
** see if those actions are allowed. ^The authorizer callback should
17161716
** return [SQLITE_OK] to allow the action, [SQLITE_IGNORE] to disallow the
17171717
** specific action but allow the SQL statement to continue to be
17181718
** compiled, or [SQLITE_DENY] to cause the entire SQL statement to be
17191719
** rejected with an error. ^If the authorizer callback returns
17201720
** 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
17221722
** the authorizer will fail with an error message.
17231723
**
17241724
** When the callback returns [SQLITE_OK], that means the operation
17251725
** 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
17271727
** authorizer will fail with an error message explaining that
17281728
** access is denied.
17291729
**
17301730
** ^The first parameter to the authorizer callback is a copy of the third
17311731
** parameter to the sqlite4_set_authorizer() interface. ^The second parameter
@@ -1766,23 +1766,23 @@
17661766
** previous call.)^ ^Disable the authorizer by installing a NULL callback.
17671767
** The authorizer is disabled by default.
17681768
**
17691769
** The authorizer callback must not do anything that will modify
17701770
** 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
17721772
** database connections for the meaning of "modify" in this paragraph.
17731773
**
1774
-** ^When [sqlite4_prepare_v2()] is used to prepare a statement, the
1774
+** ^When [sqlite4_prepare()] is used to prepare a statement, the
17751775
** statement might be re-prepared during [sqlite4_step()] due to a
17761776
** schema change. Hence, the application should ensure that the
17771777
** correct authorizer callback remains in place during the [sqlite4_step()].
17781778
**
17791779
** ^Note that the authorizer callback is invoked only during
17801780
** [sqlite4_prepare()] or its variants. Authorization is not
17811781
** performed during statement evaluation in [sqlite4_step()], unless
17821782
** 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.
17841784
*/
17851785
SQLITE_API int sqlite4_set_authorizer(
17861786
sqlite4*,
17871787
int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
17881788
void *pUserData
@@ -1910,11 +1910,11 @@
19101910
** interrupted. This feature can be used to implement a
19111911
** "Cancel" button on a GUI progress dialog box.
19121912
**
19131913
** The progress handler callback must not do anything that will modify
19141914
** 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
19161916
** database connections for the meaning of "modify" in this paragraph.
19171917
**
19181918
*/
19191919
SQLITE_API void sqlite4_progress_handler(sqlite4*, int, int(*)(void*), void*);
19201920
@@ -2027,11 +2027,11 @@
20272027
** "compiled SQL statement" or simply as a "statement".
20282028
**
20292029
** The life of a statement object goes something like this:
20302030
**
20312031
** <ol>
2032
-** <li> Create the object using [sqlite4_prepare_v2()] or a related
2032
+** <li> Create the object using [sqlite4_prepare()] or a related
20332033
** function.
20342034
** <li> Bind values to [host parameters] using the sqlite4_bind_*()
20352035
** interfaces.
20362036
** <li> Run the SQL by calling [sqlite4_step()] one or more times.
20372037
** <li> Reset the statement using [sqlite4_reset()] then go back
@@ -2159,13 +2159,13 @@
21592159
** The first argument, "db", is a [database connection] obtained from a
21602160
** prior successful call to [sqlite4_open()].
21612161
** The database connection must not have been closed.
21622162
**
21632163
** 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.
21672167
**
21682168
** ^If the nByte argument is less than zero, then zSql is read up to the
21692169
** first zero terminator. ^If nByte is non-negative, then it is the maximum
21702170
** number of bytes read from zSql. ^When nByte is non-negative, the
21712171
** zSql string ends at either the first '\000' or '\u0000' character or
@@ -2203,11 +2203,11 @@
22032203
/*
22042204
** CAPIREF: Retrieving Statement SQL
22052205
**
22062206
** ^This interface can be used to retrieve a saved copy of the original
22072207
** 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()].
22092209
*/
22102210
SQLITE_API const char *sqlite4_sql(sqlite4_stmt *pStmt);
22112211
22122212
/*
22132213
** CAPIREF: Determine If An SQL Statement Writes The Database
@@ -2315,11 +2315,11 @@
23152315
/*
23162316
** CAPIREF: Binding Values To Prepared Statements
23172317
** KEYWORDS: {host parameter} {host parameters} {host parameter name}
23182318
** KEYWORDS: {SQL parameter} {SQL parameters} {parameter binding}
23192319
**
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,
23212321
** literals may be replaced by a [parameter] that matches one of following
23222322
** templates:
23232323
**
23242324
** <ul>
23252325
** <li> ?
@@ -2334,11 +2334,11 @@
23342334
** parameters (also called "host parameter names" or "SQL parameters")
23352335
** can be set using the sqlite4_bind_*() routines defined here.
23362336
**
23372337
** ^The first argument to the sqlite4_bind_*() routines is always
23382338
** a pointer to the [sqlite4_stmt] object returned from
2339
-** [sqlite4_prepare_v2()] or its variants.
2339
+** [sqlite4_prepare()] or its variants.
23402340
**
23412341
** ^The second argument is the index of the SQL parameter to be set.
23422342
** ^The leftmost SQL parameter has an index of 1. ^When the same named
23432343
** SQL parameter is used more than once, second and subsequent
23442344
** occurrences have the same index as the first occurrence.
@@ -2608,26 +2608,15 @@
26082608
SQLITE_API const void *sqlite4_column_decltype16(sqlite4_stmt*,int);
26092609
26102610
/*
26112611
** CAPIREF: Evaluate An SQL Statement
26122612
**
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].
26292618
**
26302619
** ^[SQLITE_BUSY] means that the database engine was unable to acquire the
26312620
** database locks it needs to do its job. ^If the statement is a [COMMIT]
26322621
** or occurs outside of an explicit transaction, then you can retry the
26332622
** statement. If the statement is not a [COMMIT] and occurs within an
@@ -2645,46 +2634,17 @@
26452634
** sqlite4_step() is called again to retrieve the next row of data.
26462635
**
26472636
** ^[SQLITE_ERROR] means that a run-time error (such as a constraint
26482637
** violation) has occurred. sqlite4_step() should not be called again on
26492638
** 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().
26552639
**
26562640
** [SQLITE_MISUSE] means that the this routine was called inappropriately.
26572641
** Perhaps it was called on a [prepared statement] that has
26582642
** already been [sqlite4_finalize | finalized] or on one that had
26592643
** previously returned [SQLITE_ERROR] or [SQLITE_DONE]. Or it could
26602644
** be the case that the same database connection is being used by two or
26612645
** 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.
26862646
*/
26872647
SQLITE_API int sqlite4_step(sqlite4_stmt*);
26882648
26892649
/*
26902650
** CAPIREF: Number of columns in a result set
@@ -2735,11 +2695,11 @@
27352695
** These routines form the "result set" interface.
27362696
**
27372697
** ^These routines return information about a single column of the current
27382698
** result row of a query. ^In every case the first argument is a pointer
27392699
** 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()].
27412701
** and the second argument is the index of the column for which information
27422702
** should be returned. ^The leftmost column of the result set has the index 0.
27432703
** ^The number of columns in the result can be determined using
27442704
** [sqlite4_column_count()].
27452705
**
@@ -3593,11 +3553,11 @@
35933553
**
35943554
** ^The sqlite4_db_handle interface returns the [database connection] handle
35953555
** to which a [prepared statement] belongs. ^The [database connection]
35963556
** returned by sqlite4_db_handle is the same [database connection]
35973557
** 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
35993559
** create the statement in the first place.
36003560
*/
36013561
SQLITE_API sqlite4 *sqlite4_db_handle(sqlite4_stmt*);
36023562
36033563
/*
@@ -65153,11 +65113,11 @@
6515365113
azColName[i], SQLITE_STATIC);
6515465114
}
6515565115
}
6515665116
#endif
6515765117
65158
- if( db->init.busy==0 ){
65118
+ if( /*db->init.busy==0*/ 1 ){
6515965119
Vdbe *pVdbe = pParse->pVdbe;
6516065120
sqlite4VdbeSetSql(pVdbe, zSql, (int)(pParse->zTail-zSql));
6516165121
}
6516265122
if( pParse->pVdbe && (rc!=SQLITE_OK || db->mallocFailed) ){
6516365123
sqlite4VdbeFinalize(pParse->pVdbe);
6516465124
--- 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 @@
158158
** [sqlite4_libversion_number()], [sqlite4_sourceid()],
159159
** [sqlite_version()] and [sqlite_source_id()].
160160
*/
161161
#define SQLITE_VERSION "4.0.0"
162162
#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"
164164
165165
/*
166166
** CAPIREF: Run-Time Library Version Numbers
167167
** KEYWORDS: sqlite4_version, sqlite4_sourceid
168168
**
@@ -251,11 +251,11 @@
251251
** Each open SQLite database is represented by a pointer to an instance of
252252
** the opaque structure named "sqlite4". It is useful to think of an sqlite4
253253
** pointer as an object. The [sqlite4_open()]
254254
** interface is its constructors, and [sqlite4_close()]
255255
** 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
257257
** [sqlite4_busy_timeout()] to name but three) that are methods on an
258258
** sqlite4 object.
259259
*/
260260
typedef struct sqlite4 sqlite4;
261261
@@ -338,11 +338,11 @@
338338
339339
/*
340340
** CAPIREF: One-Step Query Execution Interface
341341
**
342342
** 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()],
344344
** that allows an application to run multiple statements of SQL
345345
** without having to use a lot of C code.
346346
**
347347
** ^The sqlite4_exec() interface runs zero or more UTF-8 encoded,
348348
** semicolon-separate SQL statements passed into its 2nd argument,
@@ -1150,26 +1150,26 @@
11501150
** CAPIREF: Compile-Time Authorization Callbacks
11511151
**
11521152
** ^This routine registers an authorizer callback with a particular
11531153
** [database connection], supplied in the first argument.
11541154
** ^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()],
11561156
** [sqlite4_prepare16()] and [sqlite4_prepare16_v2()]. ^At various
11571157
** points during the compilation process, as logic is being created
11581158
** to perform various actions, the authorizer callback is invoked to
11591159
** see if those actions are allowed. ^The authorizer callback should
11601160
** return [SQLITE_OK] to allow the action, [SQLITE_IGNORE] to disallow the
11611161
** specific action but allow the SQL statement to continue to be
11621162
** compiled, or [SQLITE_DENY] to cause the entire SQL statement to be
11631163
** rejected with an error. ^If the authorizer callback returns
11641164
** 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
11661166
** the authorizer will fail with an error message.
11671167
**
11681168
** When the callback returns [SQLITE_OK], that means the operation
11691169
** 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
11711171
** authorizer will fail with an error message explaining that
11721172
** access is denied.
11731173
**
11741174
** ^The first parameter to the authorizer callback is a copy of the third
11751175
** parameter to the sqlite4_set_authorizer() interface. ^The second parameter
@@ -1210,23 +1210,23 @@
12101210
** previous call.)^ ^Disable the authorizer by installing a NULL callback.
12111211
** The authorizer is disabled by default.
12121212
**
12131213
** The authorizer callback must not do anything that will modify
12141214
** 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
12161216
** database connections for the meaning of "modify" in this paragraph.
12171217
**
1218
-** ^When [sqlite4_prepare_v2()] is used to prepare a statement, the
1218
+** ^When [sqlite4_prepare()] is used to prepare a statement, the
12191219
** statement might be re-prepared during [sqlite4_step()] due to a
12201220
** schema change. Hence, the application should ensure that the
12211221
** correct authorizer callback remains in place during the [sqlite4_step()].
12221222
**
12231223
** ^Note that the authorizer callback is invoked only during
12241224
** [sqlite4_prepare()] or its variants. Authorization is not
12251225
** performed during statement evaluation in [sqlite4_step()], unless
12261226
** 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.
12281228
*/
12291229
SQLITE_API int sqlite4_set_authorizer(
12301230
sqlite4*,
12311231
int (*xAuth)(void*,int,const char*,const char*,const char*,const char*),
12321232
void *pUserData
@@ -1354,11 +1354,11 @@
13541354
** interrupted. This feature can be used to implement a
13551355
** "Cancel" button on a GUI progress dialog box.
13561356
**
13571357
** The progress handler callback must not do anything that will modify
13581358
** 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
13601360
** database connections for the meaning of "modify" in this paragraph.
13611361
**
13621362
*/
13631363
SQLITE_API void sqlite4_progress_handler(sqlite4*, int, int(*)(void*), void*);
13641364
@@ -1471,11 +1471,11 @@
14711471
** "compiled SQL statement" or simply as a "statement".
14721472
**
14731473
** The life of a statement object goes something like this:
14741474
**
14751475
** <ol>
1476
-** <li> Create the object using [sqlite4_prepare_v2()] or a related
1476
+** <li> Create the object using [sqlite4_prepare()] or a related
14771477
** function.
14781478
** <li> Bind values to [host parameters] using the sqlite4_bind_*()
14791479
** interfaces.
14801480
** <li> Run the SQL by calling [sqlite4_step()] one or more times.
14811481
** <li> Reset the statement using [sqlite4_reset()] then go back
@@ -1603,13 +1603,13 @@
16031603
** The first argument, "db", is a [database connection] obtained from a
16041604
** prior successful call to [sqlite4_open()].
16051605
** The database connection must not have been closed.
16061606
**
16071607
** 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.
16111611
**
16121612
** ^If the nByte argument is less than zero, then zSql is read up to the
16131613
** first zero terminator. ^If nByte is non-negative, then it is the maximum
16141614
** number of bytes read from zSql. ^When nByte is non-negative, the
16151615
** zSql string ends at either the first '\000' or '\u0000' character or
@@ -1647,11 +1647,11 @@
16471647
/*
16481648
** CAPIREF: Retrieving Statement SQL
16491649
**
16501650
** ^This interface can be used to retrieve a saved copy of the original
16511651
** 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()].
16531653
*/
16541654
SQLITE_API const char *sqlite4_sql(sqlite4_stmt *pStmt);
16551655
16561656
/*
16571657
** CAPIREF: Determine If An SQL Statement Writes The Database
@@ -1759,11 +1759,11 @@
17591759
/*
17601760
** CAPIREF: Binding Values To Prepared Statements
17611761
** KEYWORDS: {host parameter} {host parameters} {host parameter name}
17621762
** KEYWORDS: {SQL parameter} {SQL parameters} {parameter binding}
17631763
**
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,
17651765
** literals may be replaced by a [parameter] that matches one of following
17661766
** templates:
17671767
**
17681768
** <ul>
17691769
** <li> ?
@@ -1778,11 +1778,11 @@
17781778
** parameters (also called "host parameter names" or "SQL parameters")
17791779
** can be set using the sqlite4_bind_*() routines defined here.
17801780
**
17811781
** ^The first argument to the sqlite4_bind_*() routines is always
17821782
** a pointer to the [sqlite4_stmt] object returned from
1783
-** [sqlite4_prepare_v2()] or its variants.
1783
+** [sqlite4_prepare()] or its variants.
17841784
**
17851785
** ^The second argument is the index of the SQL parameter to be set.
17861786
** ^The leftmost SQL parameter has an index of 1. ^When the same named
17871787
** SQL parameter is used more than once, second and subsequent
17881788
** occurrences have the same index as the first occurrence.
@@ -2052,26 +2052,15 @@
20522052
SQLITE_API const void *sqlite4_column_decltype16(sqlite4_stmt*,int);
20532053
20542054
/*
20552055
** CAPIREF: Evaluate An SQL Statement
20562056
**
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].
20732062
**
20742063
** ^[SQLITE_BUSY] means that the database engine was unable to acquire the
20752064
** database locks it needs to do its job. ^If the statement is a [COMMIT]
20762065
** or occurs outside of an explicit transaction, then you can retry the
20772066
** statement. If the statement is not a [COMMIT] and occurs within an
@@ -2089,46 +2078,17 @@
20892078
** sqlite4_step() is called again to retrieve the next row of data.
20902079
**
20912080
** ^[SQLITE_ERROR] means that a run-time error (such as a constraint
20922081
** violation) has occurred. sqlite4_step() should not be called again on
20932082
** 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().
20992083
**
21002084
** [SQLITE_MISUSE] means that the this routine was called inappropriately.
21012085
** Perhaps it was called on a [prepared statement] that has
21022086
** already been [sqlite4_finalize | finalized] or on one that had
21032087
** previously returned [SQLITE_ERROR] or [SQLITE_DONE]. Or it could
21042088
** be the case that the same database connection is being used by two or
21052089
** 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.
21302090
*/
21312091
SQLITE_API int sqlite4_step(sqlite4_stmt*);
21322092
21332093
/*
21342094
** CAPIREF: Number of columns in a result set
@@ -2179,11 +2139,11 @@
21792139
** These routines form the "result set" interface.
21802140
**
21812141
** ^These routines return information about a single column of the current
21822142
** result row of a query. ^In every case the first argument is a pointer
21832143
** 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()].
21852145
** and the second argument is the index of the column for which information
21862146
** should be returned. ^The leftmost column of the result set has the index 0.
21872147
** ^The number of columns in the result can be determined using
21882148
** [sqlite4_column_count()].
21892149
**
@@ -3037,11 +2997,11 @@
30372997
**
30382998
** ^The sqlite4_db_handle interface returns the [database connection] handle
30392999
** to which a [prepared statement] belongs. ^The [database connection]
30403000
** returned by sqlite4_db_handle is the same [database connection]
30413001
** 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
30433003
** create the statement in the first place.
30443004
*/
30453005
SQLITE_API sqlite4 *sqlite4_db_handle(sqlite4_stmt*);
30463006
30473007
/*
30483008
--- 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 @@
9090
db_begin_transaction();
9191
p = manifest_get(vid, CFTYPE_MANIFEST);
9292
if( p==0 ) return;
9393
db_multi_exec("DELETE FROM vfile WHERE vid=%d", vid);
9494
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)");
9798
db_prepare(&ridq, "SELECT rid,size FROM blob WHERE uuid=:uuid");
9899
db_bind_int(&ins, ":vid", vid);
99100
manifest_file_rewind(p);
100101
while( (pFile = manifest_file_next(p,0))!=0 ){
101102
if( pFile->zUuid==0 || uuid_is_shunned(pFile->zUuid) ) continue;
102103
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button