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

Prepared statement EXECUTE into JSON support

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • Stored routines
    • None

    Description

      Allow prepared statements, when executed, to output the fetched data into a JSON array of objects. For example

      delimiter //
      CREATE OR REPLACE PROCEDURE getjson(OUT ret JSON)
      BEGIN
         DECLARE ret JSON;
       
         PREPARE s1 FROM 'SELECT 57 c1 UNION SELECT 58 c1 UNION SELECT NULL c1';
         EXECUTE s1 INTO JSON ret;
      END;
      //
      CALL getjson(@r);
      SELECT @r;
      [{"c1": 57}, {"c1": 58"},{"c1": null}]
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            karlsson Anders Karlsson
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.