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-automations opened this issue Jul 17, 2018 · 9 comments

Comments

@firebird-automations
Copy link
Collaborator

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-automations
Copy link
Collaborator Author

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-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

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-automations
Copy link
Collaborator Author

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-automations
Copy link
Collaborator Author

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-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

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

@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 ]

@firebird-automations
Copy link
Collaborator Author

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