[MDEV-11033] "follows" does not show up in "show create trigger" output Created: 2016-10-11 Updated: 2018-08-31 Resolved: 2016-10-11 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Triggers |
| Affects Version/s: | 10.2.3 |
| Fix Version/s: | 10.2.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alvin Richards (Inactive) | Assignee: | Michael Widenius |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | Compatibility, need_feedback | ||
| Environment: |
Centos7 |
||
| Issue Links: |
|
||||||||
| Description |
| Comments |
| Comment by Elena Stepanova [ 2016-10-11 ] | ||||||||||||||
|
alvinr, are you sure about that? Having FOLLOWS / PRECEDES in the trigger definition will do literally nothing good at all, and the price will be that it will break the dump.
The dump will look like this:
So, the order is preserved in the dump and will be restored properly. But assume we would still have FOLLOWS clause in the definition:
After restoring the dump, tr2 and tr3 will be swapped. | ||||||||||||||
| Comment by Alvin Richards (Inactive) [ 2016-10-11 ] | ||||||||||||||
|
elenst this was found as part of testing
http://dev.mysql.com/doc/refman/5.7/en/trigger-syntax.html The assumption would be that is the order is specified, then at execution time the order is followed. Therefore a dump and restore would also need to preserve this order. Showing this clause in the "show create tigger" is just a usability issue for that command. You may have found additional issues that need to be tested and verified. It may also be worth checking what MySQL 5.7 does in this regard. | ||||||||||||||
| Comment by Elena Stepanova [ 2016-10-11 ] | ||||||||||||||
|
alvinr, the current implementation complies with the quote above, but it has nothing to do with SHOW CREATE output.
The whole point of my previous example was to demonstrate that the dump and restore do preserve the order now, but if this JIRA request is implemented, they won't be able to.
Now, after trigger tr1 is dropped, tr2 automatically becomes the first trigger, and all is well. But if we had the FOLLOWS clause in the definition, the definition would have become invalid. All in all, I wouldn't say that showing FOLLOWS in SHOW CREATE is a usability improvement; on the contrary, it will make the definition unreliable and force a user to edit it manually.
Nothing, naturally MySQL doesn't preserve PRECEDES / FOLLOWS in SHOW CREATE. I suppose if there is a real justified demand to see it in SHOW CREATE, it can be put there as a comment (not executable comment!). But frankly I don't know why it can be needed at all, it's really only relevant at the time of creation. | ||||||||||||||
| Comment by Alvin Richards (Inactive) [ 2016-10-11 ] | ||||||||||||||
|
Confirming with MySQL 5.7.15, that "show create trigger" does not include the "following" expression. Therefore closing this as not a bug. MySQL 5.7.15 output
|