how to set a update warning for update too many rows
I wanna to stop these query which will update more than 10k row at once.
just like mysql workbench, if i update a table without where cond开发者_高级运维ition, it will give me a warning and stop execute the sql.
there is no built-in function for this
before you sending the update statement,
you will need to execute the filter condition (ie . SELECT COUNT(*) FROM TBL WHERE...
in order to get the count of matched rows
from there, you can determine whether it should prompt a warning or not
精彩评论