[MDEV-26037] RETURNING clause get the wrong last_insert_id() value Created: 2021-06-29 Updated: 2021-07-01 Resolved: 2021-07-01 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Server |
| Affects Version/s: | 10.5.9 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Zichao Lin | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
centos |
||
| Description |
|
Using RETURNING get the wrong last_insert_id(). I am not sure if this is a correct semantic. How to repeat:
As we can see, we can't get the latest last_insert_id() using returning. |
| Comments |
| Comment by Alice Sherepa [ 2021-07-01 ] |
|
This is not a bug as "The currently executing statement does not affect the value of LAST_INSERT_ID()" https://mariadb.com/kb/en/last_insert_id/. |