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

Provide name of udf function for "arithmetic exception, numeric overflow, or string truncation" [CORE5876] #6135

Closed
firebird-issue-importer opened this issue Jul 17, 2018 · 9 comments

Comments

@firebird-issue-importer

Submitted by: @livius2

This is important to know the reason of the error - especially if it is caused by udf function
Especially if you do insert into from select - you do not know the reason

DECLARE EXTERNAL FUNCTION SUBSTR
CSTRING(80), Smallint, Smallint
RETURNS CSTRING(80)
ENTRY_POINT 'IB_UDF_substr'
MODULE_NAME 'ib_udf.dll';

-----------------------------------------------------------------

SELECT SUBSTR(CAST('abc' AS CHAR(1500)) || '123', 1, 1000) FROM RDB$DATABASE

-----------------------------------------------------------------

SQL Message : -802
Arithmetic overflow or division by zero has occurred.

Engine Code : 335544321
Engine Message :
arithmetic exception, numeric overflow, or string truncation
string right truncation
expected length 80, actual 1503

-----------------------------------------------------------------
for not udf functions we have name of problematic function "At function 'BBB' line: 6, col: 1"

SQL Message : -802
Arithmetic overflow or division by zero has occurred.

Engine Code : 335544321
Engine Message :
arithmetic exception, numeric overflow, or string truncation
string right truncation
expected length 100, actual 103
At function 'BBB' line: 6, col: 1

Commits: decb92d 1a40ca6

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jul 17, 2018

Modified by: @livius2

description: This is important to know the reason of the error - especially if it is caused by udf function

DECLARE EXTERNAL FUNCTION SUBSTR
CSTRING(80), Smallint, Smallint
RETURNS CSTRING(80)
ENTRY_POINT 'IB_UDF_substr'
MODULE_NAME 'ib_udf.dll';

-----------------------------------------------------------------

SELECT SUBSTR(CAST('abc' AS CHAR(1500)) || '123', 1, 1000) FROM RDB$DATABASE

-----------------------------------------------------------------

SQL Message : -802
Arithmetic overflow or division by zero has occurred.

Engine Code : 335544321
Engine Message :
arithmetic exception, numeric overflow, or string truncation
string right truncation
expected length 80, actual 1503

-----------------------------------------------------------------
for not udf functions we have name of problematic function "At function 'BBB' line: 6, col: 1"

SQL Message : -802
Arithmetic overflow or division by zero has occurred.

Engine Code : 335544321
Engine Message :
arithmetic exception, numeric overflow, or string truncation
string right truncation
expected length 100, actual 103
At function 'BBB' line: 6, col: 1

=>

This is important to know the reason of the error - especially if it is caused by udf function
Especially if you do insert into from select - you do not know the reason

DECLARE EXTERNAL FUNCTION SUBSTR
CSTRING(80), Smallint, Smallint
RETURNS CSTRING(80)
ENTRY_POINT 'IB_UDF_substr'
MODULE_NAME 'ib_udf.dll';

-----------------------------------------------------------------

SELECT SUBSTR(CAST('abc' AS CHAR(1500)) || '123', 1, 1000) FROM RDB$DATABASE

-----------------------------------------------------------------

SQL Message : -802
Arithmetic overflow or division by zero has occurred.

Engine Code : 335544321
Engine Message :
arithmetic exception, numeric overflow, or string truncation
string right truncation
expected length 80, actual 1503

-----------------------------------------------------------------
for not udf functions we have name of problematic function "At function 'BBB' line: 6, col: 1"

SQL Message : -802
Arithmetic overflow or division by zero has occurred.

Engine Code : 335544321
Engine Message :
arithmetic exception, numeric overflow, or string truncation
string right truncation
expected length 100, actual 103
At function 'BBB' line: 6, col: 1

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jul 23, 2018

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jul 23, 2018

Commented by: @AlexPeshkoff

Karol, UDFs are deprecated since FB4. Therefore I tend to reject this item - if UDFs cause problems to you { ough, they do it by design :( } please consider rewriting them to UDRs.

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jul 23, 2018

Commented by: @livius2

I understand your point of view but as you say udf will be only depricated in FB4. Then udf will be available many years as first must be released fb5 and fb4 will be still maitained until fb6 or maybe fb7 ;-)

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jul 31, 2018

Modified by: @AlexPeshkoff

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

resolution: Fixed [ 1 ]

Fix Version: 4.0 Beta 1 [ 10750 ]

Fix Version: 3.0.4 [ 10863 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Jul 31, 2018

Modified by: @AlexPeshkoff

issuetype: New Feature [ 2 ] => Improvement [ 4 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 1, 2018

Modified by: @pavel-zotov

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

QA Status: No test => Done successfully

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 1, 2018

Modified by: @pavel-zotov

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

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Aug 2, 2018

Commented by: @livius2

Thank you very much, it is working :)

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