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

A VIRTUAL generated column of type JSON accepts invalid JSON

    XMLWordPrintable

Details

    • Not for Release Notes
    • Q1/2027 Server Maintenance

    Description

      CREATE TABLE t (a VARCHAR(10), j JSON AS (a) VIRTUAL);
      INSERT INTO t (a) VALUES ('notjson');
      SELECT a, j FROM t;
      

      Leads to:

      MDEV-38740 CS 13.2.0 49efccb222e2370690b4de0416817fa35f9da2ea (Debug, Clang 18.1.3-11) Build 15/10/2026

      CREATE TABLE t (a VARCHAR(10), j JSON AS (a) VIRTUAL);
      INSERT INTO t (a) VALUES ('notjson');
      SELECT a, j FROM t;
      a	j
      notjson	notjson
      

      Expected result

      CS 13.2.0 9d7ab2c0092df4bc73b64b915464aecf7e5fe6c4 (Debug, Clang 18.1.3-11) Build 06/10/2026

      INSERT INTO t (a) VALUES ('notjson');
      ERROR 4025 (23000): CONSTRAINT `t.j` failed for `test`.`t`
      

      Attachments

        Issue Links

          Activity

            People

              danblack Daniel Black
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 0d
                  0d
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 0.5h
                  0.5h

                  Git Integration

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