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

Change the behavior of date-time functions without any arguments (and thus

the CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP variables) so that they
work like 'txn' instead of like 'now'.  This is an incompatibility with legacy,
but brings SQLite into conformance with all other SQL systems.

FossilOrigin-Name: 1ac78be54502779236645eac35b962797f2fb98307d059d2aa19658c4fa74cb7
This commit is contained in:
drh
2023-02-08 11:34:05 +00:00
parent 3393ee7ff6
commit c1dab9ded2
3 changed files with 9 additions and 9 deletions

View File

@@ -952,7 +952,7 @@ static int isDate(
memset(p, 0, sizeof(*p));
if( argc==0 ){
if( !sqlite3NotPureFunc(context) ) return 1;
return setCurrentStmtTime(context, p, 0);
return setCurrentStmtTime(context, p, 1);
}
if( (eType = sqlite3_value_type(argv[0]))==SQLITE_FLOAT
|| eType==SQLITE_INTEGER ){
@@ -1318,7 +1318,7 @@ static void currentTimeFunc(
UNUSED_PARAMETER(argc);
UNUSED_PARAMETER(argv);
iT = sqlite3StmtCurrentTime(context);
iT = sqlite3StmtCurrentTime(context, 1);
if( iT<=0 ) return;
t = iT/1000 - 10000*(sqlite3_int64)21086676;
#if HAVE_GMTIME_R