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

parse "CURRENT_TIMESTAMP(3)" error #1507

Closed
patinousward opened this issue Apr 8, 2022 · 4 comments · Fixed by #1666
Closed

parse "CURRENT_TIMESTAMP(3)" error #1507

patinousward opened this issue Apr 8, 2022 · 4 comments · Fixed by #1666
Assignees

Comments

@patinousward
Copy link

CCJSqlParserUtil.parse("update btrip_payment set update_time = CURRENT_TIMESTAMP(3) where id = 1");

version:4.2

image

@wumpz
Copy link
Member

wumpz commented Apr 9, 2022

JSqlParser only supports CURRENT_TIMESTAMP without parameters. Which database supports this?

@patinousward
Copy link
Author

JSqlParser only supports CURRENT_TIMESTAMP without parameters. Which database supports this?

mysql support

@wumpz
Copy link
Member

wumpz commented Apr 11, 2022

Any chance you want to provide a PR?

@manticore-projects
Copy link
Contributor

Actually, it is just a Keyword problem again: When <K_TIME_KEY_EXPR> was explicitly allowed as Function Name, then CURRENT_TIMESTAMP(3) would be read as a Function and parsed properly.

The Keyword PR #1382 solves this problem.

@manticore-projects manticore-projects self-assigned this Nov 14, 2022
manticore-projects added a commit to manticore-projects/JSqlParser that referenced this issue Nov 14, 2022
allows CURRENT_DATE(3) and CURRENT_TIMESTAMP(3) as regular functions
fixes JSQLParser#1507
fixes JSQLParser#1607
wumpz pushed a commit that referenced this issue Nov 20, 2022
* fix: add missing public Getter

Add public Getter for `updateSets`
Fixes #1630

* feat: LISTAGG() with OVER() clause

fixes issue #1652
fixes 3 more Special Oracle Tests

* fix: White-list CURRENT_DATE and CURRENT_TIMESTAMP tokens

allows CURRENT_DATE(3) and CURRENT_TIMESTAMP(3) as regular functions
fixes #1507
fixes #1607

* feat: Deparser for Expression Lists

Visit each Expression of a List instead ExpressionList.toString()
fixes #1608

* fix: Lookahead needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants