Issue Details (XML | Word | Printable)

Key: CORE-6333
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Anton Shchyrov
Votes: 0
Watchers: 6
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Not checked the availability of the UDF

Created: 15/Jun/20 01:33 PM   Updated: 16/Jun/20 02:08 PM
Component/s: UDF
Affects Version/s: 3.0.5
Fix Version/s: None

Environment: Windows

QA Status: No test


 Description  « Hide
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

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Karol Bieniaszewski added a comment - 15/Jun/20 02:26 PM
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.

Anton Shchyrov added a comment - 15/Jun/20 02:37 PM
I am not saying that there should be an error restoring the database. But there are no messages at all.

Adriano dos Santos Fernandes added a comment - 15/Jun/20 02:47 PM
I agree with Karol, defining a function should be allowed even when the library does not exist.

Anton Shchyrov added a comment - 15/Jun/20 03:10 PM - edited
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.

Dmitry Yemanov added a comment - 15/Jun/20 04:05 PM
IIRC, the engine was always returning a warning for the physically missing UDF if it happens during restore.

Alexander Peshkov added a comment - 16/Jun/20 02:08 PM
I see no reason changing engine behavior for deprecated in FB4 UDFs.