Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shnikd committed May 24, 2024
1 parent 3483a51 commit 3681cf5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions ydb/library/yql/sql/pg/pg_sql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2968,8 +2968,7 @@ class TConverter : public IPGParseEvents {
return State.Statements.back();
}

[[nodiscard]]
TFromDesc ParseFromClause(const Node* node) {
TMaybe<TFromDesc> ParseFromClause(const Node* node) {
switch (NodeTag(node)) {
case T_RangeVar:
return ParseRangeVar(CAST_NODE(RangeVar, node));
Expand Down
6 changes: 3 additions & 3 deletions ydb/library/yql/sql/pg/pg_sql_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,17 +311,17 @@ Y_UNIT_TEST_SUITE(PgSqlParsingOnly) {
const auto expectedAst = NYql::ParseAst(program);
UNIT_ASSERT_STRINGS_EQUAL(res.Root->ToString(), expectedAst.Root->ToString());
}

Y_UNIT_TEST(AlterTableStmt) {
auto res = PgSqlToYql("ALTER TABLE public.t ALTER COLUMN id SET DEFAULT nextval('seq');");
UNIT_ASSERT_C(res.Root, res.Issues.ToString());
TString program = R"(
(
(let world (Configure! world (DataSource 'config) 'OrderedColumns))
(let world (Write! world (DataSink '"kikimr" '"")
(Key '('tablescheme (String '"t")))
(Void) '('('mode 'alter) '('actions '('alterColumns '('('"id" '('setDefault '('nextval 'seq)))))))))
(Key '('tablescheme (String '"t"))) (Void) '('('mode 'alter) '('actions '('('alterColumns '('('"id" '('setDefault '('nextval 'seq))))))))))
(let world (CommitAll! world)) (return world)
)
)
)";
const auto expectedAst = NYql::ParseAst(program);
UNIT_ASSERT_STRINGS_EQUAL(res.Root->ToString(), expectedAst.Root->ToString());
Expand Down

0 comments on commit 3681cf5

Please sign in to comment.