Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace fully-qualified column names #1158

Merged
merged 3 commits into from
Nov 3, 2023
Merged

Conversation

olavloite
Copy link
Collaborator

pg_catalog queries that include a fully-qualified column name in either a join clause or a where clause would fail, as the pg_catalog table names are replaced with a unqualified reference to a common table expression.

This change adds an additional step to replace fully qualified column names of qualified table names that have been replaced, with column names that only include the table name and not the schema name. That is:

pg_catalog.pg_class.relname -> pg_class.relname

Fixes #1129

pg_catalog queries that include a fully-qualified column name in either
a join clause or a where clause would fail, as the pg_catalog table names
are replaced with a unqualified reference to a common table expression.

This change adds an additional step to replace fully qualified column
names of qualified table names that have been replaced, with column names
that only include the table name and not the schema name. That is:

`pg_catalog.pg_class.relname -> pg_class.relname`

Fixes #1129
@codecov
Copy link

codecov bot commented Oct 28, 2023

Codecov Report

Merging #1158 (2540bb6) into postgresql-dialect (7bb4af0) will decrease coverage by 0.07%.
The diff coverage is 95.23%.

@@                   Coverage Diff                    @@
##             postgresql-dialect    #1158      +/-   ##
========================================================
- Coverage                 90.69%   90.63%   -0.07%     
- Complexity                 2547     2553       +6     
========================================================
  Files                       140      140              
  Lines                      8546     8584      +38     
  Branches                   1250     1259       +9     
========================================================
+ Hits                       7751     7780      +29     
- Misses                      536      541       +5     
- Partials                    259      263       +4     
Flag Coverage Δ
all_tests 90.63% <95.23%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...ud/spanner/pgadapter/utils/ClientAutoDetector.java 94.00% <100.00%> (+0.06%) ⬆️
...oud/spanner/pgadapter/statements/SimpleParser.java 94.34% <66.66%> (+0.01%) ⬆️
...loud/spanner/pgadapter/statements/TableParser.java 95.96% <97.22%> (+0.41%) ⬆️

... and 3 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@olavloite olavloite merged commit aeb2e32 into postgresql-dialect Nov 3, 2023
26 of 27 checks passed
@olavloite olavloite deleted the issue-1129 branch November 3, 2023 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for pg_catelog tables to enable Alchemic
1 participant