exasol / virtual-schemas

Entry point repository for the EXASOL Virtual Schemas
http://www.exasol.com
MIT License
24 stars 23 forks source link

fix for "WHERE false" syntax issue in saphana dialect #416

Closed mwellbro closed 3 years ago

mwellbro commented 3 years ago

As shown in EXA-31110 the standard way of handling Boolean expr. led to an error in HANA because "WHERE false" is not valid syntax there.

This addition introduces a very barebone SapHanaSqlGenerationVisitor which will not ( like the standard one ) place the value for SQLConstant True or False but override this behavior with "1=0" (false) or "1=1" (true) which should be understood by any database , including HANA.

Had to test with an older v-schema version and only did positive-testing for now - should work as desired.

Closes #414.

redcatbear commented 3 years ago

Thanks for the contribution, @mwellbro. I reviewed the code and have only editorial changes.

Until now the Hana dialect does not have automatic integration tests. I just found https://hub.docker.com/_/sap-hana-express-edition, which would allow us to tests with our usual testcontainer setup. No specialized testcontainer exists, but the generic JDBC variant will suffice anyway. We extract the dialects one-by-one from the bundle, when we do this for Hana, we can also add that integration test.

redcatbear commented 3 years ago

Please update the version number by increasing the third digit (bugfix version). Then please run

mvn artifact-reference-checker:unify

Please also add an entry to the corresponding changelog file under doc/ changes (see other changelogs for examples) and add a link in doc/changes/changelog.md. This PR fixes issue #414 and it would be good to have that documentation for the PR in the changelog to not forget to add it.

AnastasiiaSergienko commented 3 years ago

This pull request was moved to Hana repository and merged: https://github.com/exasol/hana-virtual-schema/pull/21