Issue Details (XML | Word | Printable)

Key: CORE-4572
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Dmitry Yemanov
Reporter: Simonov Denis
Votes: 0
Watchers: 2
Operations

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

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

Created: 08/Oct/14 05:31 AM   Updated: 23/Sep/15 11:30 AM
Component/s: Engine
Affects Version/s: 3.0 Alpha 2
Fix Version/s: 3.0 Beta 2

Environment: isql, Firebird WI-T3.0.0.31353 Firebird 3.0 Alpha 2

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


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

 All   Comments   Change History   Subversion Commits      Sort Order: Descending order - Click to sort in ascending order
There are no comments yet on this issue.