Skip to content

Commit

Permalink
fix: avoid crash on insert ~ default values.
Browse files Browse the repository at this point in the history
  • Loading branch information
ashigeru committed Jul 7, 2024
1 parent 6368659 commit 7941405
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/mizugaki/analyzer/details/analyze_statement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class engine {
context_.report(
sql_analyzer_code::unsupported_feature,
"DEFAULT VALUES clause is yet not supported",
stmt.expression()->region());
stmt.region());
return {};
}
auto source = analyze_query_expression(
Expand Down
10 changes: 10 additions & 0 deletions test/mizugaki/analyzer/details/analyze_statement_insert_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,4 +410,14 @@ TEST_F(analyze_statement_insert_test, inconsistent_query) {
});
}

TEST_F(analyze_statement_insert_test, default_values) {
options_.prefer_write_statement() = false;
auto table = install_table("testing");
invalid(sql_analyzer_code::unsupported_feature, ast::statement::insert_statement {
id("testing"),
{},
{}, // default values
});
}

} // namespace mizugaki::analyzer::details

0 comments on commit 7941405

Please sign in to comment.