Skip to content

Commit

Permalink
SQL: SHOW ALL
Browse files Browse the repository at this point in the history
expected: "SHOW ALL"
got: "SHOW SESSION ALL"

libpg_query PR: pganalyze/libpg_query#193
  • Loading branch information
Mehmet Emin Karakaş committed Jun 2, 2023
1 parent 84b6add commit e6c5d9c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ext/pg_query/pg_query_deparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -9440,7 +9440,7 @@ static void deparseVariableShowStmt(StringInfo str, VariableShowStmt *variable_s
else if (strcmp(variable_show_stmt->name, "session_authorization") == 0)
appendStringInfoString(str, "SESSION AUTHORIZATION");
else if (strcmp(variable_show_stmt->name, "all") == 0)
appendStringInfoString(str, "SESSION ALL");
appendStringInfoString(str, "ALL");
else
appendStringInfoString(str, quote_identifier(variable_show_stmt->name));
}
Expand Down
14 changes: 14 additions & 0 deletions spec/lib/pg_query/deparse_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2181,5 +2181,19 @@
it { is_expected.to eq query }
end
end

context 'SHOW' do
context 'show work_mem' do
let(:query) { 'SHOW work_mem' }

it { is_expected.to eq query }
end

context 'show all' do
let(:query) { 'SHOW ALL' }

it { is_expected.to eq query }
end
end
end
end

0 comments on commit e6c5d9c

Please sign in to comment.