aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2016-07-23 02:07:26 +0000
committerdrh <drh@noemail.net>2016-07-23 02:07:26 +0000
commit557341e8fa72f03a35768a34c33cfb18645f95cd (patch)
tree4219e54766748a1717dee9b68af02d66bbbca327 /src
parentcf1e395acb41d886d72aa77d7e49f08ed1d36317 (diff)
downloadsqlite-557341e8fa72f03a35768a34c33cfb18645f95cd.tar.gz
sqlite-557341e8fa72f03a35768a34c33cfb18645f95cd.zip
Add requirements marks to the sqlite3_trace_v2() interface documentation.
FossilOrigin-Name: ebd388e94da4a2b29c2a546f832d359619803ec5
Diffstat (limited to 'src')
-rw-r--r--src/sqlite.h.in46
-rw-r--r--src/vdbeapi.c33
-rw-r--r--src/vdbeaux.c33
-rw-r--r--src/vdbetrace.c4
4 files changed, 58 insertions, 58 deletions
diff --git a/src/sqlite.h.in b/src/sqlite.h.in
index 5c4c373b8..1308a1122 100644
--- a/src/sqlite.h.in
+++ b/src/sqlite.h.in
@@ -2795,45 +2795,45 @@ SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*,
** These constants identify classes of events that can be monitored
** using the [sqlite3_trace_v2()] tracing logic. The third argument
** to [sqlite3_trace_v2()] is an OR-ed combination of one or more of
-** the following constants. The first argument to the trace callback
+** the following constants. ^The first argument to the trace callback
** is one of the following constants.
**
** New tracing constants may be added in future releases.
**
-** A trace callback has four arguments: xCallback(T,C,P,X).
-** The T argument is one of the integer type codes above.
-** The C argument is a copy of the context pointer passed in as the
+** ^A trace callback has four arguments: xCallback(T,C,P,X).
+** ^The T argument is one of the integer type codes above.
+** ^The C argument is a copy of the context pointer passed in as the
** fourth argument to [sqlite3_trace_v2()].
** The P and X arguments are pointers whose meanings depend on T.
**
** <dl>
** [[SQLITE_TRACE_STMT]] <dt>SQLITE_TRACE_STMT</dt>
-** <dd>An SQLITE_TRACE_STMT callback is invoked when a prepared statement
+** <dd>^An SQLITE_TRACE_STMT callback is invoked when a prepared statement
** first begins running and possibly at other times during the
** execution of the prepared statement, such as at the start of each
-** trigger subprogram. The P argument is a pointer to the
-** [prepared statement]. The X argument is a pointer to a string which
+** trigger subprogram. ^The P argument is a pointer to the
+** [prepared statement]. ^The X argument is a pointer to a string which
** is the expanded SQL text of the prepared statement or a comment that
** indicates the invocation of a trigger.
**
** [[SQLITE_TRACE_PROFILE]] <dt>SQLITE_TRACE_PROFILE</dt>
-** <dd>An SQLITE_TRACE_PROFILE callback provides approximately the same
+** <dd>^An SQLITE_TRACE_PROFILE callback provides approximately the same
** information as is provided by the [sqlite3_profile()] callback.
-** The P argument is a pointer to the [prepared statement] and the
-** X argument points to a 64-bit integer which is the estimated of
+** ^The P argument is a pointer to the [prepared statement] and the
+** ^X argument points to a 64-bit integer which is the estimated of
** the number of nanosecond that the prepared statement took to run.
-** The SQLITE_TRACE_PROFILE callback is invoked when the statement finishes.
+** ^The SQLITE_TRACE_PROFILE callback is invoked when the statement finishes.
**
** [[SQLITE_TRACE_ROW]] <dt>SQLITE_TRACE_ROW</dt>
-** <dd>An SQLITE_TRACE_ROW callback is invoked whenever a prepared
+** <dd>^An SQLITE_TRACE_ROW callback is invoked whenever a prepared
** statement generates a single row of result.
-** The P argument is a pointer to the [prepared statement] and the
+** ^The P argument is a pointer to the [prepared statement] and the
** X argument is unused.
**
** [[SQLITE_TRACE_CLOSE]] <dt>SQLITE_TRACE_CLOSE</dt>
-** <dd>An SQLITE_TRACE_CLOSE callback is invoked when a database
+** <dd>^An SQLITE_TRACE_CLOSE callback is invoked when a database
** connection closes.
-** The P argument is a pointer to the [database connection] object
+** ^The P argument is a pointer to the [database connection] object
** and the X argument is unused.
** </dl>
*/
@@ -2846,25 +2846,25 @@ SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*,
** CAPI3REF: SQL Trace Hook
** METHOD: sqlite3
**
-** The sqlite3_trace_v2(D,M,X,P) interface registers a trace callback
+** ^The sqlite3_trace_v2(D,M,X,P) interface registers a trace callback
** function X against [database connection] D, using property mask M
-** and context pointer P. If the X callback is
+** and context pointer P. ^If the X callback is
** NULL or if the M mask is zero, then tracing is disabled. The
** M argument must be one or more of the [SQLITE_TRACE]
** constants.
**
-** Each call to either sqlite3_trace() or sqlite3_trace_v2() overrides
+** ^Each call to either sqlite3_trace() or sqlite3_trace_v2() overrides
** (cancels) any prior calls to sqlite3_trace() or sqlite3_trace_v2().
**
-** The X callback is invoked whenever any of the events identified by
-** mask M occur. The integer return value from the callback is currently
+** ^The X callback is invoked whenever any of the events identified by
+** mask M occur. ^The integer return value from the callback is currently
** ignored, though this may change in future releases. Callback
** implementations should return zero to ensure future compatibility.
**
-** A trace callback is invoked with four arguments: callback(T,C,P,X).
-** The T argument is one of the [SQLITE_TRACE]
+** ^A trace callback is invoked with four arguments: callback(T,C,P,X).
+** ^The T argument is one of the [SQLITE_TRACE]
** constants to indicate why the callback was invoked.
-** The C argument is a copy of the context pointer.
+** ^The C argument is a copy of the context pointer.
** The P and X arguments are pointers whose meanings depend on T.
**
** The sqlite3_trace_v2() interface is intended to replace the legacy
diff --git a/src/vdbeapi.c b/src/vdbeapi.c
index 883e5c95b..b17c0e0a4 100644
--- a/src/vdbeapi.c
+++ b/src/vdbeapi.c
@@ -1612,6 +1612,39 @@ int sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){
return (int)v;
}
+/*
+** Return the SQL associated with a prepared statement
+*/
+const char *sqlite3_sql(sqlite3_stmt *pStmt){
+ Vdbe *p = (Vdbe *)pStmt;
+ return p ? p->zSql : 0;
+}
+
+/*
+** Return the SQL associated with a prepared statement with
+** bound parameters expanded. Space to hold the returned string is
+** obtained from sqlite3_malloc(). The caller is responsible for
+** freeing the returned string by passing it to sqlite3_free().
+**
+** The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of
+** expanded bound parameters.
+*/
+char *sqlite3_expanded_sql(sqlite3_stmt *pStmt){
+#ifdef SQLITE_OMIT_TRACE
+ return 0;
+#else
+ char *z = 0;
+ const char *zSql = sqlite3_sql(pStmt);
+ if( zSql ){
+ Vdbe *p = (Vdbe *)pStmt;
+ sqlite3_mutex_enter(p->db->mutex);
+ z = sqlite3VdbeExpandSql(p, zSql);
+ sqlite3_mutex_leave(p->db->mutex);
+ }
+ return z;
+#endif
+}
+
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
/*
** Allocate and populate an UnpackedRecord structure based on the serialized
diff --git a/src/vdbeaux.c b/src/vdbeaux.c
index b04a1d23f..992fa4db9 100644
--- a/src/vdbeaux.c
+++ b/src/vdbeaux.c
@@ -65,39 +65,6 @@ void sqlite3VdbeSetSql(Vdbe *p, const char *z, int n, int isPrepareV2){
}
/*
-** Return the SQL associated with a prepared statement
-*/
-const char *sqlite3_sql(sqlite3_stmt *pStmt){
- Vdbe *p = (Vdbe *)pStmt;
- return p ? p->zSql : 0;
-}
-
-/*
-** Return the SQL associated with a prepared statement with
-** bound parameters expanded. Space to hold the returned string is
-** obtained from sqlite3_malloc(). The caller is responsible for
-** freeing the returned string by passing it to sqlite3_free().
-**
-** The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of
-** expanded bound parameters.
-*/
-char *sqlite3_expanded_sql(sqlite3_stmt *pStmt){
-#ifdef SQLITE_OMIT_TRACE
- return 0;
-#else
- char *z = 0;
- const char *zSql = sqlite3_sql(pStmt);
- if( zSql ){
- Vdbe *p = (Vdbe *)pStmt;
- sqlite3_mutex_enter(p->db->mutex);
- z = sqlite3VdbeExpandSql(p, zSql);
- sqlite3_mutex_leave(p->db->mutex);
- }
- return z;
-#endif
-}
-
-/*
** Swap all content between two VDBE structures.
*/
void sqlite3VdbeSwap(Vdbe *pA, Vdbe *pB){
diff --git a/src/vdbetrace.c b/src/vdbetrace.c
index 8a1c23bc3..d30cf3acd 100644
--- a/src/vdbetrace.c
+++ b/src/vdbetrace.c
@@ -141,8 +141,8 @@ char *sqlite3VdbeExpandSql(
if( enc!=SQLITE_UTF8 ){
memset(&utf8, 0, sizeof(utf8));
utf8.db = db;
- if( SQLITE_NOMEM== sqlite3VdbeMemSetStr(&utf8,pVar->z,pVar->n,enc,SQLITE_STATIC)
- || SQLITE_NOMEM== sqlite3VdbeChangeEncoding(&utf8, SQLITE_UTF8)
+ if( SQLITE_NOMEM==sqlite3VdbeMemSetStr(&utf8,pVar->z,pVar->n,enc,SQLITE_STATIC)
+ || SQLITE_NOMEM==sqlite3VdbeChangeEncoding(&utf8, SQLITE_UTF8)
){
sqlite3StrAccumReset(&out);
sqlite3VdbeMemRelease(&utf8);