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

Stored procedure still using the old value after changing the field default [CORE1074] #1496

Open
firebird-automations opened this issue Dec 30, 2006 · 2 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Yovtcho S Zagorov (yotce)

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>

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

This is not specific to procedures, but to all already compiled statements.
The same problem exists for contraints.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 11450 ] => Firebird [ 15481 ]

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

1 participant