[ 
https://issues.apache.org/jira/browse/OPENJPA-3061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18137498#comment-18137498
 ] 

ASF subversion and git services commented on OPENJPA-3061:
----------------------------------------------------------

Commit 25803a40bb24c37128fd275642c2d09a75c3ad89 in openjpa's branch 
refs/heads/OPENJPA-3061 from Richard Zowalla
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=25803a40b ]

[OPENJPA-3061] Write readers into CLOB columns on MariaDB with 
updateCharacterStream

MariaDB Connector/J returns a writer from Clob.setCharacterStream that
starts at a wrong byte position for a clob read from a result set and
fails with an ArrayIndexOutOfBoundsException once more than 8 KB are
written. Enable the LOB streaming tests on MariaDB.


> MariaDB: writing a Reader into a CLOB fails with 
> ArrayIndexOutOfBoundsException
> -------------------------------------------------------------------------------
>
>                 Key: OPENJPA-3061
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-3061
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jdbc
>            Reporter: Richard Zowalla
>            Assignee: Richard Zowalla
>            Priority: Major
>             Fix For: 4.2.0
>
>
> Writing a {{Reader}} into a CLOB field fails on MariaDB:
> {noformat}
> java.lang.ArrayIndexOutOfBoundsException: arraycopy: last destination index 
> 8193 out of bounds for byte[8192]
>       at 
> org.mariadb.jdbc.MariaDbBlob$BlobOutputStream.write(MariaDbBlob.java:448)
>       at java.io.OutputStreamWriter.write(OutputStreamWriter.java:206)
>       at org.apache.openjpa.jdbc.sql.DBDictionary.copy(DBDictionary.java:5947)
>       at 
> org.apache.openjpa.jdbc.sql.DBDictionary.updateClob(DBDictionary.java:5911)
>       at 
> org.apache.openjpa.jdbc.meta.strats.LobFieldStrategy.customInsert(LobFieldStrategy.java:128)
> {noformat}
> {{DBDictionary.updateClob}} selects the row with an updatable result set, 
> gets the {{Clob}} and writes through {{Clob.setCharacterStream(1)}}. The 
> writer returned by MariaDB Connector/J 3.5.11 overruns its own buffer once 
> more than 8 KB is written. Writing an {{InputStream}} into a BLOB works.
> The LOB tests ({{AbstractLobTest}}, {{TestReaderLob}}, 
> {{TestInputStreamLob}}) only run on MySQL and DB2, so this was not noticed. 
> {{TestReaderLob}} fails on MariaDB 12.3 with 12 errors when MariaDB is added 
> to the supported databases.
> Found while working on OPENJPA-3060.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
  • [jira] [Commented] (OPENJPA... ASF subversion and git services (Jira) via dev

Reply via email to