On 20-10-2020 11:51, Dmitry Starodubov wrote:
Some string to date conversions that work in FB3 fail with an error in FB4:

SELECT cast('01 jan 1900' as timestamp) FROM rdb$database;

Statement failed, SQLSTATE = 22018
conversion error from string "01 jan 1900"


SELECT cast('01,jan,1900' as timestamp) FROM rdb$database;

Statement failed, SQLSTATE = 22018

conversion error from string "01,jan,1900"

AFAIU the error appears after fix for CORE-5750. It's expected that whitespace and comma are no longer considered as date separators?

Because documentantion here (https://firebirdsql.org/en/firebird-date-literals/) says they are valid separators.

Keep in mind, that link is an excerpt from Helen Borrie's Firebird Book from 2004 (Firebird 1.5 era). It is descriptive of what worked at the time, it is not prescriptive as to how Firebird is supposed to behave.

That said, I think allowing spaces between date elements would be fine.

Personally, I think Firebird should add support for a cast with a cast template, CAST(<cast operand> AS <cast target> [FORMAT <cast template>]) as defined in SQL:2016 6.13 <cast specification> and 9.44 Datetime templates, which would allow to do away with some ambiguity.

Mark
--
Mark Rotteveel


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to