aboutsummaryrefslogtreecommitdiff
path: root/src/vdbeapi.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2013-10-10 20:13:18 +0000
committerdrh <drh@noemail.net>2013-10-10 20:13:18 +0000
commita63b85299290b7eca076ea6e031e7f43d4feadcf (patch)
treee925eb05965ec76f37b6483581d5bd8f8ea9e53b /src/vdbeapi.c
parent59255f9a98381960cfede9253277f128895531f6 (diff)
parent7e65c94bdc689bebd222321dec5c034194267ac9 (diff)
downloadsqlite-a63b85299290b7eca076ea6e031e7f43d4feadcf.tar.gz
sqlite-a63b85299290b7eca076ea6e031e7f43d4feadcf.zip
Synchronize with the trunk.
FossilOrigin-Name: 136445ba020c9475d3f5a7843d7d0add98477138
Diffstat (limited to 'src/vdbeapi.c')
-rw-r--r--src/vdbeapi.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/vdbeapi.c b/src/vdbeapi.c
index 079c6801f..612c0b9ef 100644
--- a/src/vdbeapi.c
+++ b/src/vdbeapi.c
@@ -510,6 +510,7 @@ int sqlite3_step(sqlite3_stmt *pStmt){
return rc;
}
+
/*
** Extract the user data from a sqlite3_context structure and return a
** pointer to it.
@@ -535,6 +536,19 @@ sqlite3 *sqlite3_context_db_handle(sqlite3_context *p){
}
/*
+** Return the current time for a statement
+*/
+sqlite3_int64 sqlite3StmtCurrentTime(sqlite3_context *p){
+ Vdbe *v = p->pVdbe;
+ int rc;
+ if( v->iCurrentTime==0 ){
+ rc = sqlite3OsCurrentTimeInt64(p->s.db->pVfs, &v->iCurrentTime);
+ if( rc ) v->iCurrentTime = 0;
+ }
+ return v->iCurrentTime;
+}
+
+/*
** The following is the implementation of an SQL function that always
** fails with an error message stating that the function is used in the
** wrong context. The sqlite3_overload_function() API might construct