[MDEV-30737] REPLACE...RETURNING should provide access to the old row data Created: 2023-02-27 Updated: 2023-04-17 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Data Manipulation - Insert |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | Ashford Nichols | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | beginner-friendly | ||
| Issue Links: |
|
||||||||
| Description |
|
Given the schema:
The following statement returns the data of the newly inserted row (i.e. "third"):
There should be some way of accessing the old data that was deleted, perhaps using the 'OLD.<col_name>' syntax, as follows:
|
| Comments |
| Comment by Sergei Golubchik [ 2023-02-28 ] | |||
|
Unfortunately OLD. syntax doesn't work here, REPLACE can delete multiple rows:
It would be a good feature to be able to return deleted rows in REPLACE. But it's not clear what syntax can be used for it. |