Non-flexible dependance of procedures using TYPE OF COLUMN
----------------------------------------------------------

                 Key: CORE-3505
                 URL: http://tracker.firebirdsql.org/browse/CORE-3505
             Project: Firebird Core
          Issue Type: Bug
    Affects Versions: 2.5.0
            Reporter: Michal Dohnal


All dependant procedures using TYPE OF COLUMN, where column is defined by 
domain, need to be manually recompiled, when the definition of domain is 
changed.

Example:

-- Let's have 2 different domains

CREATE DOMAIN D_VARCHAR10 AS 
VARCHAR(10) CHARACTER SET WIN1250 
COLLATE PXW_CSY ;

CREATE DOMAIN D_VARCHAR40 AS 
VARCHAR(40) CHARACTER SET WIN1250 
COLLATE PXW_CSY ;

-- In time of creating table, we presume 10 characters should be enough

CREATE TABLE NEW_TABLE (
    ID INTEGER,
    FIELD D_VARCHAR10);

-- We create some read procedure

CREATE OR ALTER PROCEDURE NEW_PROC
RETURNS(
  FIELD TYPE OF COLUMN NEW_TABLE.FIELD)
AS
BEGIN
  FOR SELECT FIELD
      FROM NEW_TABLE
      INTO :FIELD
  DO
    SUSPEND;
END;

-- Now, we need more space

ALTER TABLE NEW_TABLE ALTER FIELD TYPE D_VARCHAR40;

--  Let's insert some long record

INSERT INTO NEW_TABLE
(ID,FIELD) VALUES (1,'I am longer than 10 characters');

-- And then we try to read all records of the table using the read procedure

SELECT * FROM NEW_PROC;

-- So we get this exception 

/*Arithmetic overflow or division by zero has occurred.
arithmetic exception, numeric overflow, or string truncation.
string right truncation.
At procedure 'NEW_PROC' line: 6, col: 3.*/


I can mention that, Backup and Restore doesn't help.

I am aware of that, some software like IB Expert offer to recompile all 
depenadant procedures,
but it gets complicated in some situations like differential updating on 
customers databases.








-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger. 
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today. 
http://p.sf.net/sfu/quest-sfdev2dev
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to