sqlite-jdbc does not comply with JDBC Specification regarding Appendix B.1, B.2, & B.3
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start by reading the JDBC specification mappings in Appendix B.1, B.2, and B.3 and trace how this driver implements ResultSetMetadata#getColumnType(int), ResultSet#getObject(int), and getObject(int, Class<?>). Compare the reported DATE and CLOB cases against those mappings, then check the existing tests for these APIs. Done means the returned objects and typed retrieval behavior comply with the specification for the affected JDBC types.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
TLDR: Column values obtained from getObject should match the types from getColumnType(int), but they often do not.
Referring to JDBC 4.x Specification. (Same mappings exist in JDBC 3 Specification)
According to the spec:
Appendix Table B.3
JDBC Types Mapped to Java Object Types
The
getObjectmethods for both theCallableStatementandResultSetinterfaces use the mapping in TABLE B-3
JDBC Type Java Object Type CHAR StringVARCHAR StringLONGVARCHAR StringNUMERIC java.math.BigDecimalDECIMAL java.math.BigDecimalBIT BooleanBOOLEAN BooleanTINYINT IntegerSMALLINT IntegerINTEGER IntegerBIGINT LongREAL FloatFLOAT DoubleDOUBLE DoubleBINARY byte[]VARBINARY byte[]LONGVARBINARY byte[]DATE java.sql.DateTIME java.sql.TimeTIMESTAMP java.sql.TimestampDISTINCT Object*CLOB java.sql.ClobBLOB java.sql.BlobARRAY java.sql.ArraySTRUCT StructorSQLDataREF java.sql.RefDATA_LINK java.net.URLJAVA_OBJECT Object*ROWID java.sql.RowIdNCHAR StringNVARCHAR StringLONGNVARCHAR StringNCLOB java.sql.NClobSQLXML java.sql.SQLXML
The problem is calls to ResultSetMetadata#getColumnType(int) don't align with calls to ResultSet#getObject(int). Generally, Sqlite's implementation of getObject(int) does not adhere to Table B.3.
For instance, if I call getColumnType(int) and get back Types.DATE, the JDBC specification states that I can expect values of type java.sql.Date for that column. However, if I call getObject(int) for a row including that column, sqlite returns a value of type java.lang.String.
Similarly, calls to getColumn(int, Class<?>) are not covered. If getColumnType(int) returns Types.CLOB and getObject(int, Class<?>) is called with java.sql.Clob for the same column, a SQLFeatureNotSupportedException("not implemented by SQLite JDBC driver") results because getColumn(int, Class<?>) does not handle java.sql.Clob.
This behavior does not appear to comply with the specification (both 3 & 4), but more importantly this behavior complicates writing type-safe code generators that work with sqlite db connections.
- Lingua principale
- Java
- Stelle
- 3.3k
- Fork
- 676
- Merge medio
- 1g 15h
- PR unite (30g)
- 18
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di xerial/sqlite-jdbc
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
xerial/sqlite-jdbc#1515 ·
I maintainer di solito rispondono entro 1 giorno
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
xerial/sqlite-jdbc#1514 ·
I maintainer di solito rispondono entro 1 giorno
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
xerial/sqlite-jdbc#1513 ·
I maintainer di solito rispondono entro 1 giorno
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
xerial/sqlite-jdbc#1512 ·
I maintainer di solito rispondono entro 1 giorno
-
SIGSEGV (exit 134) in bundled `rightstr()` when the length argument is a large negative numberForse già presa @sarthakdev143-lite l’ha presa 1 giorno fa. Apertahelp wanted impacts:JNI
Difficoltà 4/5 1-2 giorni Idoneità per principianti 38/100
xerial/sqlite-jdbc#1508 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di xerial/sqlite-jdbc
Issue simili
-
Area/Configuration Type/Improvement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
ballerina-platform/static-code-analysis-tool#217 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
eclipse-dirigible/dirigible#8636 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug severity-medium XS
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
nikolas-charalambidis/facepalm-maven-plugin#291 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
OakLoaf/PluginUpdater#264 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: withStartupTimeout() changes the startup timeout of all containers that use the default wait strategyForse già presa @aymenjamaaoui l’ha presa oggi. Apertatype/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
testcontainers/testcontainers-java#12171 ·
I maintainer di solito rispondono entro 1 giorno