albertZhangTJ / sqlancer-lancerfuzz

SQLancer, with grammar-based fuzzing capability
http://www.sqlancer.com/
MIT License
1 stars 0 forks source link

Cache schema reference query result to improve execution efficiency #24

Closed albertZhangTJ closed 10 months ago

albertZhangTJ commented 10 months ago

The result of queries that retrieves available identifiers can be cached at statement level. Since nothing other than queries will run on the target DBMS during the generation of the current statement (assuming single-threaded), this result is guaranteed to be valid.

albertZhangTJ commented 10 months ago

Turned out that ResultSets are defaulted to be forward only and cannot be reused. The computational overhead to translate it into some other data structures is deemed to be unworthy since the cache hit/miss ratio is about 50/50 in test runs. While the scroll insensitive behavior is not guaranteed to be supported in all JDBC drivers.

Therefore we believe it is sufficient to simply query the target DBMS every single time.