getExpectedJdbcType
MariaDB-specific deviations from the default type mapping:
INT UNSIGNEDdoes not fit anInt(0 .. 2^32 - 1), so it is read asLong, andBIGINT UNSIGNEDdoes not fit aLong(0 .. 2^64 - 1), so it is read asjava.math.BigInteger. The driver returns exactly those types for them.SMALLINTis read asShort, which is what the driver reports and returns for it.A multi-bit
BIT(M)column is read asByteArray, because that is what the driver returns for it while reportingbyte[]— the source-code spelling, not the"[B"JVM binary name the default mapping looks for — as the column class. SeeisMultiBitand #2087.TINYBLOB/BLOB/MEDIUMBLOB/LONGBLOBare read asByteArray: the driver reportsjava.sql.Blobas their column class whileResultSet.getObjectreturns abyte[](#2087). For those columns the driver reportsVARBINARY/LONGVARBINARYas the JDBC type, neverjava.sql.Types.BLOB, and that is what the condition keys on — so H2 in MariaDB mode, which delegates its mapping here, reportsjava.sql.Types.BLOBand does return realjava.sql.Blobvalues, keeps mapping tojava.sql.Blob.
Everything else falls through to DbType.getExpectedJdbcType.
The driver is also known to report java.lang.Integer for a BIGINT column whose stored values happen to fit in an Int; that case is not handled here. The SQLite analogue of it is (see Sqlite.generateConverter), so the fix pattern exists if this turns out to bite.