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

CREATE TABLE doesn't allow to have column names in quotes #4

Closed
vasilievip opened this issue May 23, 2012 · 4 comments
Closed

CREATE TABLE doesn't allow to have column names in quotes #4

vasilievip opened this issue May 23, 2012 · 4 comments

Comments

@vasilievip
Copy link

http://sourceforge.net/tracker/?func=detail&aid=3068961&group_id=104597&atid=638634

Since this "hub" doesn't allow attachments, here is the change which works for me

--- a/src/main/javacc/net/sf/jsqlparser/parser/JSqlParserCC.jj
+++ b/src/main/javacc/net/sf/jsqlparser/parser/JSqlParserCC.jj
@@ -1523,7 +1523,11 @@ CreateTable CreateTable():
    [
        "("

-       columnName=<S_IDENTIFIER>
+       (
+           columnName=<S_IDENTIFIER>
+           |
+           columnName=<S_QUOTED_IDENTIFIER>
+       )
        colDataType = ColDataType()
        {
            columnSpecs = new ArrayList();
@@ -1582,7 +1586,11 @@ CreateTable CreateTable():
                )
                |
                (
-                   columnName=<S_IDENTIFIER> 
+                    (
+                        columnName=<S_IDENTIFIER>
+                        |
+                        columnName=<S_QUOTED_IDENTIFIER>
+                    )
@wumpz
Copy link
Member

wumpz commented May 25, 2012

Maybe you should use RelObjectName() instead of your production.

@wumpz
Copy link
Member

wumpz commented May 26, 2012

After investigating I must say, your solution is better. But you have to change more than one occurance of <S_IDENTIFIER> in this production.

@vasilievip
Copy link
Author

yep, thanks

@wumpz
Copy link
Member

wumpz commented May 28, 2012

I have included this in my fork. Additional I corrected the CreateTableDeParser.

@wumpz wumpz closed this as completed Jun 8, 2013
wumpz pushed a commit that referenced this issue Dec 22, 2022
* support clickhouse global keyword in join

* fix: add missing public Getter

Add public Getter for `updateSets`
Fixes #1630

* feat: Clickhouse GLOBAL JOIN

All credits to @julianzlzhang

fixes #1615
fixes #1535

* feat: IF/ELSE statements supports Block

Make `If... Else...` statements work with Blocks
Make `Statement()` production work with `Block()`
Rewrite the `Block()` related Unit Tests

fixes #1682

* fix: Revert unintended changes to the Special Oracle Tests

* fix: `SET` statement supports `UserVariable`

Make `SetStatement` parse Objects instead of Names only
Add Grammar to accept `UserVariable` (e.g. "set @Flag = 1")
Add Test Case for `UserVariable`

fixes #1682

* feat: Google Spanner Support

Replaces PR #1415, all credit goes to @s13o
Re-arranged some recently added Tokens in alphabetical order
Update Keywords

* fix: fix JSonExpression, accept Expressions

Make JSonExpression accept Expressions
Add Testcase
Expose Idents() and Operators()
Fixes #1696

* test: add Test for Issue #1237

Co-authored-by: Zhang Zhongliang <zhangzhongliang@xiaomi.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

No branches or pull requests

2 participants