Hi
When using the mysql2 driver and executing an INSERT query with returningLastInsertedId, I encounter the following behavior:
- If I insert a single record, the ID is returned as expected.
- However, when attempting to insert multiple records, an error occurs due to the structure of the response from the mysql2 driver.
In the method AbstractQueryRunner.executeInsertReturningMultipleLastInsertedId, the code expects rows to be an array. However, the mysql2 driver returns an object containing the insert information. As a result, I receive the following error:
rows.map is not a function
The screenshot attached shows the response object received from the mysql2 driver in the top left corner.
Steps to Reproduce:
- Use the mysql2 driver.
- Attempt to insert multiple records with
returningLastInsertedId.
Expected Behavior: executeInsertReturningMultipleLastInsertedId should correctly handle the response when inserting multiple records.
Actual Behavior: An error occurs because the response is an object, and rows.map fails.

Hi
When using the mysql2 driver and executing an INSERT query with
returningLastInsertedId, I encounter the following behavior:In the method
AbstractQueryRunner.executeInsertReturningMultipleLastInsertedId, the code expects rows to be an array. However, the mysql2 driver returns an object containing the insert information. As a result, I receive the following error:The screenshot attached shows the response object received from the mysql2 driver in the top left corner.
Steps to Reproduce:
returningLastInsertedId.Expected Behavior:
executeInsertReturningMultipleLastInsertedIdshould correctly handle the response when inserting multiple records.Actual Behavior: An error occurs because the response is an object, and
rows.mapfails.