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

Add escape hatch for Insert Bulk Unsupported Features #2422

Conversation

KushaalShroff
Copy link
Contributor

@KushaalShroff KushaalShroff commented Mar 12, 2024

Description

This commit fixed TABLOCK not being parsed as a KEYWORD because of which users were getting Syntax Errors rather than Unsupported erros.
To alleviate the drawback of unsupported Tablock options and to keep it consistent with Query options - where its ignored too using an escape hatch - we ignore the unsupported Insert Bulk Option by adding a new a escape hatch for it escape_hatch_insert_bulk_options which is set to ignore be default

Authored-by: Kushaal Shroff kushaal@amazon.com
Signed-off-by: Kushaal Shroff kushaal@amazon.com

Issues Resolved

BABEL-4830/BABEL-4831

Test Scenarios Covered

  • Use case based -
    Yes

  • Boundary conditions -

  • Arbitrary inputs -

  • Negative test cases -

  • Minor version upgrade tests -

  • Major version upgrade tests -

  • Performance tests -

  • Tooling impact -

  • Client tests -

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is under the terms of the Apache 2.0 and PostgreSQL licenses, and grant any person obtaining a copy of the contribution permission to relicense all or a portion of my contribution to the PostgreSQL License solely to contribute all or a portion of my contribution to the PostgreSQL open source project.

For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@@ -206,7 +206,7 @@ select * from t1 (tablock, index(i1)) order by id; -- syntax error
go
~~ERROR (Code: 33557097)~~

~~ERROR (Message: syntax error near ',' at line 1 and character position 25)~~
~~ERROR (Message: syntax error near 'index' at line 1 and character position 27)~~
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is expected error. The following is SQL Servers error:

Incorrect syntax near 'index'. If this is intended as a part of a table hint, A WITH keyword and parenthesis are now required. See SQL Server Books Online for proper syntax.

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 8246269835

Details

  • 5 of 5 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 72.257%

Totals Coverage Status
Change from base Build 8245709764: 0.02%
Covered Lines: 40416
Relevant Lines: 55934

💛 - Coveralls

contrib/babelfishpg_tsql/src/guc.c Outdated Show resolved Hide resolved
contrib/babelfishpg_tsql/src/tsqlIface.cpp Outdated Show resolved Hide resolved
This reverts commit 5fbd15c.
@KushaalShroff KushaalShroff changed the title Add Escape Hatch For Unsupported Insert Bulk Options Ignore Tablock Unsupported Error Message for Insert Bulk Apr 4, 2024
@KushaalShroff KushaalShroff changed the title Ignore Tablock Unsupported Error Message for Insert Bulk Add escape hatch for Insert Bulk Unsupported Features Apr 4, 2024
@KushaalShroff KushaalShroff merged commit c3420f0 into babelfish-for-postgresql:BABEL_4_X_DEV Apr 8, 2024
40 checks passed
@KushaalShroff KushaalShroff deleted the tablock_hints branch April 8, 2024 06:14
staticlibs pushed a commit to wiltondb/babelfish_extensions that referenced this pull request Apr 14, 2024
…postgresql#2422)

This commit fixes TABLOCK not being parsed as a KEYWORD because of which users were getting Syntax Errors rather than Unsupported errors.
To alleviate the drawback of unsupported Tablock options and to keep it consistent with Query options - where its ignored too using an escape hatch - we ignore the unsupported Insert Bulk Option by adding a new a escape hatch for it escape_hatch_insert_bulk_options which is set to ignore be default

Issues Resolved
BABEL-4830/BABEL-4831

Authored-by: Kushaal Shroff kushaal@amazon.com
Signed-off-by: Kushaal Shroff kushaal@amazon.com
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.

None yet

3 participants