What I meant to write:
UPDATE items_ordered_list ords
SET ords.last_ordered='2019-10-16 10:49:23'
WHERE ords.cust_id='11656165';
What I actually wrote:
UPDATE items_ordered_list ords
SET ords.last_ordered='2019-10-16 10:49:23'
WHERE ords.cust_id-'11656165';
Instead of giving me some sort of error that the WHERE clause wasn't a logical expression - it just happily went along updating everything. I have a backup - and a way to recover the previous value - but - the "-" is adjacent to the "=" on the keyboard - took me a while to see this.
I tried it with a SELECT / LIMIT statement - and sure enough - it brought back as many records as I set in the LIMIT...
Is this a flaw...or "by design"? Is there some way that "ords.cust_id-'11656165'" evaluates to "TRUE"???
Please let me know - usually, for big / dangerous updates, I'll do a SELECT or EXPLAIN first - just to be sure that the SCOPE returned is reasonable - this little bit of code, I just change the cust_id - but - I accidentally deleted the "=" - and when I re-typed it - I (obviously) made a typo...any help / advice will be appreciated!!!
Thanks!