Repository navigation
fix(jdbc): close the StatementTest conversion and batch gaps - #160
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #158
What changed
Three driver gaps from the
StatementTestre-triage now followjava.sql.LibsqlResultSet: empty or blank TEXT reads as SQLNULLforgetDate,getTime,getTimestamp, and theLocalDate/LocalTime/LocalDateTimetargets. Other unparseable text still throws.LibsqlStatementandLibsqlResultSet:setFetchDirectionacceptsFETCH_FORWARD,FETCH_REVERSE, andFETCH_UNKNOWN, and throwsSQLExceptionfor any other value.LibsqlStatement.executeBatch: a step whoseStmtResultcarries columns is a result set, so the batch throwsBatchUpdateExceptionwith the counts of the steps up to and including it.LibsqlPreparedStatementinherits the same path.Contract
Hrana 3 is the source of truth for transport, values, metadata, batching, transactions, and error reporting.
java.sqlis the source of truth for the JDBC surface. xerial/sqlite-jdbc 3.53.4.0 is the behavioral reference and conformance foundation, never a copy target.Red
New unit cases at the base, before the fix:
Vendored
StatementTestat the base, with the triage copy selected temporarily:Green
At head
853f9c484f03295b310630fab3eb7e634667f390:The five remaining cases are classified below. The three fixed cases are
emptyDate,setFetchDirectionBadArgument, andbatchReturnsResults.Full lanes:
Logs are in
/tmp/xerial-parity-i158/. The vendored tree is unchanged.Remaining failures and divergences
dateTimeTestis a reference divergence. xerial's defaultDateClass.INTEGERstoressetDateas epoch milliseconds, sogetDatereturns the originaljava.sql.Datemillis.java.sqldefines SQLDATEwithout a time, andjava.sql.Daterequires normalization to zero time before use. The test constructs a non-normalizedDate, so preserving millis is an xerial implementation detail, not a requirement. A probe against xerial 3.53.4.0 confirmed stored typeintegerand exact millis. The driver keeps thejava.sqldate-only value and does not copy this behavior.executeUpdateandmultipleStatementsare remote-model divergences. Hrana carries one statement perStmt, and sqld rejects multi-statement strings withSQL_MANY_STATEMENTS/ "SQL string contains more than one statement".tempTableis a remote-model divergence. sqld rejectsCREATE TEMP TABLEwithSQL_PARSE_ERROR/ "unsupported statement".failToDropWhenRSOpenis a remote-model divergence. Hrana streams are independent and the driver materializes rows, so an open result set does not hold a local SQLite read lock that blocksDROP.The later selection PR records these divergence lines. This PR does not edit the vendored test.
Files
libsql-jdbc/src/main/java/com/github/magnusp/libsql/jdbc/LibsqlResultSet.java,libsql-jdbc/src/main/java/com/github/magnusp/libsql/jdbc/LibsqlStatement.java,libsql-jdbc/src/test/java/com/github/magnusp/libsql/jdbc/LibsqlResultSetTest.java,libsql-jdbc/src/test/java/com/github/magnusp/libsql/jdbc/LibsqlStatementTest.java.Base
e172d2204c1bf57d80076067c93e7e4b6031f953, head853f9c484f03295b310630fab3eb7e634667f390.