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

Wrong syntax with CREATE TRIGGER ... ON <table> used with POSITION [CORE5545] #5813

Closed
firebird-issue-importer opened this issue May 18, 2017 · 8 comments

Comments

@firebird-issue-importer

Submitted by: @asfernandes

I understand that "ON <table>" is complement part to BEFORE INSERT, so POSITION must be after both, not in the middle.

Test case:

recreate table t (n integer);

-- works
recreate trigger t1 before insert position 1 on t as begin end;

-- don't work
recreate trigger t1 before insert on t position 1 as begin end;

Commits: 92be5d3

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 18, 2017

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 18, 2017

Commented by: @mrotteveel

Although you are right, please ensure this is fixed in a backwards compatible way, as this has been this way since the introduction of SQL:2003-style create trigger in Firebird 2.1

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 18, 2017

Commented by: @asfernandes

Clauses could be made to be anywhere, but definitelly it would be wrong to have POSITION in the middle of something.

My opinion is to fix the error in v4. People should test their applications when migrating major versions and DDL is more flexible to changes.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jun 5, 2017

Modified by: @asfernandes

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

resolution: Fixed [ 1 ]

Fix Version: 4.0 Alpha 1 [ 10731 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jun 22, 2017

Commented by: @pavel-zotov

It seems that now one can NOT to use old syntax of [re]create trigger DDL.

This is what i see in the build of 24-may-2017:

C:\MIX\firebird\QA\fbt-repo\tmp>C:\MIX\firebird\FB40Cs\isql /:e40 -z -i c5545.sql
ISQL Version: WI-T4.0.0.651 Firebird 4.0 Unstable
Server version:
WI-T4.0.0.651 Firebird 4.0 Unstable
WI-T4.0.0.651 Firebird 4.0 Unstable/tcp (csprog)/P16
WI-T4.0.0.651 Firebird 4.0 Unstable/tcp (csprog)/P16

recreate table test\(id int\);

\-\- worked always:
recreate trigger test\_bi before insert
                 position 1
                 on test
as begin end;

-- did NOT work before fix core-5545, must work now:
recreate trigger test_bi before insert
on test
position 1
as begin end;
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 3, column 21
-position
At line 13 in file c5545.sql

(and this is expected on THAT build)

But on current build (19-jun-2017) we have:

C:\MIX\firebird\QA\fbt-repo\tmp>C:\MIX\firebird\FB40\isql /:e40 -z -i c5545.sql
ISQL Version: WI-T4.0.0.680 Firebird 4.0 Alpha 1
Server version:
WI-T4.0.0.680 Firebird 4.0 Alpha 1
WI-T4.0.0.680 Firebird 4.0 Alpha 1/tcp (csprog)/P16
WI-T4.0.0.680 Firebird 4.0 Alpha 1/tcp (csprog)/P16

recreate table test\(id int\);

\-\- worked always:
recreate trigger test\_bi before insert
                 position 1
                 on test
as begin end;

Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 2, column 22
-position
At line 6 in file c5545.sql

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jun 22, 2017

Modified by: @pavel-zotov

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

QA Status: No test => Deferred

Test Details: See comment 22/Jun/17 05:11 AM

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 6, 2020

Modified by: @pavel-zotov

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

QA Status: Deferred => Done successfully

Test Details: See comment 22/Jun/17 05:11 AM =>

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 6, 2020

Modified by: @pavel-zotov

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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants