Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-35497

Provide MariaDB option for supporting native JSON type definition

    XMLWordPrintable

Details

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            juanparati Juan Lago
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start 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.