mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Ensure that the YYYY-MM-DD input to date and time functions has been normalized
prior to returning a result. [forum:/forumpost/6bb476897e|Forum post 6bb476897e]. FossilOrigin-Name: b692eb8ccb2d0645599ad73a8bdacf5df499114244aadeb38aabc580fc4dc7c5
This commit is contained in:
@@ -1043,6 +1043,12 @@ static int isDate(
|
||||
}
|
||||
computeJD(p);
|
||||
if( p->isError || !validJulianDay(p->iJD) ) return 1;
|
||||
if( argc==1 && p->validYMD && p->D>28 ){
|
||||
/* Make sure a YYYY-MM-DD is normalized.
|
||||
** Example: 2023-02-31 -> 2023-03-03 */
|
||||
assert( p->validJD );
|
||||
p->validYMD = 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user