-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
Delete from view only deletes a single record, not all matching records #6993
Comments
Duplicate for #6838? |
It should be already fixed in snapshot builds. |
Server Version InfoServer Version: WI-V4.0.0.2496 Firebird 4.0 full reproduce! |
Firebird-4.0.1.2623 full reproduce |
Just tested with LI-V4.0.1.2622, three rows are deleted. |
Yes !!! Server Version InfoServer Version: WI-V4.0.1.2623 Firebird 4.0 |
mrotteveel
changed the title
FB4 delete from view.
Delete from view only deletes a single record, not all matching records
Oct 6, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
create domain id integer not null;
create domain name varchar(40) not null;
create table R(id id, name name, constraint R_PK primary key(id));
create table D(id id, rid id, DT timestamp not null, constraint D_pk primary key(id), constraint D_R_FK foreign key(rid) references R(id));
create table DD(DID id, DIDX id, fld0 integer, fld1 integer, fld2 integer, fld3 integer, constraint DD_PK primary key(DID, DIDX), constraint DD_D_FK foreign key(DID) references D(id));
create view VDD as
select DD.*, D.DT ddt, R.id rid from dd
inner join D on D.id=dd.did
inner join r on d.rid=r.id;
set term ^ ;
CREATE OR ALTER trigger VDD_BD for VDD
active before delete position 0
as begin
delete from DD where DD.did=old.did and dd.didx=old.didx;
end^
insert into R values (1, '1')^
insert into D values (1, 1, current_timestamp)^
insert into dd values (1, 1, 1, 1, 1, 1)^
insert into dd values (1, 2, 1, 1, 1, 1)^
insert into dd values (1, 3, 1, 1, 1, 1)^
insert into dd values (1, 4, 1, 1, 1, 0)^
insert into dd values (1, 5, 1, 1, 1, 1)^
insert into dd values (1, 6, 1, 1, 1, 1)^
insert into dd values (1, 7, 1, 1, 1, 1)^
insert into dd values (1, 8, 1, 1, 1, 0)^
insert into dd values (1, 9, 1, 1, 1, 1)^
insert into dd values (1, 10, 1, 1, 1, 1)^
insert into dd values (1, 11, 1, 1, 1, 1)^
insert into dd values (1, 12, 1, 1, 1, 0)^
commit^
delete from vdd where did=1 and fld3=0^-- The query only deletes one line!!!!!!!!!!!!
--delete from vdd; The query only deletes one line
commit^
/*CREATE VIEW sVDD(
DID,
DIDX,
FLD0,
FLD1,
FLD2,
FLD3)
AS
select * from dd^
--delete fro svdd-- is work;
*/
The text was updated successfully, but these errors were encountered: