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-issue-importer opened this issue Jan 14, 2008 · 12 comments

Comments

@firebird-issue-importer

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-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 15, 2008

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-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 15, 2008

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-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 28, 2008

Modified by: @pcisar

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 28, 2008

Commented by: @asfernandes

Fixed with DSQL/engine integration.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 28, 2008

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 2.5 Alpha 1 [ 10224 ]

assignee: Dmitry Yemanov [ dimitr ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 28, 2008

Commented by: @dyemanov

What a nice side effect! :-)

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 9, 2008

Modified by: @dyemanov

Link: This issue is duplicated by CORE2178 [ CORE2178 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 23, 2011

Modified by: @pcisar

Link: This issue is related to QA335 [ QA335 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 20, 2011

Commented by: @pcisar

QA test added.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 20, 2011

Modified by: @pcisar

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 19, 2016

Modified by: @pavel-zotov

QA Status: No test

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 19, 2016

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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants