GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: parse INSERT OR ABORT, FAIL, IGNORE and ROLLBACK (SQLite) by ItsDeadlyProgrammer · Pull Request #2853 · JSQLParser/JSqlParser

Conversation

@ItsDeadlyProgrammer

@ItsDeadlyProgrammer ItsDeadlyProgrammer commented Oct 23, 2026

Copy link
Copy Markdown

Part of #2852 (the INSERT OR half; UPDATE OR ..., WITHOUT ROWID and STRICT are not in this PR).

UpsertType already has INSERT_OR_ABORT, INSERT_OR_FAIL, INSERT_OR_IGNORE and INSERT_OR_ROLLBACK, and Upsert and UpsertDeParser print them, but the grammar only accepted INSERT OR REPLACE. This adds the other four to the Upsert production. ABORT and FAIL are not keywords of the parser, so they are read as identifiers and checked by name; any other word after INSERT OR is a parse error.

SQLiteTest covers all five algorithms with column list and SELECT source, a lower case variant, and an unknown word. The four new cases fail without the grammar change. The full ./gradlew test run has 35 failures (StatementDeParserTest, ExpressionDeParserTest, WithFunctionDeclarationTest and others); they fail the same way on an unmodified master here (JDK 25), none involve INSERT OR.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
manticore-projects
manticore-projects requested changes Oct 23, 2026
View reviewed changes
Comment thread src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt Outdated
(
<K_INSERT> <K_OR> <K_REPLACE> { upsert.setUpsertType(UpsertType.INSERT_OR_REPLACE); }
<K_INSERT> <K_OR>
(

@manticore-projects manticore-projects Oct 23, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do understand that this is SQLite specific syntax. If my understanding is correct, then please guard this block by the SQLite Dialect.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ItsDeadlyProgrammer ItsDeadlyProgrammer Oct 23, 2026

Copy link
Copy Markdown
Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, done in 8805d37. There was no SQLite value in Dialect, so I added Dialect.SQLITE and listed it in the dialect table in usage.rst.

INSERT OR IGNORE, ROLLBACK, ABORT and FAIL now parse only with Dialect.SQLITE; other dialects get a ParseException saying so. INSERT OR REPLACE still parses everywhere, because it did before this PR. The tests cover both cases, and the checks are green.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

manticore-projects reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@ItsDeadlyProgrammer
ItsDeadlyProgrammer force-pushed the feat/sqlite-insert-or-conflict branch from 589893e to 8805d37 Compare October 23, 2026 10:57
@manticore-projects

manticore-projects commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Please fix the failing QA/CI tests.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ItsDeadlyProgrammer
ItsDeadlyProgrammer force-pushed the feat/sqlite-insert-or-conflict branch from 8805d37 to fe5d183 Compare October 24, 2026 04:58
@ItsDeadlyProgrammer
ItsDeadlyProgrammer requested a review from manticore-projects October 24, 2026 05:08
ItsDeadlyProgrammer added 2 commits October 24, 2026 22:46
@ItsDeadlyProgrammer
feat: parse INSERT OR ABORT, FAIL, IGNORE and ROLLBACK (SQLite)
93c0f32
UpsertType and the deparsers already had these values, but the grammar
only accepted INSERT OR REPLACE.

Part of JSQLParser#2852
@ItsDeadlyProgrammer
feat: guard INSERT OR conflict clauses by the SQLITE dialect
7eb65c8
Add Dialect.SQLITE. INSERT OR ABORT, FAIL, IGNORE and ROLLBACK need it.
INSERT OR REPLACE keeps parsing in every dialect.
@ItsDeadlyProgrammer
ItsDeadlyProgrammer force-pushed the feat/sqlite-insert-or-conflict branch from fe5d183 to 7eb65c8 Compare October 24, 2026 17:16
@ItsDeadlyProgrammer
fix: keep CCJSqlParser under the class size limit for JaCoCo
7ffb392
The extra INSERT OR alternatives pushed the constant pool of CCJSqlParser
past 65535 entries once JaCoCo instrumented it, so the class was silently
left without coverage data and the coverage check failed. Parse the
algorithm with RelObjectName and decide in AbstractJSqlParser instead.
@ItsDeadlyProgrammer

ItsDeadlyProgrammer commented Oct 24, 2026

Copy link
Copy Markdown
Author

The CI failure was a JaCoCo issue, not a test failure. CCJSqlParser is close to the 65535 constant-pool limit, and the extra alternatives pushed it over once JaCoCo added its probes, so the class was left uninstrumented and the coverage check dropped to 21%. I reproduced this locally (ClassTooLargeException from JaCoCo's instrumenter).

7ffb392 parses the algorithm with RelObjectName() and decides in AbstractJSqlParser.insertOrType, which keeps the parser class below the limit. The syntax and the SQLite-dialect guard are unchanged. The workflow needs approval to run on the new commit.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@manticore-projects
manticore-projects merged commit 9663289 into JSQLParser:master Oct 26, 2026
10 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@manticore-projects

manticore-projects commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Thank you much!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@DylanMerigaud DylanMerigaud mentioned this pull request Nov 1, 2026
feat: parse UPDATE OR conflict algorithms in the SQLite dialect #2885
Merged
@chinmayajha chinmayajha mentioned this pull request Nov 6, 2026
feat: parse SQLite WITHOUT ROWID and STRICT table options #2903
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@manticore-projects manticore-projects Awaiting requested review from manticore-projects

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@ItsDeadlyProgrammer @manticore-projects
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.