[MDEV-24429] update trigger don't fire on "replace" Created: 2020-12-17 Updated: 2020-12-20 Resolved: 2020-12-20 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - RocksDB |
| Affects Version/s: | 10.5.8 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Philip orleans | Assignee: | Alice Sherepa |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux |
||
| Description |
|
This maybe is by design, but it is conceptually a bug. |
| Comments |
| Comment by Alice Sherepa [ 2020-12-17 ] |
|
According to KB here : BEFORE INSERT; So UPDATE trigger will not be fired, but DELETE+INSERT. |
| Comment by Sergei Golubchik [ 2020-12-20 ] |
|
This is by design. REPLACE is defined as DELETE+INSERT. It can be internally optimized to be one row operation (UPDATE) instead of two (DELETE+INSERT) but internal optimizations should never have user visible effects. If you have triggers, it will always invoke DELETE and INSERT triggers, because this is how REPLACE is defined. |