FirebirdSQL / firebird

Firebird server, client and tools
https://www.firebirdsql.org/
1.24k stars 212 forks source link

System procedure/function inconsistency between ISQL SHOW FUNCTIONS and SHOW PROCEDURES #7962

Closed mrotteveel closed 8 months ago

mrotteveel commented 8 months ago

In Firebird 5.0.0.1306 ISQL, the SHOW FUNCTIONS command lists system functions in packages, while SHOW PROCEDURES correctly does not list system procedures in packages.

SHOW FUNCTIONS should be changed to exclude system functions (from RDB$BLOB_UTIL, RDB$PROFILER and RDB$TIME_ZONE_UTIL), as those should be queried with SHOW SYSTEM FUNCTIONS.

Reproduction:

create database 'e:\db\fb5\showfunc.fdb' user sysdba;
set term #;
-- including some functions and package functions for demonstration
create function dummy() returns integer as begin return 1; end#
CREATE OR ALTER PACKAGE APP_VAR
AS
BEGIN
   FUNCTION GET_DATEBEGIN() RETURNS DATE DETERMINISTIC;
   FUNCTION GET_DATEEND() RETURNS DATE DETERMINISTIC;
END#
set term ;#

Now, when executing SHOW FUNCTIONS, the output includes the system functions:

SQL> show functions;
DUMMY
APP_VAR.GET_DATEBEGIN
APP_VAR.GET_DATEEND
RDB$BLOB_UTIL.IS_WRITABLE
RDB$BLOB_UTIL.NEW_BLOB
RDB$BLOB_UTIL.OPEN_BLOB
RDB$BLOB_UTIL.READ_DATA
RDB$BLOB_UTIL.SEEK
RDB$PROFILER.START_SESSION
RDB$TIME_ZONE_UTIL.DATABASE_VERSION

However, the expected output should exclude the system functions, that is, it should produce:

DUMMY
APP_VAR.GET_DATEBEGIN
APP_VAR.GET_DATEEND
TreeHunter9 commented 8 months ago

I've fixed this bug before in RedDatabase, didn't know Firebird had the same issue. I can make PR with this fix.

AlexPeshkoff commented 8 months ago

Please do - for both 5 & 6

TreeHunter9 commented 8 months ago

Made PR #7971, #7972 for both 5 and 6.

TreeHunter9 commented 8 months ago

I suppose this issue should be closed?

mrotteveel commented 8 months ago

Please don't forget to add the fix-version tags (I did that now).