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

ALTER TABLE with UPDATE in one transaction [CORE2512] #1094

Closed
firebird-automations opened this issue Jun 16, 2009 · 3 comments
Closed

ALTER TABLE with UPDATE in one transaction [CORE2512] #1094

firebird-automations opened this issue Jun 16, 2009 · 3 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Semi (semi)

Cannot fill columns, created with ALTER TABLE within the same transaction by UPDATE.

Within one started transaction (before commit), after issuing command:

ALTER TABLE tbl add Column1 D_VARCHAR16;

this command causes exception:
update tbl set tbl.Column1=(select first 1 Column0 from tbl2 where http://tbl.ID=tbl2.ID)

this command does nothing:
update tbl set tbl.Column1=(select first 1 Column0 from tbl2 where http://tbl.ID=tbl2.ID) where (tbl.Column1 is NULL)

this simple select (performed by IBObjects component TIboQuery) causes exception:
select * from tbl

'ISC ERROR CODE:335544321'#⁠$D#⁠$A#⁠$D#⁠$A
'ISC ERROR MESSAGE:'#⁠$D#⁠$A'arithmetic exception, numeric overflow, or string truncation'#⁠$D#⁠$A#⁠$D#⁠$A
'STATEMENT:'#⁠$D#⁠$A'TIBOInternalDataset: "<TIBOQueryM>.<TIBOInternalDataset>."'#⁠$D#⁠$A#⁠$D#⁠$A

If these commands are executed AFTER the implicit commit of "ALTER TABLE", everything works fine...

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Everything works as designed. DDL execution is deferred till the commit time by the engine, so you should never expect DDL and DML working in the same transaction. In some old versions (IIRC, v1.5 included) it may even cause unexpected results (e.g. wrong column updated).

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Won't Fix [ 2 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

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