#2782 - Support MariaDB jdbc driver update - Batched JDBC SQLException translation, SqlRow BLOB reading

- Batched JDBC SQLException translation - Need to dig into nested exception to get cause error state
- SqlRow BLOB reading - BLOB can come as LONGVARBINARY (TestRawSqlBuilder)
- Fix test for history using system time (TestHistoryInsert)
- Fix SqlQueryCancelTest
- Fix TestSqlUpdateExceptions
This commit is contained in:
Rob Bygrave
2022-08-17 17:25:28 +12:00
parent ff45f9ab63
commit 51d2f52d19
8 changed files with 28 additions and 21 deletions
@@ -32,7 +32,12 @@ public class SqlCodeTranslator implements SqlExceptionTranslator {
}
private DataErrorType getErrorType(SQLException e) {
DataErrorType errorType = map.get(e.getSQLState());
String sqlState = e.getSQLState();
while (sqlState == null && e.getCause() instanceof SQLException) {
e = (SQLException)e.getCause();
sqlState = e.getSQLState();
}
DataErrorType errorType = map.get(sqlState);
if (errorType == null) {
// fall back to error code
errorType = map.get(String.valueOf(e.getErrorCode()));