René's URL Explorer Experiment


Title: fix: allow sample and extend as unquoted identifiers by fudianchn · Pull Request #2774 · JSQLParser/JSqlParser · GitHub

Open Graph Title: fix: allow sample and extend as unquoted identifiers by fudianchn · Pull Request #2774 · JSQLParser/JSqlParser

X Title: fix: allow sample and extend as unquoted identifiers by fudianchn · Pull Request #2774 · JSQLParser/JSqlParser

Description: AI disclosure: this change was prepared with AI coding agents, reviewed and revised line by line by me. What SAMPLE and EXTEND can be used as unquoted table and column names, explicit or implicit aliases, and CTE names, including directly after UPDATE. Sampling clauses and the |> EXTEND pipe operator retain their tested meanings. Why Both are non-reserved in the common dialects and reach the parser as ordinary names when downstream tools rewrite application SQL: FROM sample / UPDATE sample SET ... (baomidou/mybatis-plus#6504, baomidou/mybatis-plus#6871) and UPDATE t SET extend = ? (baomidou/mybatis-plus#7029, failing for users since 5.2). The identifier failures are reproduced on the tested upstream baseline 8d12a5d7a. How Move and into NonReservedWord() so the existing name, alias, CTE, expression and statement-dispatch helpers recognize them consistently. Add a guard to isAliasAhead(): SAMPLE followed by (, BLOCK, an integer or a decimal starts sampling rather than an implicit alias. The existing AS alias handling and |> EXTEND pipe dispatch remain in place. Root cause Both tokens were classified as reserved for their operator uses. A RelObjectName()-only whitelist does not update the other keyword classifiers, leaving implicit aliases, CTEs, UPDATE table names and expression contexts inconsistent. Moving the tokens to NonReservedWord() fixes that classification; the sampling guard is needed because the newly accepted implicit alias could otherwise consume the start of a SAMPLE clause. Testing Final KeywordsTest: 858 cases, 0 failures. Running the final test source on upstream 8d12a5d7a produces 21 failures among 854 cases (the parameterized keyword enumeration changes with the classification). Regression coverage includes the original identifier statements, mixed-case names, implicit aliases, normal/recursive CTEs, UPDATE table names, CASE, ternaries, and pipe expressions/functions. 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. testSampleClauseStaysClause checks the sampling AST and absence of an alias for SAMPLE (10), SAMPLE BLOCK (10) SEED (1), SAMPLE 0.1 OFFSET 1000, USING SAMPLE 10 PERCENT (BERNOULLI) and TABLESAMPLE SYSTEM (10). Removing the alias guard makes the three SAMPLE cases fail; the other two remain passing. On JDK 17.0.20, ./gradlew spotlessApply check jmhJar --no-daemon passes with 9,980 tests; mvn -B -ntp clean verify passes with 9,962 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 for this PR: 26.942 [20.933, 32.951] -> 27.454 [20.596, 34.313] -> 26.908 [21.204, 32.612] 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 t SAMPLE n, USING SAMPLE, TABLESAMPLE and |> EXTEND ... are unchanged. UPDATE sample SET a = 1 and UPDATE extend SET a = 1 now parse and round-trip, including the mixed-case variants in the tests. Implicit aliases use the new non-reserved classification; the SAMPLE guard preserves the tested sampling forms. No AST, deparser or public API changes. Verification of the original issue KeywordsTest.testSampleExtendAsIdentifier covers the reported unquoted-name cases, including SELECT * FROM sample and assignments to extend. This test fails on upstream 8d12a5d7a and passes on the final version; additional coverage verifies table names directly after UPDATE. Final single commit 8c023a204ad105606fddd66bba45824d67412518 on fix/sample-extend-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 SAMPLE and EXTEND can be used as unquoted table and column names, explicit or implicit a...

X Description: AI disclosure: this change was prepared with AI coding agents, reviewed and revised line by line by me. What SAMPLE and EXTEND can be used as unquoted table and column names, explicit or implicit a...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.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:37d29f4f-6a23-1616-c2bf-9d7763618612
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idEC32:AF327:BFB67C:1042500:6B0488A3
html-safe-nonce90e3fe833b45f6677fd2bfd50302be976fd463982f74a434106e9f1f187d1d0a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzMyOkFGMzI3OkJGQjY3QzoxMDQyNTAwOjZCMDQ4OEEzIiwidmlzaXRvcl9pZCI6IjY3MTIwOTc4MzE2ODEwMzQ0MDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac499e515c262332a2c39548da735292af57e1c627a57444ed0e0ddf326526d2e1
hovercard-subject-tagpull_request:4818868334
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/2774/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 SAMPLE and EXTEND can be used as unquoted table and column names, explicit or implicit a...
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/2774/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FJSQLParser%2FJSqlParser%2Fpull%2F2774%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%2F2774%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/2774/files
Reloadhttps://github.com/JSQLParser/JSqlParser/pull/2774/files
Reloadhttps://github.com/JSQLParser/JSqlParser/pull/2774/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/sample-extend-as-identifierhttps://github.com/fudianchn/JSqlParser/tree/fix/sample-extend-as-identifier
Conversation 0 https://github.com/JSQLParser/JSqlParser/pull/2774
Commits 2 https://github.com/JSQLParser/JSqlParser/pull/2774/commits
Checks 8 https://github.com/JSQLParser/JSqlParser/pull/2774/checks
Files changed https://github.com/JSQLParser/JSqlParser/pull/2774/files
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2774/files
fix: allow sample and extend as unquoted identifiers https://github.com/JSQLParser/JSqlParser/pull/2774/files#top
Show all changes 2 commits https://github.com/JSQLParser/JSqlParser/pull/2774/files
8c023a2 fix: support SAMPLE and EXTEND as unquoted identifiers fudianchn Oct 11, 2026 https://github.com/JSQLParser/JSqlParser/pull/2774/commits/8c023a204ad105606fddd66bba45824d67412518
fcb6b98 Merge branch 'master' into fix/sample-extend-as-identifier manticore-projects Oct 13, 2026 https://github.com/JSQLParser/JSqlParser/pull/2774/commits/fcb6b9868019f6a96a9fead16dea77e89a0131b5
Clear filters https://github.com/JSQLParser/JSqlParser/pull/2774/files
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2774/files
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2774/files
JSqlParserCC.jjt https://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
KeywordsTest.java https://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-c05162cd0932c6170f1975806e20dc280019ba0f96d26a56b313b4d237509b17
src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjthttps://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
View file https://github.com/fudianchn/JSqlParser/blob/fcb6b9868019f6a96a9fead16dea77e89a0131b5/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/2774/{{ revealButtonHref }}
https://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
https://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c
src/test/java/net/sf/jsqlparser/statement/KeywordsTest.javahttps://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-c05162cd0932c6170f1975806e20dc280019ba0f96d26a56b313b4d237509b17
View file https://github.com/fudianchn/JSqlParser/blob/fcb6b9868019f6a96a9fead16dea77e89a0131b5/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/2774/{{ revealButtonHref }}
https://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-c05162cd0932c6170f1975806e20dc280019ba0f96d26a56b313b4d237509b17
https://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-c05162cd0932c6170f1975806e20dc280019ba0f96d26a56b313b4d237509b17
https://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-c05162cd0932c6170f1975806e20dc280019ba0f96d26a56b313b4d237509b17
https://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-c05162cd0932c6170f1975806e20dc280019ba0f96d26a56b313b4d237509b17
https://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-c05162cd0932c6170f1975806e20dc280019ba0f96d26a56b313b4d237509b17
https://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-c05162cd0932c6170f1975806e20dc280019ba0f96d26a56b313b4d237509b17
https://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-c05162cd0932c6170f1975806e20dc280019ba0f96d26a56b313b4d237509b17
https://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-c05162cd0932c6170f1975806e20dc280019ba0f96d26a56b313b4d237509b17
https://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-c05162cd0932c6170f1975806e20dc280019ba0f96d26a56b313b4d237509b17
https://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-c05162cd0932c6170f1975806e20dc280019ba0f96d26a56b313b4d237509b17
https://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-c05162cd0932c6170f1975806e20dc280019ba0f96d26a56b313b4d237509b17
https://github.com/JSQLParser/JSqlParser/pull/2774/files#diff-c05162cd0932c6170f1975806e20dc280019ba0f96d26a56b313b4d237509b17
Please reload this pagehttps://github.com/JSQLParser/JSqlParser/pull/2774/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.