René's URL Explorer Experiment


Title: [Bug]: Problem exporting an unsual index (IFNULL expression) · Issue #640 · phpmyadmin/sql-parser · GitHub

Open Graph Title: [Bug]: Problem exporting an unsual index (IFNULL expression) · Issue #640 · phpmyadmin/sql-parser

X Title: [Bug]: Problem exporting an unsual index (IFNULL expression) · Issue #640 · phpmyadmin/sql-parser

Description: Describe the bug I added this index to a table: ALTER TABLE drafts ADD UNIQUE unique_draft (type,user,(IFNULL(touser,'_CHAT_'))) USING BTREE; and when I try to export it fails with this error (on hosting phpmyadmin version 5.1.0, mysql i...

Open Graph Description: Describe the bug I added this index to a table: ALTER TABLE drafts ADD UNIQUE unique_draft (type,user,(IFNULL(touser,'_CHAT_'))) USING BTREE; and when I try to export it fails with this error (on h...

X Description: Describe the bug I added this index to a table: ALTER TABLE drafts ADD UNIQUE unique_draft (type,user,(IFNULL(touser,'_CHAT_'))) USING BTREE; and when I try to export it fails with this err...

Opengraph URL: https://github.com/phpmyadmin/sql-parser/issues/640

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Problem exporting an unsual index (IFNULL expression) ","articleBody":"### Describe the bug\n\nI added this index to a table:\n```sql\nALTER TABLE drafts\n  ADD UNIQUE unique_draft (type,user,(IFNULL(touser,'_CHAT_'))) USING BTREE;\n```\nand when I try to export it fails with this error (on hosting phpmyadmin version 5.1.0, mysql is Percona 8.0.43-34):\n\n> \u003cb>Fatal error\u003c/b>:  Uncaught TypeError: str_replace(): Argument phpmyadmin/phpmyadmin#3 ($subject) must be of type array|string, null given in /var/www/html/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Context.php:608\n> Stack trace:\n> #0 /var/www/html/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Context.php(608): str_replace()\n> phpmyadmin/phpmyadmin#1 /var/www/html/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/Key.php(203): PhpMyAdmin\\SqlParser\\Context::escape()\n> phpmyadmin/phpmyadmin#2 /var/www/html/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Component.php(74): PhpMyAdmin\\SqlParser\\Components\\Key::build()\n> phpmyadmin/phpmyadmin#3 /var/www/html/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/CreateDefinition.php(360): PhpMyAdmin\\SqlParser\\Component->__toString()\n> phpmyadmin/phpmyadmin#4 /var/www/html/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Component.php(74): PhpMyAdmin\\SqlParser\\Components\\CreateDefinition::build()\n> phpmyadmin/phpmyadmin#5 [internal function]: PhpMyAdmin\\SqlParser\\Component->__toString()\n> phpmyadmin/phpmyadmin#6 /var/www/html/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/CreateDefinition.php(339): implode()\n> phpmyadmin/phpmyadmin#7 /var/www/html/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/CreateStatement.php(380): PhpMyAdmin\\SqlParser\\Components\\CreateDefinition::build()\n> phpmyadmin/phpmyadmin#8 /var/www/html/phpMyAdmin/libraries/classes/Plugins/Export/ExportSql.php(2951): PhpMyAdmin\\SqlParser\\Statements\\CreateStatement->build()\n> phpmyadmin/phpmyadmin#9 /var/www/html/phpMyAdmin/libraries/classes/Plugins/Export/ExportSql.php(1638): PhpMyAdmin\\Plugins\\Export\\ExportSql->replaceWithAliases()\n> phpmyadmin/phpmyadmin#10 /var/www/html/phpMyAdmin/libraries/classes/Plugins/Export/ExportSql.php(2138): PhpMyAdmin\\Plugins\\Export\\ExportSql->getTableDef()\n> phpmyadmin/phpmyadmin#11 /var/www/html/phpMyAdmin/libraries/classes/Export.php(813): PhpMyAdmin\\Plugins\\Export\\ExportSql->exportStructure()\n> phpmyadmin/phpmyadmin#12 /var/www/html/phpMyAdmin/libraries/classes/Controllers/ExportController.php(549): PhpMyAdmin\\Export->exportDatabase()\n> phpmyadmin/phpmyadmin#13 /var/www/html/phpMyAdmin/libraries/classes/Routing.php(186): PhpMyAdmin\\Controllers\\ExportController->index()\n> phpmyadmin/phpmyadmin#14 /var/www/html/phpMyAdmin/index.php(50): PhpMyAdmin\\Routing::callControllerForRoute()\n> phpmyadmin/phpmyadmin#15 {main}\n>   thrown in \u003cb>/var/www/html/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Context.php\u003c/b> on line \u003cb>608\u003c/b>\u003cbr />\n\nOn version 5.2.1 with mysql 8.0.41 it won't fails but the export result is like this \n```sql\nALTER TABLE drafts ADD UNIQUE KEY unique_draft (type,user,(_CHAT_));\n```\nwhich is wrong.\n\n### How to Reproduce\n\nTable structure is:\n```sql\nCREATE TABLE drafts (\n  type enum('CHAT','MSGS') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,\n  user varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,\n  touser varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL,\n  text text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,\n  date datetime NOT NULL\n);\nALTER TABLE drafts ADD UNIQUE unique_draft (type, user,(IFNULL(touser,'_CHAT_'))) USING BTREE;\n```\n\n\n### Expected behavior\n\nI expect it to export the index like the original one\n\n### Screenshots\n\n_No response_\n\n### Operating System\n\n_No response_\n\n### Web Server\n\n_No response_\n\n### Database Server\n\nMySQL\n\n### Database version\n\n_No response_\n\n### PHP version\n\n_No response_\n\n### phpMyAdmin version\n\n5.1.0\n\n### browser\n\n_No response_\n\n### Additional context\n\n_No response_","author":{"url":"https://github.com/alescan86","@type":"Person","name":"alescan86"},"datePublished":"2025-12-09T14:36:30Z","url":"https://github.com/phpmyadmin/sql-parser/issues/640"}

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/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:fc577444-9bd6-3268-bac9-5f21ebe20c47
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE346:1567FF:34E4E1:477DB7:6B0436BA
html-safe-nonce7e1613a930e51305126d3524bc026498699b09b10c8eb6b654e264d1bf04a2c9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzQ2OjE1NjdGRjozNEU0RTE6NDc3REI3OjZCMDQzNkJBIiwidmlzaXRvcl9pZCI6IjY3OTcyOTA5NDc1Mzg1OTc1NjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac92a732e8f18d45e47cf558536c8de93bab4464965e7c003c19a94f786a58b7a4
hovercard-subject-tagissue:3911110365
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/phpmyadmin/sql-parser/640/issue_layout
twitter:imagehttps://opengraph.githubassets.com/768eb09b7c7ebff315ac7ba60a7e0d5719472f4f300fce9a54e979311a5df9d2/phpmyadmin/sql-parser/issues/640
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/768eb09b7c7ebff315ac7ba60a7e0d5719472f4f300fce9a54e979311a5df9d2/phpmyadmin/sql-parser/issues/640
og:image:altDescribe the bug I added this index to a table: ALTER TABLE drafts ADD UNIQUE unique_draft (type,user,(IFNULL(touser,'_CHAT_'))) USING BTREE; and when I try to export it fails with this error (on h...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamealescan86
hostnamegithub.com
expected-hostnamegithub.com
Noneb7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e
turbo-cache-controlno-preview
go-importgithub.com/phpmyadmin/sql-parser git https://github.com/phpmyadmin/sql-parser.git
octolytics-dimension-user_id1351977
octolytics-dimension-user_loginphpmyadmin
octolytics-dimension-repository_id36256604
octolytics-dimension-repository_nwophpmyadmin/sql-parser
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id36256604
octolytics-dimension-repository_network_root_nwophpmyadmin/sql-parser
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasec3dd496c3da6ea6b77e69c09279d2b81604654f1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/phpmyadmin/sql-parser/issues/640#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fphpmyadmin%2Fsql-parser%2Fissues%2F640
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%2Fphpmyadmin%2Fsql-parser%2Fissues%2F640
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=phpmyadmin%2Fsql-parser
Reloadhttps://github.com/phpmyadmin/sql-parser/issues/640
Reloadhttps://github.com/phpmyadmin/sql-parser/issues/640
Reloadhttps://github.com/phpmyadmin/sql-parser/issues/640
phpmyadminhttps://github.com/phpmyadmin
sql-parserhttps://github.com/phpmyadmin/sql-parser
Codehttps://github.com/phpmyadmin/sql-parser
Issues55 (55)https://github.com/phpmyadmin/sql-parser/issues
Pull requests21 (21)https://github.com/phpmyadmin/sql-parser/pulls
Actionshttps://github.com/phpmyadmin/sql-parser/actions
Security and qualityhttps://github.com/phpmyadmin/sql-parser/security
Insightshttps://github.com/phpmyadmin/sql-parser/insights
https://github.com/phpmyadmin/sql-parser
New issuehttps://github.com/login?return_to=https://github.com/phpmyadmin/sql-parser/issues/640
New issuehttps://github.com/login?return_to=https://github.com/phpmyadmin/sql-parser/issues/640
[Bug]: Problem exporting an unsual index (IFNULL expression) https://github.com/phpmyadmin/sql-parser/issues/640#top
bughttps://github.com/phpmyadmin/sql-parser/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com/alescan86
alescan86https://github.com/alescan86
on Dec 9, 2025https://github.com/phpmyadmin/sql-parser/issues/640#issue-3911110365
phpmyadmin/phpmyadmin#3https://github.com/phpmyadmin/phpmyadmin/pull/3
phpmyadmin/phpmyadmin#1https://github.com/phpmyadmin/phpmyadmin/pull/1
phpmyadmin/phpmyadmin#2https://github.com/phpmyadmin/phpmyadmin/pull/2
phpmyadmin/phpmyadmin#3https://github.com/phpmyadmin/phpmyadmin/pull/3
phpmyadmin/phpmyadmin#4https://github.com/phpmyadmin/phpmyadmin/pull/4
phpmyadmin/phpmyadmin#5https://github.com/phpmyadmin/phpmyadmin/pull/5
phpmyadmin/phpmyadmin#6https://github.com/phpmyadmin/phpmyadmin/pull/6
phpmyadmin/phpmyadmin#7https://github.com/phpmyadmin/phpmyadmin/pull/7
phpmyadmin/phpmyadmin#8https://github.com/phpmyadmin/phpmyadmin/pull/8
phpmyadmin/phpmyadmin#9https://github.com/phpmyadmin/phpmyadmin/pull/9
phpmyadmin/phpmyadmin#10https://github.com/phpmyadmin/phpmyadmin/pull/10
phpmyadmin/phpmyadmin#11https://github.com/phpmyadmin/phpmyadmin/pull/11
phpmyadmin/phpmyadmin#12https://github.com/phpmyadmin/phpmyadmin/pull/12
phpmyadmin/phpmyadmin#13https://github.com/phpmyadmin/phpmyadmin/pull/13
phpmyadmin/phpmyadmin#14https://github.com/phpmyadmin/phpmyadmin/pull/14
phpmyadmin/phpmyadmin#15https://github.com/phpmyadmin/phpmyadmin/pull/15
alescan86https://github.com/alescan86
bughttps://github.com/phpmyadmin/sql-parser/issues?q=state%3Aopen%20label%3A%22bug%22
on Dec 9, 2025https://github.com/phpmyadmin/sql-parser/issues/640#event-22614105917
https://github.com/williamdes
williamdeshttps://github.com/williamdes
on Feb 7, 2026https://github.com/phpmyadmin/sql-parser/issues/640#issuecomment-3865208882
williamdeshttps://github.com/williamdes
on Feb 7, 2026https://github.com/phpmyadmin/sql-parser/issues/640#event-22614105924
https://github.com/MoonE
MoonEhttps://github.com/MoonE
on Feb 7, 2026https://github.com/phpmyadmin/sql-parser/issues/640#issuecomment-3865208885
williamdeshttps://github.com/williamdes
phpmyadmin/phpmyadminhttps://github.com/phpmyadmin/phpmyadmin
on Feb 7, 2026https://github.com/phpmyadmin/sql-parser/issues/640#event-22614106105
Sign up for freehttps://github.com/signup?return_to=https://github.com/phpmyadmin/sql-parser/issues/640
Sign in to commenthttps://github.com/login?return_to=https://github.com/phpmyadmin/sql-parser/issues/640
bughttps://github.com/phpmyadmin/sql-parser/issues?q=state%3Aopen%20label%3A%22bug%22
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-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.