There is some weird SQL going on. Here’s the query:
UPDATE sugarcrm.qb_salesorders_leads_c c
JOIN qb_salesorders orders ON c.qb_salesorders_leadsqb_salesorders_idb = orders.id
SET c.qb_salesorders_leadsleads_ida = orders.memo
AND c.qb_salesorders_leadsqb_salesorders_idb = orders.id
So when I run this I get 0 rows affected. Now if I replace the AND with a , then it comes back and says 354 rows affected.
Now you would think when I run the same exact query with the , it would give me the same result. WRONG. It comes back with 0 rows affected.
After that I can change the , to AND and it works again.
Did I discover a MySQL Bug or am I missing something here?
The first time you ran the syntactically correct query with the comma, it correctly affected 354 rows. The reason it returns with 0 rows affected the second time is that the rows were already updated the first time you ran the query.
If the column values will not be changed by an
UPDATEquery, MySQL will not update the rows, and they won’t be counted in the affected rows. Only those whose values actually change are counted.