Issue Details (XML | Word | Printable)

Key: CORE-4418
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Claudio Valderrama C.
Reporter: Pavel Zotov
Votes: 0
Watchers: 1
Operations

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

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

Created: 05/May/14 09:29 AM   Updated: 23/Sep/15 11:22 AM
Component/s: Engine
Affects Version/s: 3.0 Alpha 2
Fix Version/s: 3.0 Beta 1

QA Status: Done successfully


 Description  « Hide
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


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Pavel Zotov added a comment - 05/May/14 04:06 PM
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 m.id,count(d.pid) cnt from tm m left join td d on m.id=d.pid;
SQL> create view v1 as select 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

Simonov Denis added a comment - 10/May/14 01:04 PM
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>

Pavel Zotov added a comment - 12/May/14 06:30 PM
Seems that all issues mentioned above are fixed in LI-T3.0.0.31129