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

UDFs in Firebird 3.0.4 on macOS Mojave - when trying to call UDF from fbudf.dylib in isql, a message "Statement failed, SQLSTATE = 39000 invalid request BLR at offset 35" is displayed [CORE6122] #6371

Closed
firebird-automations opened this issue Aug 13, 2019 · 9 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Krzysztof Gałka (DGCS S.A.) (krzysztof_galka_dgcs_sa)

Hello,

after installing Firebird 3.0.4 on macOS Mojave (10.14.3, 64-bit), when trying to call a UDF from file fbudf.dylib (using isql), for example trying to call ADDYEAR using the command

SELECT ADDYEAR(CAST('2019-08-13' AS TIMESTAMP), 1) FROM RDB$DATABASE;

the following mesage is shown:

Statement failed, SQLSTATE = 39000
invalid request BLR at offset 35
-function ADDYEAR is not defined
-module name or entrypoint could not be found

The UDFs from file ib_udf.dylib, for example STRLEN, seem to work correctly (when called using isql).

Firebird 3.0.4 was installed using the Firebird-3.0.4-33054-lipo-x86_64.pkg package. Function ADDYEAR was declared by copying and pasting its declaration from file fbudf.sql in isql. Similarly, function STRLEN was declared by copying and pasting its declaration from file ib_udf2.sql in isql. Running "SHOW FUNCTIONS;" in isql produces the following output:

Global functions

Function Name Invalid Dependency, Type
================================= ======= =====================================
ADDYEAR
STRLEN

After checking the file fbudf.dylib with otool - by running "otool -L fbudf.dylib" - the following output is produced:

fbudf.dylib:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)
/Users/pbeach/firebird304/gen/Release/firebird/lib/libfbclient.dylib.3.0.4 (compatibility version 3.0.4, current version 3.0.4)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.0)

Probably fbudf.dylib contains an incorrect link (the second path in the message above).

The UDFs from file fbudf.dylib seem to work correctly in Firebird 2.5.5. After running otool - again with "otool -L fbudf.dylib" - on fbudf.dylib from Firebird 2.5.5, the output is:

fbudf.dylib:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 104.1.0)

Kind regards,
Krzysztof Gałka

Commits: 46c797f

@firebird-automations
Copy link
Collaborator Author

Commented by: @mrotteveel

Have you correct configured UDF access in firebird.conf?

Also, why are you using these deprecated UDFs instead of the standard functions built-in in Firebird like DATEADD and CHAR_LENGTH?

@firebird-automations
Copy link
Collaborator Author

Modified by: @paulbeach

assignee: Paul Beach [ pbeach ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @paulbeach

Mark, its a bug in the creation of the Firebird framework, I am testing the fix for postfix.darwin now.

The bug is also easy to fix manually using otool to change the location of the libfbclient referred to in my build directory (/Users/pbeach/firebird304/gen/Release/firebird/lib/libfbclient.dylib.3.0.4) to the libfbclient.dylib found in the framework (Library/Frameworks/Firebird.framework/Versions/A/Firebird)

@firebird-automations
Copy link
Collaborator Author

Modified by: @paulbeach

Fix Version: 3.0.5 [ 10885 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @paulbeach

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

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Krzysztof Gałka (DGCS S.A.) (krzysztof_galka_dgcs_sa)

Thank You for the response.

According to the license (Initial Developer's Public License Version 1.0), is it required to publish a binary modified in the mentioned way?

@firebird-automations
Copy link
Collaborator Author

Commented by: @paulbeach

No. In the same way you can finesse postfix.darwin, to build an embedded version of Firebird on MacOS, just by changing file and library locations.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: No test => Cannot be tested

@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