New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Whitespace as date separator causes conversion error [CORE6427] #6665
Comments
Modified by: @asfernandesassignee: Adriano dos Santos Fernandes [ asfernandes ] |
Commented by: @asfernandes Should space separator also be allowed when month is in numeric format (01 01 1900)? |
Commented by: @asfernandes Also, '02oct20' (without spaces) is valid in v3. Should it be? |
Commented by: @mrotteveel Maybe better to ask that on firebird-devel to get more eyes on it. Personally, I'd say: allow spaces in 01 01 1900, but do not accept the version without separators (02oct20), however that could potentially lead to a backwards comptibility issue. |
Commented by: @dyemanov I agree with Mark. |
Commented by: @dmitry-starodubov Our developers usually use formats "DD-MM-YYYY", "YYYY-MM-DD", "DD.MM.YYYY". |
Modified by: @asfernandesstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 4.0 RC 1 [ 10930 ] |
Commented by: @pavel-zotov Something wrong occurs when delimiter is space and FIRST token (i.e. day number) is greater than 12: select cast('01 01 2000' as timestamp) from rdb$database; 2000-01-01 00:00:00.0000 -- OK, expected select cast('12 01 2000' as timestamp) from rdb$database; 2000-12-01 00:00:00.0000 -- OK, expected select cast('13 01 2000' as timestamp) from rdb$database; Statement failed, SQLSTATE = 22018 PS PPS. |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Resolved [ 5 ] QA Status: No test => Deferred Test Details: See note 28/Oct/20 07:03 AM. |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Resolved [ 5 ] QA Status: Deferred => No test Test Details: See note 28/Oct/20 07:03 AM. => |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Closed [ 6 ] |
Modified by: @pavel-zotovstatus: Closed [ 6 ] => Closed [ 6 ] QA Status: No test => Done successfully |
Commented by: @mrotteveel @pavel In your example, the first token is taken as the month, not the day (ie American order). This is simply one of the problem with the entirely ambiguous parsing Firebird does. Following the SQL standard to the letter, it should by default only accept something akin to yyyy-MM-dd HH:mm:ss.ffff, all other formats should be handled through CAST( ... as ... FORMAT <format-string>), but that is no longer an option. |
Submitted by: @dmitry-starodubov
Such string to date conversion that work in pre-FB4 versions fails in FB4:
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 CORE5750 and it breaks backward compatibility.
Commits: ff37d44
The text was updated successfully, but these errors were encountered: