René's URL Explorer Experiment


Title: fix: allow exists as an unquoted identifier by fudianchn · Pull Request #2773 · JSQLParser/JSqlParser · GitHub

Open Graph Title: fix: allow exists as an unquoted identifier by fudianchn · Pull Request #2773 · JSQLParser/JSqlParser

X Title: fix: allow exists as an unquoted identifier by fudianchn · Pull Request #2773 · JSQLParser/JSqlParser

Description: AI disclosure: this change was prepared with AI coding agents, reviewed and revised line by line by me. What EXISTS can be used as an unquoted column or table name, explicit or implicit alias, and CTE name. This includes UPDATE exists SET a = 1, while preserving the tested predicate forms and distinguishing identifier uses at expression and clause boundaries. Why exists is a non-reserved keyword in the common dialects and reaches the parser as an ordinary column name when downstream tools rewrite application SQL; for example MyBatis-Plus pagination count rewriting fails on SELECT tb_name, exists FROM entity ORDER BY exists (baomidou/mybatis-plus#5956). The unquoted-column failure is reproduced on the tested upstream baseline 8d12a5d7a. How Move into NonReservedWord() so that the existing name, alias, CTE and statement-dispatch helpers classify it consistently. In both Condition() and SQLCondition(), use two-token predicate lookahead with isExistsIdentifierAhead() to distinguish identifier suffixes and clause boundaries. Reuse the condition-keyword classification through an offset-aware helper. A separate EXISTS JdbcNamedParameter ":" lookahead preserves a named-parameter predicate inside ternary/map contexts without mistaking a later nested colon for its delimiter. Root cause K_EXISTS was classified as reserved even though it is also used as an ordinary name. Adding it only to RelObjectName() leaves other classifiers unaware of that use. Conversely, an opening-bracket-only predicate dispatch rejects existing bare operands and configured unparenthesized subqueries. The final dispatch keeps those predicate paths while preventing them from consuming an exists column before condition suffixes, Oracle (+), ternary/map delimiters, and the covered ordering, grouping and pagination clauses. Testing Final KeywordsTest: 874 cases, 0 failures. Running the final test source on upstream 8d12a5d7a produces 31 failures among 872 cases (the parameterized keyword enumeration changes with the classification). Regression coverage includes implicit aliases, normal/recursive CTEs, UPDATE table names, CASE, ternary/map nesting, Oracle (+), IN/NOT IN, and ORDER BY/GROUP BY/LIMIT/OFFSET boundaries. Assertions check AST node types and their positions as well as parse/deparse output. SELECT ALL cases assert the AST because existing serialization omits ALL. Predicate guards cover parenthesized subqueries, bare operands including arrays and named parameters, EXISTS :arr inside a ternary, and SELECT/VALUES forms with withUnparenthesizedSubSelects(true). Mutation checks: removing the identifier guard from both two-token predicate lookaheads makes all 24 selected boundary cases fail. Treating LIMIT/OFFSET unconditionally as identifier boundaries makes the two EXISTS limit/EXISTS offset compatibility cases fail among 9 bare-operand cases. On JDK 17.0.20, ./gradlew spotlessApply check jmhJar --no-daemon passes with 9,996 tests; mvn -B -ntp clean verify passes with 9,978 tests. Each suite has 0 failures, 0 errors and 25 existing skips. The initial KeywordsTest.java Spotless formatting failures are corrected. CI for this commit: Gradle and Maven on Linux, Windows and macOS, the grammar-conflict gate, and Codacy all pass. The PR-only run skips publishing and documentation deployment. JSQLParserBenchmark.parseSQLStatements, version=latest, performance.sql checked to produce 54 non-null statements: same Linux host (Intel i9-13900KS), JDK 17.0.20, 512 MiB heap, 3 forks, 2 x 1 s warmup and 5 x 1 s measurement iterations per fork (15 samples per run). Final baseline (8d12a5d7a) -> change -> baseline sequence: 29.703 [22.119, 37.287] -> 29.155 [21.725, 36.585] -> 29.274 [21.165, 37.383] ms/op; brackets are 99.9% confidence intervals. These short runs did not detect a performance regression; the wide confidence intervals do not rule out smaller differences or effects on other workloads. Behavior notes EXISTS (SELECT ...), EXISTS (1), and the tested bare-operand predicates keep their existing expression types. Unparenthesized SELECT/VALUES forms are tested with withUnparenthesizedSubSelects(true). UPDATE exists SET a = 1 now parses and round-trips. An exists column remains separate from IN/NOT IN, Oracle (+), ternary/map delimiters, and the tested clause boundaries. Pagination coverage includes numeric values, LIMIT ALL/LIMIT NULL, and ?, $1, :n and &n parameters; bare EXISTS limit and EXISTS offset remain predicates. No AST, deparser or public API changes. Verification of the original issue KeywordsTest.testExistsAsIdentifier reproduces the reported unquoted-column failure with SELECT exists FROM mytable: it fails on upstream 8d12a5d7a and passes on the final version, along with qualified columns, WHERE, ORDER BY, UPDATE/INSERT column names and explicit aliases. Additional coverage verifies UPDATE exists SET a = 1. Final single commit 25fc1d545846d7542d9a728bc3439fc7ba3606c8 on fix/exists-as-identifier. Partially addresses #2772.

Open Graph Description: AI disclosure: this change was prepared with AI coding agents, reviewed and revised line by line by me. What EXISTS can be used as an unquoted column or table name, explicit or implicit alias, and ...

X Description: AI disclosure: this change was prepared with AI coding agents, reviewed and revised line by line by me. What EXISTS can be used as an unquoted column or table name, explicit or implicit alias, and ...

Opengraph URL: https://github.com/JSQLParser/JSqlParser/pull/2773

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.4

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:05151bc3-0bad-5c96-85e0-1ad533b68b62
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA682:18C3B1:6EEF74:9AECE1:6B048874
html-safe-nonce4bc8bb6904a67d1a4051c76553e6917e8fca9d0379f97fb25e2aec7c884513f1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjgyOjE4QzNCMTo2RUVGNzQ6OUFFQ0UxOjZCMDQ4ODc0IiwidmlzaXRvcl9pZCI6Ijg5NTExNDY1MTM1MDg5NDcwOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac1b2f40e65e14bb34d8b6a1485a16f4463da0b337b4aad2791fa0c0374d06a231
hovercard-subject-tagpull_request:4818868100
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/JSQLParser/JSqlParser/pull/2773/files
twitter:imagehttps://avatars.githubusercontent.com/u/40510713?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40510713?s=400&v=4
og:image:altAI disclosure: this change was prepared with AI coding agents, reviewed and revised line by line by me. What EXISTS can be used as an unquoted column or table name, explicit or implicit alias, and ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None1d5c152376e38b7d2e37f3d5179be29a73bee93b85110da28a4eebe1159cdc70
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/JSQLParser/JSqlParser git https://github.com/JSQLParser/JSqlParser.git
octolytics-dimension-user_id4643847
octolytics-dimension-user_loginJSQLParser
octolytics-dimension-repository_id1944709
octolytics-dimension-repository_nwoJSQLParser/JSqlParser
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1944709
octolytics-dimension-repository_network_root_nwoJSQLParser/JSqlParser
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef5017e8ff4ea25a8011fcf0f2a0e430c60dc86c8
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/JSQLParser/JSqlParser/pull/2773/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FJSQLParser%2FJSqlParser%2Fpull%2F2773%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FJSQLParser%2FJSqlParser%2Fpull%2F2773%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=JSQLParser%2FJSqlParser
Reloadhttps://github.com/JSQLParser/JSqlParser/pull/2773/files
Reloadhttps://github.com/JSQLParser/JSqlParser/pull/2773/files
Reloadhttps://github.com/JSQLParser/JSqlParser/pull/2773/files
JSQLParserhttps://github.com/JSQLParser
JSqlParserhttps://github.com/JSQLParser/JSqlParser
Codehttps://github.com/JSQLParser/JSqlParser
Issues2 (2)https://github.com/JSQLParser/JSqlParser/issues
Pull requests2 (2)https://github.com/JSQLParser/JSqlParser/pulls
Discussionshttps://github.com/JSQLParser/JSqlParser/discussions
Actionshttps://github.com/JSQLParser/JSqlParser/actions
Projectshttps://github.com/JSQLParser/JSqlParser/projects
Wikihttps://github.com/JSQLParser/JSqlParser/wiki
Security and qualityhttps://github.com/JSQLParser/JSqlParser/security
Insightshttps://github.com/JSQLParser/JSqlParser/insights
Sign up for GitHub https://github.com/signup?return_to=%2FJSQLParser%2FJSqlParser%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FJSQLParser%2FJSqlParser%2Fissues%2Fnew%2Fchoose
manticore-projectshttps://github.com/manticore-projects
JSQLParser:masterhttps://github.com/JSQLParser/JSqlParser/tree/master
fudianchn:fix/exists-as-identifierhttps://github.com/fudianchn/JSqlParser/tree/fix/exists-as-identifier
Conversation 1 https://github.com/JSQLParser/JSqlParser/pull/2773
Commits 2 https://github.com/JSQLParser/JSqlParser/pull/2773/commits
Checks 8 https://github.com/JSQLParser/JSqlParser/pull/2773/checks
Files changed https://github.com/JSQLParser/JSqlParser/pull/2773/files
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2773/files
fix: allow exists as an unquoted identifier https://github.com/JSQLParser/JSqlParser/pull/2773/files#top
Show all changes 2 commits https://github.com/JSQLParser/JSqlParser/pull/2773/files
25fc1d5 fix: support EXISTS identifiers without breaking predicates fudianchn Oct 11, 2026 https://github.com/JSQLParser/JSqlParser/pull/2773/commits/25fc1d545846d7542d9a728bc3439fc7ba3606c8
9e8fb99 Merge branch 'master' into fix/exists-as-identifier manticore-projects Oct 13, 2026 https://github.com/JSQLParser/JSqlParser/pull/2773/commits/9e8fb99e997ee862f01fdb4cef92e960da8affcc
Clear filters https://github.com/JSQLParser/JSqlParser/pull/2773/files
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2773/files
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2773/files
JSqlParserCC.jjt https://github.com/JSQLParser/JSqlParser/pull/2773/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
KeywordsTest.java https://github.com/JSQLParser/JSqlParser/pull/2773/files#diff-c05162cd0932c6170f1975806e20dc280019ba0f96d26a56b313b4d237509b17
src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjthttps://github.com/JSQLParser/JSqlParser/pull/2773/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
View file https://github.com/fudianchn/JSqlParser/blob/9e8fb99e997ee862f01fdb4cef92e960da8affcc/src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/JSQLParser/JSqlParser/pull/2773/{{ revealButtonHref }}
https://github.com/JSQLParser/JSqlParser/pull/2773/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2773/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2773/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2773/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2773/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2773/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2773/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2773/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2773/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2773/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2773/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2773/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2773/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2773/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
src/test/java/net/sf/jsqlparser/statement/KeywordsTest.javahttps://github.com/JSQLParser/JSqlParser/pull/2773/files#diff-c05162cd0932c6170f1975806e20dc280019ba0f96d26a56b313b4d237509b17
View file https://github.com/fudianchn/JSqlParser/blob/9e8fb99e997ee862f01fdb4cef92e960da8affcc/src/test/java/net/sf/jsqlparser/statement/KeywordsTest.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/JSQLParser/JSqlParser/pull/2773/{{ revealButtonHref }}
https://github.com/JSQLParser/JSqlParser/pull/2773/files#diff-c05162cd0932c6170f1975806e20dc280019ba0f96d26a56b313b4d237509b17
https://github.com/JSQLParser/JSqlParser/pull/2773/files#diff-c05162cd0932c6170f1975806e20dc280019ba0f96d26a56b313b4d237509b17
https://github.com/JSQLParser/JSqlParser/pull/2773/files#diff-c05162cd0932c6170f1975806e20dc280019ba0f96d26a56b313b4d237509b17
https://github.com/JSQLParser/JSqlParser/actions/runs/38482132321/job/115586981177?pr=2773
https://github.com/JSQLParser/JSqlParser/actions/runs/38482132321/job/115586981177?pr=2773
https://github.com/JSQLParser/JSqlParser/actions/runs/38482132321/job/115586981177?pr=2773
https://github.com/JSQLParser/JSqlParser/actions/runs/38482132321/job/115586981323?pr=2773
https://github.com/JSQLParser/JSqlParser/actions/runs/38482132321/job/115586981323?pr=2773
https://github.com/JSQLParser/JSqlParser/actions/runs/38482132321/job/115586981323?pr=2773
https://github.com/JSQLParser/JSqlParser/pull/2773/files#diff-c05162cd0932c6170f1975806e20dc280019ba0f96d26a56b313b4d237509b17
https://github.com/JSQLParser/JSqlParser/actions/runs/38482132321/job/115586981177?pr=2773
https://github.com/JSQLParser/JSqlParser/actions/runs/38482132321/job/115586981177?pr=2773
https://github.com/JSQLParser/JSqlParser/actions/runs/38482132321/job/115586981177?pr=2773
https://github.com/JSQLParser/JSqlParser/actions/runs/38482132321/job/115586981323?pr=2773
https://github.com/JSQLParser/JSqlParser/actions/runs/38482132321/job/115586981323?pr=2773
https://github.com/JSQLParser/JSqlParser/actions/runs/38482132321/job/115586981323?pr=2773
https://github.com/JSQLParser/JSqlParser/pull/2773/files#diff-c05162cd0932c6170f1975806e20dc280019ba0f96d26a56b313b4d237509b17
https://github.com/JSQLParser/JSqlParser/actions/runs/38482132321/job/115586981177?pr=2773
https://github.com/JSQLParser/JSqlParser/actions/runs/38482132321/job/115586981177?pr=2773
https://github.com/JSQLParser/JSqlParser/actions/runs/38482132321/job/115586981177?pr=2773
https://github.com/JSQLParser/JSqlParser/actions/runs/38482132321/job/115586981323?pr=2773
https://github.com/JSQLParser/JSqlParser/actions/runs/38482132321/job/115586981323?pr=2773
https://github.com/JSQLParser/JSqlParser/actions/runs/38482132321/job/115586981323?pr=2773
https://github.com/JSQLParser/JSqlParser/actions/runs/38482132321/job/115586981177?pr=2773
https://github.com/JSQLParser/JSqlParser/actions/runs/38482132321/job/115586981323?pr=2773
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2773/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.