[CONJ-159] Rewrite batch is broken for prepared statements for binary data Created: 2015-05-29  Updated: 2015-06-23  Resolved: 2015-06-23

Status: Closed
Project: MariaDB Connector/J
Component/s: Other
Affects Version/s: 1.1.8
Fix Version/s: 1.1.9

Type: Bug Priority: Critical
Reporter: Vladislav Vaintroub Assignee: Diego Dupin
Resolution: Fixed Votes: 0
Labels: None


 Description   

Rewrite batch is broken for prepared statements. It is broken because it uses toSQL(), which is broken because it does corrupt binary data, they are not encoded as UTF8, and thus can not be converted to string easily.

I believe prepared statements can do without rewriteBatch for a while, and also that toSQL() in its current form needs to go (it will blow memory with streams and blobs)

. A cleaner alternative for prepared batching , perhaps or the future, is to combine multiple prepared statements into large one, e.g

st1 :insert into t values( ? ) , ps.setString(1,"a")
st2 : insert into t values( ? ), ps.setString(1,"b")

converts into
insert into t values( ? ),( ? ) ; ps.setString(1,"a"); ps.setString(2,"b")



 Comments   
Comment by Andy Shulman [ 2015-06-13 ]

How is this issue just buried on the bug tracker with no warnings anywhere else? You have a legitimate data corruption bug. I have over a month's worth of binary data that I cannot recover because I have '0x63's all over the place.

"I believe prepared statements can do without rewriteBatch for a while". That may be, but you need to disable rewriteBatch, not just let users data be silently corrupted.

Comment by Vladislav Vaintroub [ 2015-06-13 ]

Andy, to avoid misunderstandings, I, the bug reporter, am not on the team for almost 2 years. I can file a bug or two, or might comment on what current team members are doing, but ultimately I have no power to warn users about data corruption issues.

Comment by Andy Shulman [ 2015-06-13 ]

My comment was not addressed at you, and I apologize if you felt like it was. Even if you were still actively working on the code, the responsibility would still not be solely yours.

Comment by Vladislav Vaintroub [ 2015-06-13 ]

Changing prio to Critical, in attempt to gain some attention from Georg , or Diego I think this is the right priority for data corruption issues (although, the workaround of "not" using the rewriteBatch is trivial, too)

Comment by Diego Dupin [ 2015-06-20 ]

This has been seen during correction of CONJ-151 and corrected a few weeks ago.
This is fixed in the new version 1.1.9 ( jar available, maven will be available in a few hours)

Generated at Thu Feb 08 03:13:36 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.