Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Matts966 committed Jan 6, 2022
1 parent ac90eef commit 949ec6e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions alphasql/identifier_resolver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ GetIdentifierInformation(const std::string &sql_file_path) {
void IdentifierResolver::visitASTDropStatement(const ASTDropStatement *node,
void *data) {
if (node->schema_object_kind() == SchemaObjectKind::kTable) {
const auto table_name = absl::StrJoin(node->name()->ToIdentifierVector(), ".");
if (temporary_tables.find(table_name) != temporary_tables.end()) {
visitASTChildren(node, data);
return;
}
identifier_information.table_information.dropped.insert(
node->name()->ToIdentifierVector());
}
Expand Down Expand Up @@ -143,6 +148,11 @@ void IdentifierResolver::visitASTInsertStatement(const ASTInsertStatement *node,
}

const auto path = status_or_path.value()->ToIdentifierVector();
const auto table_name = absl::StrJoin(path, ".");
if (temporary_tables.find(table_name) != temporary_tables.end()) {
visitASTChildren(node, data);
return;
}
identifier_information.table_information.inserted.insert(path);

const std::string path_str = absl::StrJoin(path, ".");
Expand Down Expand Up @@ -177,6 +187,11 @@ void IdentifierResolver::visitASTUpdateStatement(const ASTUpdateStatement *node,
}

const auto path = status_or_path.value()->ToIdentifierVector();
const auto table_name = absl::StrJoin(path, ".");
if (temporary_tables.find(table_name) != temporary_tables.end()) {
visitASTChildren(node, data);
return;
}
identifier_information.table_information.updated.insert(path);

const std::string path_str = absl::StrJoin(path, ".");
Expand Down

0 comments on commit 949ec6e

Please sign in to comment.