Skip to content

[BUG] JSQLParser 5.3 Encountered unexpected token K_DO "DO". #2358

Closed

Description

@Chester-Cheetah

http://jsqlformatter.manticore-projects.com/jsqlformatter/demo.html?args=-c%20JYOwzgpgTgLgBKGB7OBjJIBmA6MBXABwIBsBPAfVExQApgATAGjnogENjKm4oIClY5emxgRmUJMQjl0rAJQAoSFNTw8eBuQDmEENBHSAbgBYacxgt4FsrDlwtXsVgTCEGHfJ5OmyICzBIAtmgYOM6wYDx8CgBWSKAhWNgCrFCRKBhR1gxwALxwSE58LlwKmehYxMCqLCggSDAAFqBaQA

insert into conf.supply_info (id, deal_id, report_date, role_code)
select uuid_generate_v4(),
rep.deal_id,
rep.report_date,
rep.role_code
from conf.reports rep
join conf.orders o on rep.id = o.report_id
on conflict do nothing;

Unexpected K_DO "DO"
Expected one of these: "ON", "RETURN", "RETURNING", "ST_SEMICOLON".

But there is correct syntax for PostgreSQL

Activity

  1. changed the title [-][BUG] JSQLParser Version : 5.3 Encountered unexpected token K_DO "DO".[/-] [+][BUG] JSQLParser 5.3 Encountered unexpected token K_DO "DO".[/+] on Dec 31, 2025
  2. manticore-projects commented on Jan 1, 2026

    @manticore-projects
    Contributor

    Greetings.

    Unfortunately I can confirm this. The 'ON CONFLICT" collides with the 'JOIN ... ON', adding brackets to the SELECT ... works around.

    insert into conf.supply_info (id, deal_id, report_date, role_code)
    (select uuid_generate_v4(),
    rep.deal_id,
    rep.report_date,
    rep.role_code
    from conf.reports rep
    inner join conf.orders o on rep.id = o.report_id)
    on conflict do nothing;
  3. added a commit that references this issue on Sep 5, 2026
    f6d20da
  4. added a commit that references this issue on Sep 6, 2026
    ae37fd2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions