-
Type:
Improvement
-
Status: Done
-
Priority:
Medium
-
Resolution: Invalid
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:
MySQL < 8.0 doesn't support multiple triggers per timing+event. If the table to alter already has triggers, pt-osc fails. Maybe keeping this as default behaviour is the best idea, but I think at least 2 approaches are possible to deal with existing triggers:
- Optionally append code to existing triggers
- Optionally replace existing triggers with triggers provided by the user
(this is not a XOR: in most cases option 1 is fine, in special cases user may prefer option 2)
Of course if we DROP+CREATE triggers, for a short period of time no trigger will exist on the table, BUT:
- MariaDB 10.1+ supports CREATE OR REPLACE TRIGGER, which is atomic
- I don't know any safer way to achieve the purpose (except for setting the database in maintenance), so the user should be free to take the risk