Details
Description
getBestRowIdentifier() builds its result from INFORMATION_SCHEMA.COLUMNS without an ORDER BY clause, so the row order is whatever the server's natural order for that table happens to be.
MariaDB returns the columns in table order, but MySQL 9.7 returns them differently: for a table with PRIMARY KEY (TBL_ID, PKEY_NAME), the result lists PKEY_NAME before TBL_ID. Applications that rebuild a row identifier from this metadata in the returned order, or compare it with getPrimaryKeys() / getIndexInfo(), get an inconsistent column order depending on the server.
The JDBC specification only requires these rows to be ordered by SCOPE, which is identical for every row here, so the relative order of the columns was effectively undefined.