From 06ca23a6440c7050e3217ad300c38a845c473078 Mon Sep 17 00:00:00 2001 From: Christoph Pakulski Date: Wed, 10 Jun 2020 16:15:18 +0000 Subject: [PATCH] tablesAccess should return values only for DROP TABLE ... statement. The issue is that for statement: DROP DATABASE testdb; tablesAccessed returned that table testdb was accessed. Signed-off-by: Christoph Pakulski --- include/sqlparser/DropStatement.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sqlparser/DropStatement.h b/include/sqlparser/DropStatement.h index f532ec7f..37409794 100644 --- a/include/sqlparser/DropStatement.h +++ b/include/sqlparser/DropStatement.h @@ -21,7 +21,7 @@ namespace hsql { DropStatement(DropType type); virtual ~DropStatement(); void tablesAccessed(TableAccessMap& accessMap) const override { - if (name != nullptr) { + if ((name != nullptr) && (type == kDropTable)) { TableAccess::addOperation(accessMap, name, schema, TableAccess::OpDrop); } };