Skip to content

Commit

Permalink
Merge pull request #79 from cwida/78-explain-analyze-copy-leads-to-se…
Browse files Browse the repository at this point in the history
…gmentation-fault

Fixing segfault with explain analyze followed by not a select
  • Loading branch information
Dtenwolde authored Feb 3, 2024
2 parents 46b05d1 + 11e4d10 commit 5d5280c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions duckpgq/src/duckpgq_extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ ParserExtensionPlanResult duckpgq_handle_statement(SQLStatement *statement, Duck
}
if (statement->type == StatementType::EXPLAIN_STATEMENT) {
auto &explain_statement = statement->Cast<ExplainStatement>();
auto select_statement = dynamic_cast<SelectStatement*>(explain_statement.stmt.get());
duckpgq_handle_statement(select_statement, duckpgq_state);
// auto select_statement = dynamic_cast<SelectStatement*>(explain_statement.stmt.get());
duckpgq_handle_statement(explain_statement.stmt.get(), duckpgq_state);
}
if (statement->type == StatementType::COPY_STATEMENT) {
auto &copy_statement = statement->Cast<CopyStatement>();
Expand Down
6 changes: 6 additions & 0 deletions test/sql/snb/snb.test
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,9 @@ query IIIII
----
962072674306 thanks 2012-07-08 20:32:03.239+00 1 AlimGuliyev
962072674305 yes 2012-07-08 23:48:41.63+00 1 AlimGuliyev

statement ok
-EXPLAIN ANALYZE COPY (FROM GRAPH_TABLE (snb
MATCH p = ANY SHORTEST (a:Person WHERE a.id = 19791209309999)-[k:knows]-> *(b:Person where b.id = 30786325579519)
COLUMNS (path_length(p), a.id as a_id, b.id as b_id)
) tmp LIMIT 20) TO '__TEST_DIR__/ic13-ea.txt';

0 comments on commit 5d5280c

Please sign in to comment.