We faced an issue while updating a table record.
We have provided WHERE condition to update 1 record in table. But in query there is no WHERE condition (its missed) while updating for that table. So query has updated all the 20 k records in table.
Query:
$result = $this->update($id, TABLE_NAME);
In log:
UPDATE `TABLE_NAME` SET `status` = 1, `user_id` = 322, `updated_by` = 'system'
Expected:
UPDATE `TABLE_NAME` SET `status` = 1, `user_id` = 322, `updated_by` = 'system' WHERE `TABLE_NAME`.`id` = '2454'
This logic is there from long time and it was working fine. At particular time the WHERE condition has broken and till now we are not able to replicate the issue.