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

Incorrect error for PSQL function when the number of actual arguments does not match the number of formal arguments. [CORE4572] #4889

Closed
firebird-automations opened this issue Oct 8, 2014 · 4 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @sim1984

Incorrect error for PSQL function when the number of actual arguments does
not match the number of formal arguments.

There are some functions and procedures.

CREATE OR ALTER FUNCTION GET_MNEMONIC (
AFIELD_NAME TYPE OF COLUMN RDB$TYPES.RDB$FIELD_NAME,
ATYPE TYPE OF COLUMN RDB$TYPES.RDB$TYPE)
RETURNS TYPE OF COLUMN RDB$TYPES.RDB$TYPE_NAME
AS
BEGIN
RETURN(SELECT
RDB$TYPE_NAME
FROM
RDB$TYPES
WHERE RDB$FIELD_NAME = :AFIELD_NAME
AND RDB$TYPE = :ATYPE);
END

CREATE OR ALTER PROCEDURE SP_GET_MNEMONIC (
AFIELD_NAME TYPE OF COLUMN RDB$TYPES.RDB$FIELD_NAME,
ATYPE TYPE OF COLUMN RDB$TYPES.RDB$TYPE)
RETURNS (
OUT TYPE OF COLUMN RDB$TYPES.RDB$TYPE_NAME)
AS
BEGIN
SELECT
RDB$TYPE_NAME
FROM
RDB$TYPES
WHERE RDB$FIELD_NAME = :AFIELD_NAME
AND RDB$TYPE = :ATYPE
INTO :OUT;
END

Use CONNECT or CREATE DATABASE to specify a database
SQL> set names win1251;
SQL> connect 'localhost:test' user 'sysdba' password 'masterkey';
Database: 'localhost:test', User: sysdba
SQL> select get_mnemonic('RDB$FIELD_TYPE', 14) as t from rdb$database;

T

TEXT

SQL> EXECUTE PROCEDURE SP_GET_MNEMONIC('RDB$FIELD_TYPE', 14);

OUT

TEXT

SQL> select get_mnemonic('RDB$FIELD_TYPE') as t from rdb$database;
Statement failed, SQLSTATE = 39000
invalid request BLR at offset 52
-function GET_MNEMONIC could not be matched
SQL> EXECUTE PROCEDURE SP_GET_MNEMONIC('RDB$FIELD_TYPE');
Statement failed, SQLSTATE = 07001
Dynamic SQL Error
-Input parameter mismatch for procedure SP_GET_MNEMONIC

It seems to me that the error message for PSQL functions should be the
same as for the procedure.

Commits: 93b35c7 2cd3863 FirebirdSQL/fbt-repository@9227593 FirebirdSQL/fbt-repository@f473aee

====== Test Details ======

Confirmed on WI-T3.0.0.31374 Firebird 3.0 Beta 1:
Statement failed, SQLSTATE = 39000
invalid request BLR at offset 50
-function <...> could not be matched

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Regression: 3.0 Alpha 2 [ 10560 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

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

resolution: Fixed [ 1 ]

Fix Version: 3.0 Beta 2 [ 10586 ]

assignee: Dmitry Yemanov [ dimitr ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: Done successfully

Test Details: Confirmed on WI-T3.0.0.31374 Firebird 3.0 Beta 1:
Statement failed, SQLSTATE = 39000
invalid request BLR at offset 50
-function <...> could not be matched

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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