Issue Details (XML | Word | Printable)

Key: CORE-1074
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Yovtcho S Zagorov
Votes: 0
Watchers: 0
Operations

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

Stored procedure still using the old value after changing the field default

Created: 30/Dec/06 12:38 AM   Updated: 30/Dec/06 07:29 PM
Component/s: None
Affects Version/s: 2.0.0
Fix Version/s: None


 Description  « Hide
Let create a table having a field with default value and procedure inserting data in that table.
Next, let change the field default value. The stored procedure will continue producing a records containing the old default until recompiling of stored procedure referencing that table.

SQL> CREATE TABLE t1 (
CON> F1 integer,
CON> F2 integer DEFAULT 1);
SQL> set term ^;
SQL> create procedure p1
CON> as
CON> begin
CON> insert into t1(f1) values (0);
CON> end^
SQL> set term ; ^
SQL> execute procedure p1;
SQL> select * from t1;

          F1 F2
============ ============
           0 1

SQL> alter table t1 alter f2 set default 2;
SQL> insert into t1(f1) values (1);
SQL> select * from t1;

          F1 F2
============ ============
           0 1
           1 2

SQL> execute procedure p1;
SQL> select * from t1;

          F1 F2
============ ============
           0 1
           1 2
           0 1

SQL>


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Adriano dos Santos Fernandes added a comment - 30/Dec/06 07:29 PM
This is not specific to procedures, but to all already compiled statements.
The same problem exists for contraints.