Hi

(I posted this before, but it didn't show up in the group?)

Adding random strings to a CLOB column sometimes returns the wrong string. 
Here is working code example: http://www.mysticpaste.com/view/KAr0YNqKKZ?2

1. Create file database
2. Create table with CLOB column
3. Insert a 10.000 random java string
4. Read it back
-- repeat the above a couple of times until... ---
5. Compare it to the original. Sometimes they are wrong.,

This does not happen with VARCHAR(10000) or BLOB.
This does not happen with "mem" database.
It happens regardless of using "setString" or "setCharacterStream"

Removing high surrogate chars from the string make the problem go away. 
Like this:

String clean = data.replaceAll("\\p{C}", "?");
data = clean.replaceAll("\\p{InHigh_Surrogates}", "?");

Output from my example code:

Found a DIFF in iteration 1
DIFF: 4095  Org: ?, read: ?
      Org: 55318, read: 63
DIFF: 4096  Org: ?, read: ?
      Org: 56709, read: 63

Note the char position (4095, 4096). All tests shows this, it's either on 
4k or 8k boundary.

I'm using Apache commons RandomStringUtils to generate the string. Please 
note that the problem always occurs within the first few iterations, so it 
is easy to reproduce this way.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to