!!! Bad Subquery == Delete ALL !!!
Posted in 1995
Topics: SQL Development & Query Writing
Hi there-
I recently executed the following query on my Informix database:
delete from BLOBtable where PageNumber in
(select PageNumber from DocumentTable where DocumentID=66272)
Now as it turns out, there is no PageNumber field in my DocumentTable table, so
the subquery failed. Instead of returning an error, the Informix engine DELETED
ALL THE BLOBS IN MY BLOB TABLE (imaging my surprise when instead of seeing "11
rows deleted" I saw "1700 rows deleted")!!!!!
Is this a bug, or what?
Andrew
+----------------------------------+-----------------------------------+
| Andrew Miller | TASC |
| mailto:amiller@tasc.com | 55 Walkers Brook Drive |
| (617)942-2000 x2011 | Reading, MA 01867 |
+----------------------------------+-----------------------------------+
| Control for smilers can't be bought. |
+----------------------------------------------------------------------+