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

Enforce check constraint on JSON type

Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.4.3
    • JSON
    • None

    Description

      Since there's no context where someone will want a JSON type without the constraint, and excluding it causes compatibility problems with MySQL, why not map

      CREATE TABLE t (j JSON);
      

      to

      CREATE TABLE t (
        j JSON 
        CHECK (JSON_VALID(j))
      );
      

      Attachments

        Issue Links

          Activity

            greenman Ian Gilfillan created issue -
            greenman Ian Gilfillan made changes -
            Field Original Value New Value
            serg Sergei Golubchik made changes -
            Description Since there's no context where someone will want a JSON type without the constraint, and excluding it causes compatibility problems with MySQL, why not map
            {{code}}
            CREATE TABLE t (j JSON);
            {{code}}
            to
            {{code}}
            CREATE TABLE t (
              j JSON
              CHECK (JSON_VALID(j))
            );
            {{code}}
            Since there's no context where someone will want a JSON type without the constraint, and excluding it causes compatibility problems with MySQL, why not map
            {code:sql}
            CREATE TABLE t (j JSON);
            {code}
            to
            {code:sql}
            CREATE TABLE t (
              j JSON
              CHECK (JSON_VALID(j))
            );
            {code}
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            ralf.gebhardt Ralf Gebhardt made changes -
            Epic Link PT-76 [ 68557 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Assignee Alexey Botchkov [ holyfoot ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 10.4 [ 22408 ]
            monty Michael Widenius made changes -
            Assignee Alexey Botchkov [ holyfoot ] Michael Widenius [ monty ]
            monty Michael Widenius made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            monty Michael Widenius made changes -
            Fix Version/s 10.4.3 [ 23230 ]
            Fix Version/s 10.4 [ 22408 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 82802 ] MariaDB v4 [ 133351 ]

            People

              monty Michael Widenius
              greenman Ian Gilfillan
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.