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

Fix the "now" option for date-time functions for cases when STAT4 is disabled.

FossilOrigin-Name: 3ac1f6a3cf1a8fd3ab1ca96b2564c13c4b8d2234
This commit is contained in:
drh
2015-03-12 23:48:27 +00:00
parent 3795f3cee3
commit 3df79a9a1f
4 changed files with 12 additions and 14 deletions

View File

@@ -641,15 +641,14 @@ sqlite3 *sqlite3_context_db_handle(sqlite3_context *p){
*/
sqlite3_int64 sqlite3StmtCurrentTime(sqlite3_context *p){
int rc;
sqlite3_int64 iTime = 0;
#ifndef SQLITE_ENABLE_STAT3_OR_STAT4
sqlite3_int64 *piTime = &iTime;
sqlite3_int64 *piTime = &p->pVdbe->iCurrentTime;
assert( p->pVdbe!=0 );
#else
sqlite3_int64 iTime = 0;
sqlite3_int64 *piTime = p->pVdbe!=0 ? &p->pVdbe->iCurrentTime : &iTime;
if( *piTime==0 )
#endif
{
if( *piTime==0 ){
rc = sqlite3OsCurrentTimeInt64(p->pOut->db->pVfs, piTime);
if( rc ) *piTime = 0;
}