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

Update SHOW TABLES query. #48

Merged
merged 2 commits into from
Jun 14, 2023

Conversation

Yury-Fridlyand
Copy link
Collaborator

Description

SHOW TABLES LIKE % query was used to verify the connection. As of opensearch-project/sql#1181, query syntax changed in V2. This query was falling back to V1 SQL plugin engine, which would be deprecated once upon a time. Updating this query in ODBC driver ensures that SQL plugin would properly respond to it.

Issues Resolved

N/A

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
Signed-off-by: Yury-Fridlyand <yury.fridlyand@improving.com>
query += table_valid
? (search_pattern ? table_name : "^" + table_name + "$")
: "%";
query += '\'';
Copy link
Collaborator

Choose a reason for hiding this comment

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

It'd be nicer if you didn't mix n match different quote types in the function.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In terms of C++ performance, str + char is faster than str + str and consumes less memory.

@Yury-Fridlyand Yury-Fridlyand merged commit 983332f into opensearch-project:main Jun 14, 2023
@Yury-Fridlyand Yury-Fridlyand deleted the update-test-query branch June 14, 2023 16:59
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.

6 participants