Delete from tables with no primary key
Brought to you by:
ansgarbecker
Originally created by: dominik....@googlemail.com
What is the problem that needs to be solved (required)?
I would like to delete some rows from a table that does not contain a
PRIMARY KEY. This used to be possible in HeidiSQL 3.
What is the idea in abstract terms (optional)?
In phpMyAdmin the feature works as follows: If there is no primary key,
the DELETE query simply includes all data fields, e.g.,
DELETE FROM a WHERE f1="test" AND f2=3 AND f3=21 LIMIT 1.
I am not sure, if this was the solution in the old version. However, by
using the LIMIT, even identical entries are no problem: There by
definition is no inherent order in database entried.
Greetings
Dominik
Tickets: #1495
Tickets: #1565
Tickets: #1578
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: a...@anse.de
> However, by using the LIMIT, even identical entries are no problem
Really? :) Indeed that is dangerous - you'll never know which row you're deleting,
and which comes first. For security reasons that was disabled in the recent releases.
On the other side this fact should teach users to create reasonable primary or unique
keys for their tables.
Status: WontFix
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: dominik....@googlemail.com
Yes, I guessed that this feature was disabled for security reasons. Maybe a warning
before deleting would also do.
However, by definition two entries with the same data in a database are absolutely
equal (there is no natural order in the database). Therefore it is irrelevant, which
one of the two is deleted.
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: a...@anse.de
Oh ok I see, yes that would indeed make sense then.
Status: Accepted
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: dominik....@googlemail.com
Thanks a lot for accepting the issue - this will save me (and hopefully many other
users) some trouble :)
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: a...@anse.de
Issue 1495 has been merged into this issue.
Related
Tickets:
#1495View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: a...@anse.de
Issue 1565 has been merged into this issue.
Related
Tickets:
#1565View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: a...@anse.de
Issue 1578 has been merged into this issue.
Related
Tickets:
#1578View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: a...@anse.de
Just started working on this issue, so it will go into the 5.0 GA release.
There will only be one situation left where editing is blocked - when you have
deselected columns from being displayed. Hmm, I could just hide these columns, but
select them, so they are available internally.
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: a...@anse.de
This issue was closed by revision [r3165].
Status: Fixed
Related
Commit: [r3165]
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: a...@anse.de
Done. Was easier to implement than I thought. Feel free to mess up your key-less
tables now :)
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: dominik....@googlemail.com
Great! thanks a lot :)