diff --git a/src/mizugaki/analyzer/details/analyze_statement.cpp b/src/mizugaki/analyzer/details/analyze_statement.cpp index 792c97d..c4e5d1b 100644 --- a/src/mizugaki/analyzer/details/analyze_statement.cpp +++ b/src/mizugaki/analyzer/details/analyze_statement.cpp @@ -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( diff --git a/test/mizugaki/analyzer/details/analyze_statement_insert_test.cpp b/test/mizugaki/analyzer/details/analyze_statement_insert_test.cpp index 381bdc1..47da34b 100644 --- a/test/mizugaki/analyzer/details/analyze_statement_insert_test.cpp +++ b/test/mizugaki/analyzer/details/analyze_statement_insert_test.cpp @@ -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