-
Priyanka Sangam authored
For a delete query, mysqld does a range read to read all the PKs and ranges given in the query. If the range read does not return an error, the delete triggers are executed. The issue occurs because read before write removal is attempted with a delete query, on a table which has a delete trigger. The read is optimised away, so the range read cannot identify the empty range and return an end-of-file error. Since no error is returned, the delete trigger is executed even though no rows have been deleted. While running a delete or update query, there is a check to determine whether read before write removal should be used. Modified this check to disable read before write removal 1) for delete if the table has a delete trigger and 2) for update if the table has a update trigger. Reviewed-by:
Magnus Blaudd <magnus.blaudd@oracle.com>e> Reviewed-by:
Jon Olav Hauglid <jon.hauglid@oracle.com>
Priyanka Sangam authoredFor a delete query, mysqld does a range read to read all the PKs and ranges given in the query. If the range read does not return an error, the delete triggers are executed. The issue occurs because read before write removal is attempted with a delete query, on a table which has a delete trigger. The read is optimised away, so the range read cannot identify the empty range and return an end-of-file error. Since no error is returned, the delete trigger is executed even though no rows have been deleted. While running a delete or update query, there is a check to determine whether read before write removal should be used. Modified this check to disable read before write removal 1) for delete if the table has a delete trigger and 2) for update if the table has a update trigger. Reviewed-by:
Magnus Blaudd <magnus.blaudd@oracle.com>e> Reviewed-by:
Jon Olav Hauglid <jon.hauglid@oracle.com>
Loading