Closed Machado117 closed 1 year ago
I reproduced error with create table mytable(name bytea, age integer)
and such encryptor's config. Java driver sends string as VARCHAR (oid=1043) to store it in the database as TEXT. AcraServer captures db's response with BYTEA type and replace it to TEXT type (oid=25). And it is mismatch with driver expectations.
WIthout Acra database can cast some real types that it uses for storage to the types application sends if it can be casted as 1:1. For example if database stores 64 bit integer and application sends data as 32bit integer then database can return it as 32 bit integer. But cannot do it in opposite way: 32 -> 64.
For now, Acra maps str
data type to TEXT type from PostgreSQL. So you should send and deal with results as with TEXT, not VARCHAR types. I didn't find how to do it with java PostgreSQL driver quickly, because I'm not java developer. I will try to find it one more time in driver's docs more deeply, but a bit later.
I see, it works if instead I encrypt the age field as int64 in acra and use setLong in the code.
Just confirmed that it works if I use setCharacterStream instead of setString
that was fast
Describe the bug Following issue 575, despite being able to do batch inserts with acra now, if I do a batch insert with encryption enabled on a table column I get an error. If the batch has only one insert it works.
To Reproduce Steps to reproduce the behavior: 1.Use the same code from the previous issue
Expected behavior The insert should work and name field should be encrypted.
Environment (please complete the following information):