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

UDF substr gives NULL if slice > input [CORE564] #920

Closed
firebird-automations opened this issue May 4, 2001 · 4 comments
Closed

UDF substr gives NULL if slice > input [CORE564] #920

firebird-automations opened this issue May 4, 2001 · 4 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Claudio Valderrama C. (robocop)

Assigned to: Claudio Valderrama C. (robocop)

SFID: 421263#⁠
Submitted By: robocop

The substr UDF that comes with FB returns NULL when
the final position is greater than the last position
in the input string argument. This causes any kind of
problems. Hence, two solutions have been provided:
- Fix substr so it will return NULL when provided with
NULL, but it will report the full string if the final
position of the slice is greater than the strig.
- Add substrlen that will have the argument most
people are used to: starting position plus length of
the slice instead of starting and final position.

The final solution will come when a substr function,
ANSI compliant, can implemented in the server's core
in the future.

C.

@firebird-automations
Copy link
Collaborator Author

Commented by: Alice F. Bird (firebirds)

Date: 2001-05-21 09:18
Sender: robocop
Logged In: YES
user_id=62823

Substr has been fixed, so it will return the full string if
the final position is greater than the string's length.
Substrlen has been added, that takes string, start pos and
length of the slice for greater convenience.

C.

1 similar comment
@firebird-automations
Copy link
Collaborator Author

Commented by: Alice F. Bird (firebirds)

Date: 2001-05-21 09:18
Sender: robocop
Logged In: YES
user_id=62823

Substr has been fixed, so it will return the full string if
the final position is greater than the string's length.
Substrlen has been added, that takes string, start pos and
length of the slice for greater convenience.

C.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 10588 ] => Firebird [ 14919 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

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

1 participant