Skip to content
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

TRUNC() does not accept second argument = -128 (but shows it as required boundary in error message) [CORE6355] #6596

Closed
firebird-automations opened this issue Jul 6, 2020 · 7 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Rollowing commands have the same issue on 2.5, 3.0 & 4.0:

SQL> set heading off;
SQL> select trunc(1,-127) from rdb$database;

       0

SQL> select trunc(1,-128) from rdb$database;

Statement failed, SQLSTATE = 42000
expression evaluation not supported
-The numeric scale must be between -128 and 127 in TRUNC

Commits: fc6b04f

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

summary: TRUNC() does not accept second argument = -128 (but show it as required boundary in error message) => TRUNC() does not accept second argument = -128 (but shows it as required boundary in error message)

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @mrotteveel

I'm not sure the range of [-128, 127] makes sense for the TRUNC function. The range should be the amount of decimal digits, so the correct range would be [-38,38] as far as I can tell. Where does the range [-128, 127] come from?

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Also old code accepted (due to same bug) precision == 128.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.0 RC 1 [ 10930 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Done successfully

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants