CAST-FORMAT. Error message for invalid query does not contain name of lost part

19 views
Skip to first unread message

Pavel Zotov

unread,
Jul 4, 2026, 3:31:11 AM (3 days ago) Jul 4
to firebird-devel

This (weird) query:

select cast('Apr' as date format 'YEAR  MON') from rdb$database;

-- fails with following output:
1) 6.0.0.2052:
Statement failed, SQLSTATE = HY000
Cannot find value in input string for "YEAR" pattern
(gdscode = 335545315)

2) 6.0.0.2060:
Statement failed, SQLSTATE = HY000
Cannot recognize "" part of date format
(gdscode = 335545293)

The first message seems much clearer (and second  does not contain 'year' )
Can it be used as it was before #da137310 , or just to add 'YEAR' incurrent text  ?
// Correct behavior of YEAR pattern (#9052)

Artyom Ivanov

unread,
Jul 6, 2026, 3:58:30 AM (yesterday) Jul 6
to firebird-devel
The `YEAR` pattern has been re-implemented: it now converts a year number to a spelled version (`ONE THOUSAND ONE HUNDRED`) as it done in Oracle.
Currently, the 'YEAR' is implemented only for `datetime to string` conversion (as it done in Oracle), it means `YEAR` has been removed for `string to datetime` conversion, and therefore the new error message is correct, but there is something wrong with the message argument (empty quotes), I will fix it.
Reply all
Reply to author
Forward
0 new messages