cossacklabs / acra

Database security suite. Database proxy with field-level encryption, search through encrypted data, SQL injections prevention, intrusion detection, honeypots. Supports client-side and proxy-side ("transparent") encryption. SQL, NoSQL.
https://www.cossacklabs.com/acra/
Apache License 2.0
1.35k stars 128 forks source link

Remove placeholders from connection when done #540

Closed G1gg1L3s closed 2 years ago

G1gg1L3s commented 2 years ago

This PR solves interference problem of placeholders. They are saved in the connection, but were never removed, only replaced. That means, they could affect other queries on the same connection.

Solve this, by removing the placeholders at the end of the query: when ReadyForQuery arrives.

I didn't write a new test for this, because 1) it already existed as a part of another test and 2) it's really hard to reproduce.

Checklist