MySQL DOES provide that option for ad hoc queries. It's called
--safe-updates (or --i-am-a-dummy). As others have pointed out, we've
all made that mistake once. Those of us who run ad hoc queries
all the time, sometimes at 1AM, have made the mistake more than once.
Although I normally hate "idiot proof" systems and "are you sure" dialogs,
I like this option. You should always be careful, but even being careful
you'll make perhaps one error per thousand hours. If you spend 50 hours a
week logged in as root on production systems, one error per thousand hours
is 2 1/2 major screw ups per year. For that reason, and one other, we find
--safe-updates to be very useful.
There are two reasons that it's more useful than most MS confirmation
messages. First it catches something that is most likely to be an error,
unlike "are you sure you want to delete that file?". Most file deletes
really are desired, so the confirmation is an annoyance. Most "delete from
users" , if missing a where clause, really is an error. Secondly, it points
out exactly what the likely problem is - the missing where clause. It's
as if the file delete confirmation was smart enough to say "that's the brand
new updated copy, not the old copy you think you're deleting. Do you really
want to delete the new copy, or did you intend to delete the old one instead?"
Anyway, generally I hate "idiot proof", but I like --safe-updates, and
if it's an option those who don't want it need not use it. My one concern
is that if you constantly work on a system that DOES have the feature,
someone might get sloppy and be in trouble when they switch to a system
without it, such as switching from MySQL to MSSQL.
Scratch the last caveat - no one in their right mind would switch to MS after
becoming familiar with open source. :)