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

Not checked the availability of the UDF [CORE6333] #6574

Open
firebird-automations opened this issue Jun 15, 2020 · 7 comments
Open

Not checked the availability of the UDF [CORE6333] #6574

firebird-automations opened this issue Jun 15, 2020 · 7 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Anton Shchyrov (anton)

When a new UDF function is created, its presence in the system is not checked

```
SQL> connect localhost:D:\DB\test.fb user 'SYSDBA' password 'masterkey';
Database: localhost:D:\DB\test.fb, User: SYSDBA
SQL> DECLARE EXTERNAL FUNCTION UDF_TEST RETURNS SMALLINT ENTRY_POINT 'AnyPoint' MODULE_NAME 'not_exists.dll';
SQL> COMMIT;
SQL> SELECT UDF_TEST() FROM rdb$database;
Statement failed, SQLSTATE = 39000
invalid request BLR at offset 36
-function UDF_TEST is not defined
-module name or entrypoint could not be found
SQL>
```

Also, no messages are displayed when restoring the database, if the udf dll library is missing

@firebird-automations
Copy link
Collaborator Author

Modified by: Anton Shchyrov (anton)

description: When a new UDF function is created, its presence in the system is not checked

{code}
SQL> connect localhost:D:\DB\test.fb user 'SYSDBA' password 'masterkey';
Database: localhost:D:\DB\test.fb, User: SYSDBA
SQL> DECLARE EXTERNAL FUNCTION UDF_TEST RETURNS SMALLINT ENTRY_POINT 'AnyPoint' MODULE_NAME 'not_exists.dll';
SQL> COMMIT;
SQL> SELECT UDF_TEST() FROM rdb$database;
Statement failed, SQLSTATE = 39000
invalid request BLR at offset 36
-function UDF_TEST is not defined
-module name or entrypoint could not be found
SQL>
{code}

Also, no messages are displayed when restoring the database, if the udf dll library is missing

=>

When a new UDF function is created, its presence in the system is not checked

```
SQL> connect localhost:D:\DB\test.fb user 'SYSDBA' password 'masterkey';
Database: localhost:D:\DB\test.fb, User: SYSDBA
SQL> DECLARE EXTERNAL FUNCTION UDF_TEST RETURNS SMALLINT ENTRY_POINT 'AnyPoint' MODULE_NAME 'not_exists.dll';
SQL> COMMIT;
SQL> SELECT UDF_TEST() FROM rdb$database;
Statement failed, SQLSTATE = 39000
invalid request BLR at offset 36
-function UDF_TEST is not defined
-module name or entrypoint could not be found
SQL>
```

Also, no messages are displayed when restoring the database, if the udf dll library is missing

@firebird-automations
Copy link
Collaborator Author

Commented by: @livius2

I do not know if this should be somehow "fixed".
If db itself for its data do not need some udef e.g for restore i do not see reason for not restoring db. Maybe as some warning but not an error.

@firebird-automations
Copy link
Collaborator Author

Commented by: Anton Shchyrov (anton)

I am not saying that there should be an error restoring the database. But there are no messages at all.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

I agree with Karol, defining a function should be allowed even when the library does not exist.

@firebird-automations
Copy link
Collaborator Author

Commented by: Anton Shchyrov (anton)

But when defining a function, at the time of commit I get an error. What is the difference between UDR and UDF in this respect?

It seems to me that masking an error until a function call is made directly is a bad idea.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

IIRC, the engine was always returning a warning for the physically missing UDF if it happens during restore.

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

I see no reason changing engine behavior for deprecated in FB4 UDFs.

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