Problem
WP_MySQL_On_SQLite::lastInsertId() snapshots SQLite's last row ID, but SQLite and PDO MySQL differ in several cases:
- A multi-row insert returns SQLite's last generated ID; PDO MySQL returns the first.
- An insert into a table without
AUTO_INCREMENT can expose a SQLite row ID; PDO MySQL returns "0".
- A fully ignored insert can expose a stale or advanced SQLite ID; PDO MySQL returns
"0".
The PDO coverage work in #471 handles initialization, operation resets, and isolation from internal SQLite writes, but not these differences.
Expected behavior
Derive the ID from the user-issued MySQL INSERT or REPLACE operation rather than directly exposing SQLite's connection-level last row ID.
Add coverage for single-row, multi-row, explicit-ID, non-auto-increment, ignored, replace, and duplicate-key-update cases.
Problem
WP_MySQL_On_SQLite::lastInsertId()snapshots SQLite's last row ID, but SQLite and PDO MySQL differ in several cases:AUTO_INCREMENTcan expose a SQLite row ID; PDO MySQL returns"0"."0".The PDO coverage work in #471 handles initialization, operation resets, and isolation from internal SQLite writes, but not these differences.
Expected behavior
Derive the ID from the user-issued MySQL
INSERTorREPLACEoperation rather than directly exposing SQLite's connection-level last row ID.Add coverage for single-row, multi-row, explicit-ID, non-auto-increment, ignored, replace, and duplicate-key-update cases.