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

[BUG] net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "ORDER" "ORDER" #2012

Closed
lujiamingzZ opened this issue May 24, 2024 · 1 comment

Comments

@lujiamingzZ
Copy link

lujiamingzZ commented May 24, 2024

Always check against the Latest SNAPSHOT of JSQLParser and the Syntax Diagram

Failing SQL Feature:

  • Brief description of the failing SQL feature
  • Example: WITH ROLLUP can't be parsed

Was expecting:

Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "ORDER" "ORDER"
at line 88, column 9.

<EOF>
at net.sf.jsqlparser.parser.CCJSqlParser.generateParseException(CCJSqlParser.java:38866)
at net.sf.jsqlparser.parser.CCJSqlParser.jj_consume_token(CCJSqlParser.java:38696)
at net.sf.jsqlparser.parser.CCJSqlParser.Statement(CCJSqlParser.java:306)
at net.sf.jsqlparser.parser.CCJSqlParserUtil$1.call(CCJSqlParserUtil.java:253)
at net.sf.jsqlparser.parser.CCJSqlParserUtil$1.call(CCJSqlParserUtil.java:250)
at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:317)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
... 1 more

SQL Example:

  • Simplified Query Example, focusing on the failing feature
    SELECT
         
        distinct bl.id as id,
        bbor.booking_id as master_booking_id,
        ei.express_no,
        ei.express_status,
        ei.recipient_name,
        ei.recipient_address,
        ei.recipient_phone,
         
        bl.bill_lading_id,
        bl.enterprise_id,
        bl.enterprise_name,
        bl.user_id,
        bl.booking_id,
        bl.bill_receive_method,
        bl.sign_status,
        bl.sign_time,
        bl.express_id,
        bl.supplier_bill_status,
        bl.customer_bill_status,
        bl.batch_no,
        bl.receipt_certificate,
        bl.obl_scanned,
        bl.swb_tlx,
        bl.bill_of_lading_draft,
        bl.remark,
        bl.hold_bill,
        bl.special_liberation,
        bl.version,
        bl.create_time,
        bl.create_by,
        bl.update_time,
        bl.update_by,
        bl.del,
        be.delegation_no,
        be.signing_method,
        be.bill_no,
        be.vessel,
        be.voyage_no,
        be.carrier_code,
        be.carrier_name_en,
        be.carrier_name_cn,
        be.port_of_loading,
        be.port_of_loading_code,
        be.port_of_discharge,
        be.port_of_discharge_code,
        be.destination,
        be.destination_code,
        be.etd,
        be.supplement_contact_person as siContactPerson
     
     
        FROM bill_lading bl
        LEFT JOIN booking_expand be on bl.booking_id = be.booking_id
        LEFT JOIN express_info ei on ei.express_id = bl.express_id
        LEFT JOIN booking_business_order_relation bbor on bl.booking_id = bbor.business_booking_id
        LEFT JOIN booking_order_group_relation bogr on bbor.booking_id = bogr.booking_id
        LEFT JOIN booking_order_group bog on bogr.booking_order_group_id =bog.booking_order_group_id
        WHERE
        bl.del = 0
         
         
         
            and bl.enterprise_id = ?
         
       
         
         
    
         
    
    
    
         
         
         
         
         
         
         
         
         
         
         
         
     
        ORDER BY bl.id DESC
        LIMIT ?,?
    

Software Information:

  • JSqlParser version 4.6
  • Database (mysql 5.7.36 )

Tips:

Please write in English and avoid Screenshots (as we can't copy and paste content from it).
Try your example online with the latest JSQLParser and share the link in the error report.
Do provide Links or References to the specific Grammar and Syntax you are trying to use.

@lujiamingzZ lujiamingzZ changed the title [BUG] JSQLParser Version : RDBMS : failing feature description [BUG] net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "ORDER" "ORDER" May 24, 2024
@manticore-projects
Copy link
Contributor

Two empty lines \n\n\n terminate a statement, please #1988 for details.

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