According to https://mariadb.com/kb/en/json-data-type/ the MariaDB JSON field is defined as a "longtext" that includes a check constraint and that makes it easy to know when "longtext" is in reality a JSON field checking the "CHECK_CONSTRAINTS" table. However many popular software designed mainly for MySQL is unaware about the MariaDB behavior and basically it trigger an error or stop to work with MariaDB despite that JSON functions can be used perfectly with "longtext" in MariaDB.
According to the MariaDB documentation the reason why "longtext" is used instead of JSON is because contradicts the SQL:2016 (See https://modern-sql.com/blog/2017-06/whats-new-in-sql-2016) and that's totally fine if we want to respect the standards, however, I believe that providing a configuration option that can make MariaDB return "json" as "longtext" can be very beneficial in the following aspects:
Increase compatibility with software and solutions that require a native "JSON" type.
Make it easy to inspect table and view field types (To inspect if a "longtext" field is a JSON is very painful on views, because it requires parsing the view definition and checking the associated table constraint).
Increase the user base (Some developers don't adopt MariaDB because it's difficult to inspect JSON field types).
MariaDB can still follow the SQL:2016 standard by default because the option is disable by default.
it contradicted our interpretation of SQL:2016, perhaps it was possible to interpret those words differently
newest SQL:2023 standard has a dedicated JSON data type
Sergei Golubchik
added a comment - A couple of comments about the standard:
it contradicted our interpretation of SQL:2016, perhaps it was possible to interpret those words differently
newest SQL:2023 standard has a dedicated JSON data type
**“Native JSON support with direct indexing, similar to PostgreSQL’s JSONB and GIN indexing, would greatly enhance MariaDB’s usability for modern applications. This feature would significantly simplify JSON querying and indexing without relying on generated columns, boosting both performance and developer productivity.
Given the growing reliance on JSON across applications, prioritizing this capability could be a substantial advantage for MariaDB in the database landscape. Looking forward to any updates or plans regarding this feature. Thank you!”**
Purushothaman Kumarvel
added a comment - **“Native JSON support with direct indexing, similar to PostgreSQL’s JSONB and GIN indexing, would greatly enhance MariaDB’s usability for modern applications. This feature would significantly simplify JSON querying and indexing without relying on generated columns, boosting both performance and developer productivity.
Given the growing reliance on JSON across applications, prioritizing this capability could be a substantial advantage for MariaDB in the database landscape. Looking forward to any updates or plans regarding this feature. Thank you!”**
People
Unassigned
Juan Lago
Votes:
3Vote for this issue
Watchers:
6Start watching this issue
Dates
Created:
Updated:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":1160.7000000476837,"ttfb":213.60000002384186,"pageVisibility":"visible","entityId":131740,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"abee76bd-6cac-495d-9e6c-f48a662707e1","navigationType":0,"readyForUser":1220.6000000238419,"redirectCount":0,"resourceLoadedEnd":1800.3000000715256,"resourceLoadedStart":218.30000007152557,"resourceTiming":[{"duration":473,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":218.30000007152557,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":218.30000007152557,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":691.3000000715256,"responseStart":0,"secureConnectionStart":0},{"duration":473,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":218.60000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":218.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":691.6000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":498.89999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":218.80000007152557,"connectEnd":218.80000007152557,"connectStart":218.80000007152557,"domainLookupEnd":218.80000007152557,"domainLookupStart":218.80000007152557,"fetchStart":218.80000007152557,"redirectEnd":0,"redirectStart":0,"requestStart":218.80000007152557,"responseEnd":717.7000000476837,"responseStart":717.7000000476837,"secureConnectionStart":218.80000007152557},{"duration":539.8999999761581,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":219,"connectEnd":219,"connectStart":219,"domainLookupEnd":219,"domainLookupStart":219,"fetchStart":219,"redirectEnd":0,"redirectStart":0,"requestStart":219,"responseEnd":758.8999999761581,"responseStart":758.8999999761581,"secureConnectionStart":219},{"duration":543.2999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":219.10000002384186,"connectEnd":219.10000002384186,"connectStart":219.10000002384186,"domainLookupEnd":219.10000002384186,"domainLookupStart":219.10000002384186,"fetchStart":219.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":219.10000002384186,"responseEnd":762.3999999761581,"responseStart":762.3999999761581,"secureConnectionStart":219.10000002384186},{"duration":543.6000000238419,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":219.20000004768372,"connectEnd":219.20000004768372,"connectStart":219.20000004768372,"domainLookupEnd":219.20000004768372,"domainLookupStart":219.20000004768372,"fetchStart":219.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":219.20000004768372,"responseEnd":762.8000000715256,"responseStart":762.8000000715256,"secureConnectionStart":219.20000004768372},{"duration":543.7000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":219.39999997615814,"connectEnd":219.39999997615814,"connectStart":219.39999997615814,"domainLookupEnd":219.39999997615814,"domainLookupStart":219.39999997615814,"fetchStart":219.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":219.39999997615814,"responseEnd":763.1000000238419,"responseStart":763.1000000238419,"secureConnectionStart":219.39999997615814},{"duration":636.3999999761581,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":219.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":219.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":855.8999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":543.8999999761581,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":219.70000004768372,"connectEnd":219.70000004768372,"connectStart":219.70000004768372,"domainLookupEnd":219.70000004768372,"domainLookupStart":219.70000004768372,"fetchStart":219.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":219.70000004768372,"responseEnd":763.6000000238419,"responseStart":763.6000000238419,"secureConnectionStart":219.70000004768372},{"duration":632,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":224.10000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":224.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":856.1000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":539.8999999761581,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":224.20000004768372,"connectEnd":224.20000004768372,"connectStart":224.20000004768372,"domainLookupEnd":224.20000004768372,"domainLookupStart":224.20000004768372,"fetchStart":224.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":224.20000004768372,"responseEnd":764.1000000238419,"responseStart":764.1000000238419,"secureConnectionStart":224.20000004768372},{"duration":1574,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":225.5,"connectEnd":225.5,"connectStart":225.5,"domainLookupEnd":225.5,"domainLookupStart":225.5,"fetchStart":225.5,"redirectEnd":0,"redirectStart":0,"requestStart":225.5,"responseEnd":1799.5,"responseStart":1799.5,"secureConnectionStart":225.5},{"duration":1570.7000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":229.60000002384186,"connectEnd":229.60000002384186,"connectStart":229.60000002384186,"domainLookupEnd":229.60000002384186,"domainLookupStart":229.60000002384186,"fetchStart":229.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":229.60000002384186,"responseEnd":1800.3000000715256,"responseStart":1800.3000000715256,"secureConnectionStart":229.60000002384186},{"duration":869.3000000715256,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":867,"connectEnd":867,"connectStart":867,"domainLookupEnd":867,"domainLookupStart":867,"fetchStart":867,"redirectEnd":0,"redirectStart":0,"requestStart":867,"responseEnd":1736.3000000715256,"responseStart":1736.3000000715256,"secureConnectionStart":867},{"duration":649.1000000238419,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1154.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1154.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1803.8000000715256,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":62,"responseStart":213,"responseEnd":229,"domLoading":217,"domInteractive":1821,"domContentLoadedEventStart":1821,"domContentLoadedEventEnd":1858,"domComplete":2650,"loadEventStart":2650,"loadEventEnd":2651,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1804.5},{"name":"bigPipe.sidebar-id.end","time":1805.2000000476837},{"name":"bigPipe.activity-panel-pipe-id.start","time":1805.3999999761581},{"name":"bigPipe.activity-panel-pipe-id.end","time":1807},{"name":"activityTabFullyLoaded","time":1870.8999999761581}],"measures":[],"correlationId":"74e7495b5b40f6","effectiveType":"4g","downlink":9.8,"rtt":0,"serverDuration":95,"dbReadsTimeInMs":11,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
A couple of comments about the standard: