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-issue-importer opened this issue Jul 6, 2020 · 7 comments

Comments

@firebird-issue-importer
Copy link

@firebird-issue-importer firebird-issue-importer commented Jul 6, 2020

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-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 6, 2020

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-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 7, 2020

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 7, 2020

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-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 8, 2020

Commented by: @AlexPeshkoff

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 8, 2020

Modified by: @AlexPeshkoff

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

resolution: Fixed [ 1 ]

Fix Version: 4.0 RC 1 [ 10930 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 9, 2020

Modified by: @pavel-zotov

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

QA Status: No test => Done successfully

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 9, 2020

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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants