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

Allow isolation keywords as column name and aliases #1534

Merged
merged 1 commit into from
May 19, 2022
Merged

Allow isolation keywords as column name and aliases #1534

merged 1 commit into from
May 19, 2022

Conversation

tomershay
Copy link
Contributor

This allows to parse statements such as:
SELECT col FROM tbl cs

@@ -2500,6 +2500,12 @@ public void testMultiValueIn4() throws JSQLParserException {
assertSqlCanBeParsedAndDeparsed(stmt);
}

@Test
public void selectIsolationKeywordsAsAlias() throws JSQLParserException {
String stmt = "SELECT col FROM tbl cs";
Copy link
Member

Choose a reason for hiding this comment

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

You do not test your isolation usage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are other tests already testing isolation usage (for example, testWithIsolation).
This PR just allows "cs" to be used as a column name / alias, as otherwise parsing fails when it's used.

@wumpz wumpz merged commit fc5a9a3 into JSQLParser:master May 19, 2022
manfredma pushed a commit to manfredma/exercises that referenced this pull request Jun 17, 2024
manfredma pushed a commit to manfredma/exercises that referenced this pull request Jul 8, 2024
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.

2 participants