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

Add JSON_DECODE() function to decode a json string to a dynamic column structure

    XMLWordPrintable

Details

    Description

      Dynamic column functionality includes a COLUMN_JSON() function to transform a dynamic column structure to a JSON string. It would be handy to also have a counterpart function that decodes a JSON string into a dynamic column structure. It could potentially be used like this

      SELECT COLUMN_GET(JSON_DECODE('{"child_column":12345}'), 'child_column' AS int);
      SELECT COLUMN_GET(COLUMN_GET(JSON_DECODE('{"parent_column":{"child_column":12345}}'), 'parent_column' AS char), 'child_column' AS int);

      I currently store quite some JSON values as TEXT in tables, so alternatively this could also allow me to use JSON_DECODE() on INSERT to store it as a dynamic column structure directly.

      Attachments

        Activity

          People

            Unassigned Unassigned
            pprkut Heinz Wiesinger
            Votes:
            2 Vote for this issue
            Watchers:
            4 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.