Update Vec<u8> does not load the file entirely
loading pdf files on update, they are stored corrupted, even using read_to_end() in the file to get the vector
Can you provide some sample code? Does this only happen with PDFs? What version are you using (native/pure rust)?
let output = format!("/home/users/Downloads/tmp/{id}.pdf");
let mut buf_out = Vec::new();
let mut file_output_tmp = File::open(&output)?;
file_output_tmp.read_to_end(&mut buf_out)?;
fdb_update.execute("update anexos set anexo = ? where id_anexo = ?", (buf_out,id))?;
file_output_tmp.flush()?;
remove_file(output)?;
using native.
There seems to be a problem in the native implementation when the data is 65536 bytes or longer. For the time being you can use the native rust implementation.
@PauloCotrim can you test the solution provided ?
Yes, I tested it and it worked.
New 0.25.1 version released. Thanks @jairinhohw