René's URL Explorer Experiment
Title: Share MySQL account names across CREATE USER and DEFINER by minleejae · Pull Request #2806 · JSQLParser/JSqlParser · GitHub
Open Graph Title: Share MySQL account names across CREATE USER and DEFINER by minleejae · Pull Request #2806 · JSQLParser/JSqlParser
X Title: Share MySQL account names across CREATE USER and DEFINER by minleejae · Pull Request #2806 · JSQLParser/JSqlParser
Description: Purpose
Read MySQL account names (user[@host]) with one grammar rule wherever they appear. Today, CREATE USER and the view, trigger and routine DEFINER clause each repeat the same rule, and both miss spellings that MySQL accepts:
CREATE USER app@'%' and CREATE USER 'app'@localhost fail. The lexer reads app@ and @localhost as single tokens, and neither rule splits them.
Without a dialect, CREATE USER "app"@"%" IDENTIFIED BY 'x' renders as CREATE USER app@% IDENTIFIED BY 'x', which is not valid SQL. The double quotes are dropped.
A backquoted part keeps its backquotes inside the value (`app`), while a single-quoted part keeps only its text (app).
The account statements and GRANT/REVOKE changes that follow build on this rule.
Current design (As-is)
MySqlUserAccount() (CREATE USER) and MySqlDefiner() both read MySqlAccountNamePart() [@ MySqlAccountNamePart()].
MySqlAccountNamePart() turns an identifier into new StringValue(name). That constructor strips double quotes, and the result is then marked unquoted.
Target design (To-be)
Add one production, MySqlAccountName(), that returns a UserAccount with separate user and host parts. It accepts every spelling:
each part unquoted or quoted with ', " or a backquote;
the lexer-merged forms app@localhost, app@'%' and 'app'@localhost, which it splits into user and host.
MySqlUserAccount() (CREATE USER) and MySqlDefiner() use it. Their models are unchanged: UserAccount and MySqlDefiner keep getUser()/getHost().
A double-quoted or backquoted part keeps its quote character in getQuoteStr() and its text in getValue(), the same way a single-quoted part already did. CREATE USER "app"@"%" now renders unchanged in every mode.
DEFINER = CURRENT_USER[()] is unchanged.
Document the account names in the usage guide.
Compatibility: rendered SQL is unchanged, except for the double-quoted accounts that previously lost their quotes. In the AST:
A backquoted part now has the value app with quote `, instead of the value `app`.
An unquoted app@localhost is now split into user app and host localhost. Before, it was one user named app@localhost without a host.
Validation
New MySqlAccountNameTest, 25 cases. Ten spellings each go through CREATE USER (with Dialect.MYSQL and without a dialect), view DEFINER and trigger DEFINER, with exact toString() and StatementDeParser output and the user/host value and quote character. It also checks rejected forms (app@, @host, 'app'@) and the unchanged DEFINER = CURRENT_USER().
Java 17 offline Gradle spotlessApply check: 10,377 tests, 10,352 passed, 25 skipped, zero failures/errors. The grammar choice conflict check passes.
MySQL 8.4: ran 12 CREATE USER, DEFINER view/trigger and lookup statements in original and rendered form on two identical servers. The results match, and the created accounts and definers are identical: app2@'%', 'app3'@localhost, `app4`@`%`, "app5"@"%", …
A corpus of 635 MySQL 8.4 / PostgreSQL 18 DDL and DCL statements, each accepted by the server: parse results are unchanged from master. On two servers per database, the rendered SQL gives the same results as the original for all 205 MySQL and 327 PostgreSQL statements that render.
Integration validation
Applied #2806–#2819 together on master (bdf8ac31), with the stacked PRs on top of their bases (#2806 → #2807 → #2808, #2806 → #2809 → #2810 and #2811 → #2812).
Each branch merges cleanly into master. Between the branches, conflicts are limited to adjacent additions (README/index rows, usage sections, imports, visitor and feature lists, one enum line and one alias guard).
The integrated build passes Java 17 offline Gradle spotlessApply check: 11,494 tests, 11,469 passed, 25 skipped, zero failures/errors. The grammar choice conflict check passes.
On a corpus of 635 MySQL 8.4 and PostgreSQL 18 DDL/DCL statements, each accepted by the server, the integrated build parses 265 of 271 MySQL statements (master: 206) and 363 of 364 PostgreSQL statements (master: 328). Every MySQL 8.4 non-reserved word and PostgreSQL 18 unreserved or column-name keyword parses as a column and table name.
On paired MySQL 8.4 and PostgreSQL 18.3 servers, all 263 MySQL and 362 PostgreSQL statements rendered by the integrated build give the same results as the originals.
Open Graph Description: Purpose
Read MySQL account names (user[@host]) with one grammar rule wherever they appear. Today, CREATE USER and the view, trigger and routine DEFINER clause each repeat the same rule, and both mi...
X Description: Purpose
Read MySQL account names (user[@host]) with one grammar rule wherever they appear. Today, CREATE USER and the view, trigger and routine DEFINER clause each repeat the same rule, and both mi...
Opengraph URL: https://github.com/JSQLParser/JSqlParser/pull/2806
X: @github
direct link
Domain: github.com
IPv4 address: 140.82.114.4
| react-profiling | 0 |
| react-import-map | react,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-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:ebeae241-2c87-5f63-113a-c2c6fa858269 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | EAF0:73AE1:321720:434AFC:6B049731 |
| html-safe-nonce | 2c6f8d24dfc213c2940a03640aee6db22c3af43f75fdccc38ab61d6e02f2d23d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQUYwOjczQUUxOjMyMTcyMDo0MzRBRkM6NkIwNDk3MzEiLCJ2aXNpdG9yX2lkIjoiMTQ4NTgxNDM5Mjc2NjYzMzc3NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f690ba648be62d9d819f1885f61481da79dab57bcca53c94c692cf3b2388ddd7 |
| hovercard-subject-tag | pull_request:4854547257 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | ///pull_requests/show/files |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/JSQLParser/JSqlParser/pull/2806/files |
| twitter:image | https://avatars.githubusercontent.com/u/55116920?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/55116920?s=400&v=4 |
| og:image:alt | Purpose
Read MySQL account names (user[@host]) with one grammar rule wherever they appear. Today, CREATE USER and the view, trigger and routine DEFINER clause each repeat the same rule, and both mi... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9784b6f42e2d5eac4e394fa88cad134c0dc5b6662b4ff2787a1ed1ef5a96331d |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/JSQLParser/JSqlParser git https://github.com/JSQLParser/JSqlParser.git |
| octolytics-dimension-user_id | 4643847 |
| octolytics-dimension-user_login | JSQLParser |
| octolytics-dimension-repository_id | 1944709 |
| octolytics-dimension-repository_nwo | JSQLParser/JSqlParser |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1944709 |
| octolytics-dimension-repository_network_root_nwo | JSQLParser/JSqlParser |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3fd14143b75b2af7b76bbd23b069867d091adfcc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Skip to content | https://github.com/JSQLParser/JSqlParser/pull/2806/files#start-of-content |
| https://github.com/ |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FJSQLParser%2FJSqlParser%2Fpull%2F2806%2Ffiles |
| GitHubRepository hosting, code review, and collaboration | https://github.com/platform |
| CopilotAI coding agent for tasks, projects, and automated work | https://github.com/features/copilot |
| ActionsCI/CD and automation | https://github.com/features/actions |
| Code QualityQuality analysis, fixes, and enforcement | https://github.com/features/code-quality |
| CodespacesCloud development environments | https://github.com/features/codespaces |
| Code SecurityVulnerability detection and remediation | https://github.com/security/advanced-security/code-security |
| Secret ProtectionSecret scanning and leak prevention | https://github.com/security/advanced-security/secret-protection |
| All Features | https://github.com/features |
| Documentation | https://docs.github.com/en |
| Training | https://learn.github.com/skills |
| Certifications | https://learn.github.com/credentials |
| Build with Copilot | https://github.com/features/ai |
| Customize Copilot | https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview |
| Integrations | https://github.com/marketplace |
| Trending repos | https://github.com/trending |
| GitHub Sponsors | https://github.com/open-source/sponsors |
| Developer articles | https://github.com/resources/articles |
| ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place. | https://github.blog/changelog/ |
| Enterprises | https://github.com/enterprise |
| Team | https://github.com/team |
| Startups | https://github.com/enterprise/startups |
| Nonprofits | https://github.com/solutions/industry/nonprofits |
| Healthcare | https://github.com/solutions/industry/healthcare |
| Financial services | https://github.com/solutions/industry/financial-services |
| Manufacturing | https://github.com/solutions/industry/manufacturing |
| Government | https://github.com/solutions/industry/government |
| See all industries | https://github.com/solutions/industry |
| Why GitHub | https://github.com/why-github |
| Customer Stories | https://github.com/customer-stories |
| Business insights | https://github.com/solutions/executive-insights |
| Trust Center | https://github.com/trust-center |
| GitHub Advanced SecurityEnterprise-grade code security | https://github.com/security/advanced-security |
| Copilot for businessEnterprise-grade AI features | https://github.com/features/copilot/copilot-business |
| Premium SupportEnterprise-grade 24/7 support | https://github.com/enterprise/premium-support |
| Documentation | https://docs.github.com/en |
| Resource center | https://github.com/resources |
| Blog | https://github.blog/ |
| Events & webinars | https://github.com/resources/events |
| Community Forum | https://github.com/orgs/community/discussions |
| Customer Stories | https://github.com/customer-stories |
| Integrations | https://github.com/marketplace |
| Customer support | https://help.github.com/ |
| Training | https://learn.github.com/skills |
| GitHub Status | https://www.githubstatus.com/ |
| About | https://github.com/about |
| Partners | https://github.com/partners |
| Changelog | https://github.blog/changelog/ |
| GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub. | https://githubuniverse.com/ |
| Pricing | https://github.com/pricing |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FJSQLParser%2FJSqlParser%2Fpull%2F2806%2Ffiles |
| Sign up | https://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 |
| Reload | https://github.com/JSQLParser/JSqlParser/pull/2806/files |
| Reload | https://github.com/JSQLParser/JSqlParser/pull/2806/files |
| Reload | https://github.com/JSQLParser/JSqlParser/pull/2806/files |
| JSQLParser | https://github.com/JSQLParser |
| JSqlParser | https://github.com/JSQLParser/JSqlParser |
| Code | https://github.com/JSQLParser/JSqlParser |
| Issues2 (2) | https://github.com/JSQLParser/JSqlParser/issues |
| Pull requests2 (2) | https://github.com/JSQLParser/JSqlParser/pulls |
| Discussions | https://github.com/JSQLParser/JSqlParser/discussions |
| Actions | https://github.com/JSQLParser/JSqlParser/actions |
| Projects | https://github.com/JSQLParser/JSqlParser/projects |
| Wiki | https://github.com/JSQLParser/JSqlParser/wiki |
| Security and quality | https://github.com/JSQLParser/JSqlParser/security |
| Insights | https://github.com/JSQLParser/JSqlParser/insights |
| Sign up for GitHub
| https://github.com/signup?return_to=%2FJSQLParser%2FJSqlParser%2Fissues%2Fnew%2Fchoose |
| terms of service | https://docs.github.com/terms |
| privacy statement | https://docs.github.com/privacy |
| Sign in | https://github.com/login?return_to=%2FJSQLParser%2FJSqlParser%2Fissues%2Fnew%2Fchoose |
| manticore-projects | https://github.com/manticore-projects |
| JSQLParser:master | https://github.com/JSQLParser/JSqlParser/tree/master |
| minleejae:refactor/mysql-account-names-20261014 | https://github.com/minleejae/JSqlParser/tree/refactor/mysql-account-names-20261014 |
|
Conversation
1
| https://github.com/JSQLParser/JSqlParser/pull/2806 |
|
Commits
1
| https://github.com/JSQLParser/JSqlParser/pull/2806/commits |
|
Checks
10
| https://github.com/JSQLParser/JSqlParser/pull/2806/checks |
|
Files changed
| https://github.com/JSQLParser/JSqlParser/pull/2806/files |
| Please reload this page | https://github.com/JSQLParser/JSqlParser/pull/2806/files |
|
Share MySQL account names across CREATE USER and DEFINER
| https://github.com/JSQLParser/JSqlParser/pull/2806/files#top |
|
Show all changes
1 commit
| https://github.com/JSQLParser/JSqlParser/pull/2806/files |
|
1af2ff3
fix: share MySQL account names across CREATE USER and DEFINER
minleejae Oct 14, 2026
| https://github.com/JSQLParser/JSqlParser/pull/2806/commits/1af2ff3e8656992fca98f24fcfb06aec5a001278 |
|
Clear filters
| https://github.com/JSQLParser/JSqlParser/pull/2806/files |
| Please reload this page | https://github.com/JSQLParser/JSqlParser/pull/2806/files |
| Please reload this page | https://github.com/JSQLParser/JSqlParser/pull/2806/files |
|
JSqlParserCC.jjt
| https://github.com/JSQLParser/JSqlParser/pull/2806/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c |
|
usage.rst
| https://github.com/JSQLParser/JSqlParser/pull/2806/files#diff-1d76e581381361db03988ab6bd07be336cb8129b61bda04ab3fe334209488c2c |
|
MySqlAccountNameTest.java
| https://github.com/JSQLParser/JSqlParser/pull/2806/files#diff-a065ddf681a446dc75b58efcbe069fa10f2f0e75aeada3b5ba59a3e21da1f516 |
| src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt | https://github.com/JSQLParser/JSqlParser/pull/2806/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c |
|
View file
| https://github.com/minleejae/JSqlParser/blob/1af2ff3e8656992fca98f24fcfb06aec5a001278/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/2806/{{ revealButtonHref }} |
|
| https://github.com/JSQLParser/JSqlParser/pull/2806/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c |
|
| https://github.com/JSQLParser/JSqlParser/pull/2806/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c |
|
| https://github.com/JSQLParser/JSqlParser/pull/2806/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c |
|
| https://github.com/JSQLParser/JSqlParser/pull/2806/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c |
|
| https://github.com/JSQLParser/JSqlParser/pull/2806/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c |
|
| https://github.com/JSQLParser/JSqlParser/pull/2806/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c |
|
| https://github.com/JSQLParser/JSqlParser/pull/2806/files#diff-d323df58a0300a038ac87b328bf05b8255ff06e6b5d0e9aeae641fa566e4068c |
| src/site/sphinx/usage.rst | https://github.com/JSQLParser/JSqlParser/pull/2806/files#diff-1d76e581381361db03988ab6bd07be336cb8129b61bda04ab3fe334209488c2c |
|
View file
| https://github.com/minleejae/JSqlParser/blob/1af2ff3e8656992fca98f24fcfb06aec5a001278/src/site/sphinx/usage.rst |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/JSQLParser/JSqlParser/pull/2806/{{ revealButtonHref }} |
|
| https://github.com/JSQLParser/JSqlParser/pull/2806/files#diff-1d76e581381361db03988ab6bd07be336cb8129b61bda04ab3fe334209488c2c |
|
| https://github.com/JSQLParser/JSqlParser/pull/2806/files#diff-1d76e581381361db03988ab6bd07be336cb8129b61bda04ab3fe334209488c2c |
| src/test/java/net/sf/jsqlparser/statement/create/user/MySqlAccountNameTest.java | https://github.com/JSQLParser/JSqlParser/pull/2806/files#diff-a065ddf681a446dc75b58efcbe069fa10f2f0e75aeada3b5ba59a3e21da1f516 |
|
View file
| https://github.com/minleejae/JSqlParser/blob/1af2ff3e8656992fca98f24fcfb06aec5a001278/src/test/java/net/sf/jsqlparser/statement/create/user/MySqlAccountNameTest.java |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/JSQLParser/JSqlParser/pull/2806/{{ revealButtonHref }} |
| Please reload this page | https://github.com/JSQLParser/JSqlParser/pull/2806/files |
|
| https://github.com |
| Terms | https://docs.github.com/site-policy/github-terms/github-terms-of-service |
| Privacy | https://docs.github.com/site-policy/privacy-policies/github-privacy-statement |
| Security | https://github.com/security |
| Status | https://www.githubstatus.com/ |
| Community | https://github.community/ |
| Docs | https://docs.github.com/ |
| Contact | https://support.github.com?tags=dotcom-footer |
Response headers:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width
URLs of crawlers that visited me.