1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

The date and time functions use the exact same notion of "now" for every

invocation within the same call to sqlite3_step().

FossilOrigin-Name: daf6ba413cb3cb6065774ba07495eab4a28b49b0
This commit is contained in:
drh
2013-09-16 12:57:19 +00:00
parent b8af6a285c
commit 95a7b3e36d
8 changed files with 53 additions and 17 deletions

View File

@@ -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.
@@ -534,6 +535,19 @@ sqlite3 *sqlite3_context_db_handle(sqlite3_context *p){
return p->s.db;
}
/*
** 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