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.33k stars 128 forks source link

Fixed bug with matching default table with alias #594

Closed Zhaars closed 1 year ago

Zhaars commented 1 year ago

Currently, Acra expects that columns in SELECT statement haven't been aliased if FROM has a non-aliased table or they should have proper alias. But databases allow specific alias for table but use columns without an alias.

So if the query contains Columns without aliases and the table is aliased, Acra should consider this table as default. Added checking for containing aliases in tables expressions and switch between extracting tables functions depending on queries.

Checklist