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

OPTIMIZE statement cannot be parsed #348

Closed
msbruno opened this issue Oct 17, 2016 · 1 comment
Closed

OPTIMIZE statement cannot be parsed #348

msbruno opened this issue Oct 17, 2016 · 1 comment

Comments

@msbruno
Copy link

msbruno commented Oct 17, 2016

SQL commands like the sql below cannot be parsed, an exception occurs.

SELECT *
FROM EMP
ORDER BY SALARY DESC
OPTIMIZE FOR 20 ROWS;

Exception: "net.sf.jsqlparser.parser.ParseException: Encountered " <S_IDENTIFIER> "OPTIMIZE "" at line 4, column 3.
Was expecting one of:

"FOR" ..."

@CodingFabian
Copy link

CodingFabian commented Mar 13, 2017

+1 here,
this seems to be trailing to statements:
e.g. in selects like:

LIMIT 1 OPTIMIZE FOR 1 ROWS

Documented in the DB2 documentation:
https://www.ibm.com/support/knowledgecenter/en/SSEPEK_10.0.0/sqlref/src/tpc/db2z_sql_optimizeforclause.html

https://www.ibm.com/support/knowledgecenter/SSEPEK_10.0.0/perf/src/tpc/db2z_optimizefornrows.html
it seems to appear only at the end of a select statement.

@wumpz wumpz closed this as completed in 4b0b5cb Feb 7, 2019
wumpz added a commit that referenced this issue Feb 7, 2019
PraTrick added a commit to PraTrick/JSqlParser that referenced this issue Feb 16, 2019
* changed license header to represent the projects dual license

* changed license header to represent the projects dual license

* changed license header to represent the projects dual license

* changed license header to represent the projects dual license

* Added support for comment(s) for column definitions in CREATE TABLE s… (JSQLParser#743)

* Added support for comment(s) for column definitions in CREATE TABLE statements

* Added support for comment(s) for column definitions in CREATE TABLE statements #2

* To increase code coverage

* To increase code coverage #2

* Added support for 'ALTER TABLE CHANGE COLUMN' (JSQLParser#741)

* Added support for 'ALTER TABLE CHANGE COLUMN oldName newName columnDefinition'. Please see https://dev.mysql.com/doc/refman/8.0/en/alter-table.html for reference.

* Returned import ordering to avoid conflicts

* Improved the tests somewhat

Now also test the getOptionalSpecifier() for both cases (null and not-null)

* Expanded tests for ALTER TABLE ... CHANGE

* implemented optimize for, fixes JSQLParser#348

* implemented optimize for, fixes JSQLParser#348

* Support for simple informix outer joins. (JSQLParser#745)

* added support for simple informix outer joins
added some test code

* added support for simple informix outer joins
added some test code

* more testing for better code coverage

* added support for simple informix outer joins
added some test code

* more testing for better code coverage

* fixes JSQLParser#747

* fixes JSQLParser#733

* fixes JSQLParser#707

* Update README.md

* Update README.md
wumpz pushed a commit that referenced this issue Feb 19, 2019
…752)

* Merge recent changes in the master from the master (#1)

* changed license header to represent the projects dual license

* changed license header to represent the projects dual license

* changed license header to represent the projects dual license

* changed license header to represent the projects dual license

* Added support for comment(s) for column definitions in CREATE TABLE s… (#743)

* Added support for comment(s) for column definitions in CREATE TABLE statements

* Added support for comment(s) for column definitions in CREATE TABLE statements #2

* To increase code coverage

* To increase code coverage #2

* Added support for 'ALTER TABLE CHANGE COLUMN' (#741)

* Added support for 'ALTER TABLE CHANGE COLUMN oldName newName columnDefinition'. Please see https://dev.mysql.com/doc/refman/8.0/en/alter-table.html for reference.

* Returned import ordering to avoid conflicts

* Improved the tests somewhat

Now also test the getOptionalSpecifier() for both cases (null and not-null)

* Expanded tests for ALTER TABLE ... CHANGE

* implemented optimize for, fixes #348

* implemented optimize for, fixes #348

* Support for simple informix outer joins. (#745)

* added support for simple informix outer joins
added some test code

* added support for simple informix outer joins
added some test code

* more testing for better code coverage

* added support for simple informix outer joins
added some test code

* more testing for better code coverage

* fixes #747

* fixes #733

* fixes #707

* Update README.md

* Update README.md

* Fix handles the following cases: 1) DROP INDEX 2) ADD UNIQUE INDEX 3) ALGORITHM 4) USING <index type>
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