Editing joined resultset

BubikolRamios posted 2 years ago in Feature discussion
Namely this is security risk. But:

table a table b

id f id f
1 foo 1 foo1

select a.id,a.f,b.id.b.f from a join b on a.id = b.id


1 foo 1 foo1

We select foo and try to change it to 'something else'

1.Check if there are multiple rows:
select count(*) from a where id = 1 and f = 'foo' and ...
all fields of a if there are more.

Abort update with some message if that is > 1
(OK TOAD here has no problem,as I think it creates its own temporary index column, but I could live without that (-:)

2. Else Do update

update a set f = 'something else 'where id = 1 and f = 'foo' and ... all fields of a if there are more.

If referenial integrety or uniquesnes set by indexes or ...
would be breaken, step 2 would fail by db error.

All the rest of bad things not accounted before, are db admin responsibility.

Just some thoughts to make anse think of getting this into heidi (-:

Please login to leave a reply, or register at first.