Issue Details (XML | Word | Printable)

Key: CORE-6234
Type: Bug Bug
Status: Open Open
Priority: Critical Critical
Assignee: Unassigned
Reporter: Luciano Mendes
Votes: 0
Watchers: 4
Operations

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

Unable to alter Database On Connect Trigger

Created: 20/Jan/20 01:51 PM   Updated: 20/Jan/20 03:16 PM
Component/s: Engine
Affects Version/s: 3.0.5
Fix Version/s: None

Environment:
Windows 10 x64
Firebird 3.0.5.33220 (x64)

QA Status: No test


 Description  « Hide
ACTUAL RESULT
- Unable to alter Database On Connect Trigger
- The following exception happen when it is tried to update an existing Database On Connect Trigger:
===========================================
Error: *** IBPP::SQLException ***
Context: Statement::Prepare(
ALTER TRIGGER DATABASE_ON_CONNECT ACTIVE
ON CONNECT POSITION 0
AS
BEGIN
END )
Message: isc_dsql_prepare failed

SQL Message : -104
Invalid token

Engine Code : 335544569
Engine Message :
Dynamic SQL Error
SQL error code = -104
Token unknown - line 3, column 1
ON
===========================================

EXPECTED RESULT
- The user should be able to update any Database On Connect Trigger without any issue

STEPS TO REPRODUCE THE ISSUE
1- Create a Database On Connect Trigger using the following DDL script:
=====================================
SET TERM ^ ;
CREATE TRIGGER DATABASE_ON_CONNECT
ACTIVE ON CONNECT POSITION 0
AS
BEGIN
END^
SET TERM ; ^
=====================================
2- Try to update the Database On Connect Trigger using the following DDL script:
=====================================
SET TERM ^ ;
ALTER TRIGGER DATABASE_ON_CONNECT ACTIVE
ON CONNECT POSITION 0
AS
BEGIN
END^
SET TERM ; ^
=====================================

IMPORTAN NOTES:
-This issue is NOT reproducible on Firebird 2.5.9

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Vlad Khorsun added a comment - 20/Jan/20 02:43 PM
It is not allowed to change type of DATABASE trigger.
In FB 2.5 the check was run at execution step of ALTER TRIGGER statement.
In FB 3 the syntax of ALTER TRIGGER was changed to not allow to specify new type for DATABASE triggers.

This works in all Firebird versions:

ALTER TRIGGER DATABASE_ON_CONNECT ACTIVE
AS
BEGIN
END
^

CREATE OR ALTER TRIGGER DATABASE_ON_CONNECT ACTIVE
ON CONNECT POSITION 0
AS
BEGIN
END
^

Luciano Mendes added a comment - 20/Jan/20 03:16 PM
Hi Vlad Khorsun

Thank you very much for you prompt reply!
I just follows your suggestion an I could confirm that works.

Could you please address this issue for the documentation team to update the http://firebirdsql.org/file/documentation/reference_manuals/fblangref25-en/html/fblangref25-ddl-trgr.html#fblangref25-ddl-trgr-dbtrigger reference and after the documentation update close this issue?

Best Regards,
Luciano