Doubts on Garage (1st use)
Good evening, I was trying to sanitize statements, but something went awkward. The following non sanitized codelet works ok: Â Â Â str := 'INSERT INTO chaves_de_encriptacao ( Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â numero_funcional, Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â chave_privada, Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â chave_publica) VALUES (''', Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â self personId leaId asString,''', ''', Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â self keyPair privateKey asAsn1DerBytes asByteArray hex,''', ''', Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â self keyPair publicKey asAsn1DerBytes asByteArray hex,''')'. Â Â Â [ dbConnection execute: str ] on: Exception do: [ ^ false ]. But sanitized one: Â Â Â str := dbConnection createStatement: 'INSERT INTO chaves_de_encriptacao ( numero_funcional, chave_privada, chave_publica) VALUES (''?'', ''?'', ''?'')'. Â Â Â str prepare. Â Â Â str at: 1 bind: self personId leaId asString. Â Â Â str at: 2 bind: self keyPair privateKey asAsn1DerBytes asByteArray hex. Â Â Â str at: 3 bind: self keyPair publicKey asAsn1DerBytes asByteArray hex. Â Â Â str execute. returns exception mysqld_stmt_send_long_data (obviously same thing happens with the shorthand str := dbConnection prepare: ... And I inspect most things but could not understand what's going bad. As SQL is not my field, I wonder if someone could help to elucidate what's going on. Best regards, Casimiro Barreto
participants (1)
-
Casimiro de Almeida Barreto