Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.5.23
-
None
Description
Given a simple autoincrement table:
CREATE TABLE InsertIdTest ( |
id INT NOT NULL AUTO_INCREMENT, |
one VARCHAR(45) NULL, |
PRIMARY KEY (id) |
)
|
an insert query returns the lastInsertId in the response package so it's accessible by clients:
INSERT INTO InsertIdTest (one) VALUES ("Hello World") |
but inserting data with a INSERT ... RETURNING doesn't return the lastInsertId:
INSERT INTO InsertIdTest (one) VALUES ("Bye Bye") RETURNING * |
Instead afterwards either the lastInsertId has to be extracted from the returned resultset, which not neccessarily must include the ID column, or an additional query to select the lastInsertId has to be executed.
compare PHP PDO client issue: https://github.com/php/php-src/issues/11503
Attachments
Issue Links
- is blocked by
-
MDEV-32102 Permit to have intermediate EOF in resultset
- Open