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(sql): fixed PG ODBC driver compatibility problems #2031

Merged
merged 15 commits into from Apr 27, 2022
Merged

Conversation

bluestreak01
Copy link
Member

@bluestreak01 bluestreak01 commented Apr 13, 2022

Fixed #2026

  • fixed few more PG metadata SQLs
  • fixed double-free in join generator, in case there is exception
  • fixed incorrect join optimisation, which lead to assertion errors
  • improved PG SQL compatibility

PG can execute the following SQL, while without this PR we could not

select a.f, b.p from (tab1 a join tab2 b on id)

Notice that join is inside braces, which QuestDB was interpreting as sub-query and could not reference tables within by aliases a and b. Now SQL parser will remove bracket in this simplified case to rewrite the above SQL as:

select a.f, b.p from tab1 a join tab2 b on id

to allow aliases to be used.

All "real" sub-queries are not affected.

Also, fixed SQL execution from Excel:

image

image

image

image

@bluestreak01 bluestreak01 added Bug Incorrect or unexpected behavior SQL Issues or changes relating to SQL execution Java Improvements that update Java code labels Apr 14, 2022
@bluestreak01 bluestreak01 added Postgres Wire Issues or changes relating to Postres wire protocol Compatibility Compatibility with third-party tools and services labels Apr 18, 2022
@ideoma
Copy link
Collaborator

ideoma commented Apr 26, 2022

[PR Coverage check]

😍 pass : 320 / 331 (96.68%)

file detail

path covered line new line coverage
🔵 io/questdb/griffin/SqlCompiler.java 69 77 89.61%
🔵 io/questdb/griffin/engine/functions/array/IntArrayDereferenceHackFunctionFactory.java 9 10 90.00%
🔵 io/questdb/griffin/engine/functions/eq/EqBooleanCharFunctionFactory.java 11 12 91.67%
🔵 io/questdb/griffin/SqlParser.java 77 78 98.72%
🔵 io/questdb/griffin/engine/functions/catalogue/ShowTimeZoneFactory.java 1 1 100.00%
🔵 io/questdb/griffin/engine/functions/catalogue/ShowStandardConformingStringsCursorFactory.java 1 1 100.00%
🔵 io/questdb/griffin/engine/functions/catalogue/ShowTransactionIsolationLevelCursorFactory.java 1 1 100.00%
🔵 io/questdb/griffin/engine/functions/catalogue/AttrDefCatalogueFunctionFactory.java 1 1 100.00%
🔵 io/questdb/griffin/engine/functions/catalogue/AbstractClassCatalogueFunctionFactory.java 5 5 100.00%
🔵 io/questdb/griffin/engine/functions/catalogue/PgGetSIExprFunctionFactory.java 4 4 100.00%
🔵 io/questdb/griffin/engine/functions/catalogue/SingleValueRecordCursor.java 1 1 100.00%
🔵 io/questdb/griffin/model/QueryModel.java 69 69 100.00%
🔵 io/questdb/griffin/engine/functions/catalogue/PrefixedAttrDefCatalogueFunctionFactory.java 2 2 100.00%
🔵 io/questdb/griffin/engine/functions/catalogue/AttributeCatalogueFunctionFactory.java 2 2 100.00%
🔵 io/questdb/griffin/engine/functions/catalogue/ShowSearchPathCursorFactory.java 1 1 100.00%
🔵 io/questdb/griffin/engine/functions/catalogue/ShowMaxIdentifierLengthCursorFactory.java 10 10 100.00%
🔵 io/questdb/griffin/engine/functions/catalogue/PrefixedPgGetSIExprFunctionFactory.java 1 1 100.00%
🔵 io/questdb/griffin/SqlCodeGenerator.java 1 1 100.00%
🔵 io/questdb/griffin/SqlOptimiser.java 2 2 100.00%
🔵 io/questdb/griffin/SqlKeywords.java 48 48 100.00%
🔵 io/questdb/griffin/engine/functions/catalogue/IntValueRecord.java 4 4 100.00%

Copy link
Contributor

@bziobrowski bziobrowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@bluestreak01 bluestreak01 merged commit b9ec761 into master Apr 27, 2022
@bluestreak01 bluestreak01 deleted the vi_excel branch April 27, 2022 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Incorrect or unexpected behavior Compatibility Compatibility with third-party tools and services Java Improvements that update Java code Postgres Wire Issues or changes relating to Postres wire protocol SQL Issues or changes relating to SQL execution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6.2.1 version have problem accessed from postgres and odbc
3 participants