Closed horrendo closed 5 years ago
➜ ~ crystal --version
Crystal 0.29.0 (2019-06-06)
LLVM: 6.0.1
Default target: x86_64-apple-macosx
I'm having the same problem. Did you find a solution that you could apply directly? @horrendo
Sorry, I didn't find a solution. The 'cast-to-text' workaround is as close as I got.
Thanks @horrendo. Unfortunately, I will solve it that way.
I might take a look at this tomorrow.
I'm pretty sure this is reproducible.
In psql, create a test table with 10K UUID's:
Run this simple crystal program:
Running it:
I suspect it has something to do with buffer boundaries - but this is just a guess. If, for example I change the first select to:
Running it I get:
If I change the limit to 908 I get this:
Alternatively, if I cast the UUID column to TEXT in the initial select:
It works fine:
The actual data doesn't seem to matter. I can truncate and repopulate the table and it still fails the same number of times - albeit with different values. I did notice the 'corruption' of the uuid values does seem somewhat consistent. For example, here is another run after truncating and re-populating the table:
Note the corrupted id's have '0000' at the end in both cases on entries 1, 3, 6, 8 and 12.
In case it matters, I'm using postgres 10.4 and this version of crystal:
Cheers,
Steve