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

Error in EXECUTE STATEMENT inside CONNECT / TRANSACTION START triggers [CORE1693] #2118

Closed
firebird-automations opened this issue Jan 14, 2008 · 12 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @asfernandes

Is duplicated by CORE2178
Is related to QA335

By the same reasons already discussed for external languages implementation, EXECUTE STATEMENT doesn't work in CONNECT / TRANSACTION START triggers.

isql -term !
Use CONNECT or CREATE DATABASE to specify a database
SQL> create database 't.fdb'!
SQL> create trigger t_connect on connect as
CON> declare v integer;
CON> begin
CON> execute statement 'select 1 from rdb$database' into v;
CON> end!

isql t.fdb
Statement failed, SQLCODE = -904
invalid database handle (no active connection)
-At trigger 'T_CONNECT' line: 4, col: 3
Use CONNECT or CREATE DATABASE to specify a database

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Adriano, you were telling in Architect that you have an idea how to make it work? Something like creating temporal database handle if permanent is missing - like we do with transactions now?

BTW, TRANSACTION START trigger works except first time when connecting to database. And it makes me wonder - what transaction is started during database attach and is it really worth running TRANSACTION START triggers for it?

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Alex, I was supposing that creating handle in y-valve before calling GDS attach function, and passing direct y-valve handle address to GDS argument handle would be sufficient.

It's not, and reason is related to your question about the first transaction start.

GetWhyAttachment works in DSQL environment, so it don't work correctly if you didn't issued any DSQL command before.

Creating temporal handle solution works, and that completely eliminates GetWhyAttachment function. It would requires we use in the engine the subsystem number 1 to create the handle. Ugly, but not a very big problem for the current code.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 13821 ] => Firebird [ 14125 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Fixed with DSQL/engine integration.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 2.5 Alpha 1 [ 10224 ]

assignee: Dmitry Yemanov [ dimitr ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

What a nice side effect! :-)

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Link: This issue is duplicated by CORE2178 [ CORE2178 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA335 [ QA335 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pcisar

QA test added.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test => Done successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment