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

Regression: Can not run ALTER TABLE DROP CONSTRAINT <FK_name> after recent changes in svn [CORE4418] #4740

Closed
firebird-automations opened this issue May 5, 2014 · 8 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Assigned to: Claudio Valderrama C. (robocop)

Seems that this:
---- http://svn.code.sf.net/p/firebird/code/firebird/trunk/ChangeLog ---
2014-05-01 05:55 robocop
M src/jrd/vio.cpp
More sys tables protected.
----

-- prevent us from dropping foreign key:

SQL> create database '192.168.0.220/3330:/var/db/fb30/tmp201405051238.fdb'; commit;
SQL> create table td(id int primary key using index td_pk, pid int, constraint td_fk foreign key(pid) references tm(id) using index td_fk);
SQL> commit;
SQL> show table td;
ID INTEGER Not Null
PID INTEGER Nullable
CONSTRAINT TD_FK:
Foreign key (PID) References TM (ID)
CONSTRAINT INTEG_4:
Primary key (ID) uses explicit ascending index TD_PK

SQL> alter table td drop constraint td_fk;
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-ALTER TABLE TD failed
-DELETE operation is not allowed for system table RDB$REF_CONSTRAINTS
-At trigger 'RDB$TRIGGER_10'

PS.

SQL> show version;
ISQL Version: LI-T3.0.0.31099 Firebird 3.0 Alpha 2
Server version:
Firebird/Linux/AMD/Intel/x64 (access method), version "LI-T3.0.0.31099 Firebird 3.0 Alpha 2"
Firebird/Linux/AMD/Intel/x64 (remote server), version "LI-T3.0.0.31099 Firebird 3.0 Alpha 2/tcp (oel64)/P13"
Firebird/Linux/AMD/Intel/x64 (remote interface), version "LI-T3.0.0.31099 Firebird 3.0 Alpha 2/tcp (oel64)/P13"
on disk structure version 12.0

Commits: e6d3b34 FirebirdSQL/fbt-repository@2462cfc

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Claudio Valderrama C. [ robocop ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

One more sorrowful case: now I can`t RESTORE simple database from just created .fbk

$ /opt/fb30/bin/isql -q
SQL> create database 'ttt.fdb'; commit;
SQL> create table tm(id int primary key);
SQL> create table td(id int primary key, pid int references tm);
SQL> create view v1 as select http://m.id,count(d.pid) cnt from tm m left join td d on m.id=d.pid;
SQL> create view v1 as select http://m.id,count(d.pid) cnt from tm m left join td d on m.id=d.pid group by 1;
SQL> commit;
SQL> set term ^;
SQL> create or alter procedure p1 returns(id int, cnt int) as
CON> begin
CON> for select id, cnt from v1 into id, cnt do suspend;
CON> end^
SQL> create or alter procedure p2 returns(id int, cnt int) as
CON> begin
CON> for select id, cnt from p1 into id, cnt do suspend;
CON> end^
SQL> set term ;^
SQL> commit;
SQL> exit;

$ /opt/fb30/bin/gbak -b /var/db/fb30/ttt.fdb /var/db/fb30/ttt.fbk

$ /opt/fb30/bin/gbak -c /var/db/fb30/ttt.fbk /var/db/fb30/ttt.fdb.tmp
gbak: ERROR:DELETE operation is not allowed for system table RDB$DEPENDENCIES
gbak:Exiting before completion due to errors

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

summary: Can not run ALTER TABLE DROP CONSTRAINT <FK_name> after recent changes in svn => Regression: Can not run ALTER TABLE DROP CONSTRAINT <FK_name> after recent changes in svn

@firebird-automations
Copy link
Collaborator Author

Commented by: @sim1984

Unfortunately the problem with the system tables still have

Use CONNECT or CREATE DATABASE to specify a database
SQL> connect 'localhost:test' user 'sysdba' password 'masterkey';
Database: 'localhost:test', User: sysdba
SQL> show version;
ISQL Version: WI-T3.0.0.31126 Firebird 3.0 Alpha 2
Server version:
Firebird/Windows/AMD/Intel/x64 (access method), version "WI-T3.0.0.31126 Firebird 3.0 Alpha 2"
Firebird/Windows/AMD/Intel/x64 (remote server), version "WI-T3.0.0.31126 Firebird 3.0 Alpha 2/tcp (Den-PC)/P13:C"
Firebird/Windows/AMD/Intel/x64 (remote interface), version "WI-T3.0.0.31126 Firebird 3.0 Alpha 2/tcp (Den-PC)/P13:C"
on disk structure version 12.0
SQL> create table t(id bigint);
SQL> create view v as select id from t;
SQL> create or alter view v as select id+1 as id from t;
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-CREATE OR ALTER VIEW V failed
-DELETE operation is not allowed for system table RDB$VIEW_RELATIONS
SQL>

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

Seems that all issues mentioned above are fixed in LI-T3.0.0.31129

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

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

resolution: Fixed [ 1 ]

Fix Version: 3.0 Beta 1 [ 10332 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: Done successfully

@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