Skip to content

Firebird 2.5 allows to declare variables within Stored Procedures with more than 31 characters [CORE6047] #6297

@firebird-automations

Description

@firebird-automations

Submitted by: @luronumen

ACTUAL RESULT:
- Firebird 2.5 allows to declare variables within Stored Procedures with more than 31 characters

EXPECTED RESULT:
- Firebird 2.5 should not allows to declare variables within Stored Procedures with more than 31 characters like it is not allowed on Firebird 3.0:
Message: isc_dsql_prepare failed

SQL Message : -104
Invalid token

Engine Code : 335544569
Engine Message :
Dynamic SQL Error
SQL error code = -104
Name longer than database column size

- This issue needs to be fixed to maintain the compatibility of the Firebird 2.5 Metadata script extracted with the Firebird 3.0

STEPS TO REPRODUCE THE ISSUE
1- Create a Firebird SQL 2.5 database
2- Try to create a Stored Procedure with a declareted variable within Stored Procedures with more than 31 characters (e.g.: V_TOTAL_CROSS_WORKING_TIME_DAY NUMERIC)
CREATE PROCEDURE C_SERVICE_BTC_PRIMAVERA (UID VARCHAR(32) CHARACTER SET WIN1252,
FIRST_DAY DATE,
LAST_DAY DATE,
TEAM VARCHAR(32) CHARACTER SET WIN1252)
RETURNS (CALENDAR DATE,
SITE VARCHAR(32) CHARACTER SET WIN1252,
PROJECT VARCHAR(32) CHARACTER SET WIN1252,
PRODUCT VARCHAR(32) CHARACTER SET WIN1252,
REGION VARCHAR(32) CHARACTER SET WIN1252,
WORKING_TIME NUMERIC(18, 4))
AS
DECLARE V_TOTAL_WORKING_TIME_DAY NUMERIC(18,9);
DECLARE V_TOTAL_CROSS_WORKING_TIME_DAY NUMERIC(18,9);
DECLARE V_TOTAL_PRODUCT_WORKING_TIME_DAY NUMERIC(18,9);
DECLARE V_VALID_WORKING_TIME_DAY NUMERIC(18,9);
BEGIN
END^

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions