You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With a fresh firebird-superserver 2.5.7 installation
create a new database
for example
/var/lib/firebird/data/test.fdb
with sqldialect 3, charset UTF-8
crate a very simple table :
create table tbtest (idtest integer not null);
Make some row (for exemple 10 rows from idtest=1 to idtest=10)
insert into tbtest (idtest)
values
(1);
insert into tbtest (idtest)
values
(2);
insert into tbtest (idtest)
values
(3);
insert into tbtest (idtest)
values
(4);
insert into tbtest (idtest)
values
(5);
insert into tbtest (idtest)
values
(6);
insert into tbtest (idtest)
values
(7);
insert into tbtest (idtest)
values
(8);
insert into tbtest (idtest)
values
(9);
insert into tbtest (idtest)
values
(10);
register a fbudf function :
fo exemple :
declare external function ADDDAY
timestamp, int
returns timestamp
entry_point 'addday' module_name 'fbudf';
declare external function ADDDAY2
timestamp, int
returns timestamp
entry_point 'addDay' module_name 'fbudf';
Use thoses functions
select 100*a.idtest+10*b.idtest+c.idtest, addDay(cast('2001-01-01' as timestamp),100*a.idtest+10*b.idtest+c.idtest) from tbtest a
join tbtest b on 1=1 join tbtest c on 1=1;
result :
invalid request BLR at offset 91
function ADDDAY is not defined
module name or entrypoint could not be found
select 100*a.idtest+10*b.idtest+c.idtest, addDay2(cast('2001-01-01' as timestamp),100*a.idtest+10*b.idtest+c.idtest) from tbtest a
join tbtest b on 1=1 join tbtest c on 1=1;
Result ok :
But both functions is working from FB1.5 to FB2.5
It seems that
the entry point module name has become case sensitive in FB2.5.7
For old database with stored procedure or view depends on udf function, we cannot drop/create to correct the entry point 's caractere case.
Except create empty database with correct metadata and then insert data.
The text was updated successfully, but these errors were encountered:
Though it was not mentioned but from this DB location "/var/lib/firebird/data/test.fdb" I guess you are using linux.
When you say that entrypoint with wrong case worked on it in old firebird versions that looks like fantazy. Please take a look:
SQL> show function ADDDAY;
Function ADDDAY:
Function library is fbudf
Entry point is addDay
...
SQL> show function ADDDAY2;
Function ADDDAY2:
Function library is fbudf
Entry point is addday
...
SQL> select addday(current_date, 10) from rdb$database;
SQL> select addday2(current_date, 10) from rdb$database;
Statement failed, SQLSTATE = 39000
invalid request BLR at offset 35
-function ADDDAY2 is not defined
-module name or entrypoint could not be found
SQL>
May be you were using firebird on other OS pre 2.5.7?
Submitted by: christophe derenne (cdr60530)
With a fresh firebird-superserver 2.5.7 installation
create a new database
for example
/var/lib/firebird/data/test.fdb
with sqldialect 3, charset UTF-8
crate a very simple table :
create table tbtest (idtest integer not null);
Make some row (for exemple 10 rows from idtest=1 to idtest=10)
insert into tbtest (idtest)
values
(1);
insert into tbtest (idtest)
values
(2);
insert into tbtest (idtest)
values
(3);
insert into tbtest (idtest)
values
(4);
insert into tbtest (idtest)
values
(5);
insert into tbtest (idtest)
values
(6);
insert into tbtest (idtest)
values
(7);
insert into tbtest (idtest)
values
(8);
insert into tbtest (idtest)
values
(9);
insert into tbtest (idtest)
values
(10);
register a fbudf function :
fo exemple :
declare external function ADDDAY
timestamp, int
returns timestamp
entry_point 'addday' module_name 'fbudf';
declare external function ADDDAY2
timestamp, int
returns timestamp
entry_point 'addDay' module_name 'fbudf';
Use thoses functions
select 100*a.idtest+10*b.idtest+c.idtest, addDay(cast('2001-01-01' as timestamp),100*a.idtest+10*b.idtest+c.idtest) from tbtest a
join tbtest b on 1=1 join tbtest c on 1=1;
result :
invalid request BLR at offset 91
function ADDDAY is not defined
module name or entrypoint could not be found
select 100*a.idtest+10*b.idtest+c.idtest, addDay2(cast('2001-01-01' as timestamp),100*a.idtest+10*b.idtest+c.idtest) from tbtest a
join tbtest b on 1=1 join tbtest c on 1=1;
Result ok :
But both functions is working from FB1.5 to FB2.5
It seems that
the entry point module name has become case sensitive in FB2.5.7
For old database with stored procedure or view depends on udf function, we cannot drop/create to correct the entry point 's caractere case.
Except create empty database with correct metadata and then insert data.
The text was updated successfully, but these errors were encountered: