My personal favorite, while deleting a record from a MySQL database i got something like 4000 rows affected instead of the 1 i expected. i took a close look at my query and realized i had run
Code:
delete from table where nodeid - 1234;
turned out i only had one row left in my db. Apparently, using minus deletes everything except the specified row. Now if you look at where minus and equal keys are on the keyboard and how similar they look, you would think this would be better documented behavior.
fortunately this was on the catalog of an ecommerce store, we were able to restore from backup in about 15 minutes and only lost a half day work for the product development team. if it had been the customer or orders table it would have been a much bigger deal.
we wrote scripts to handle most of our common database functions we had been doing from the shell after that.