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

JSON_TABLE: support all data types (ENUM, SET, geometry, INET6, etc)

    XMLWordPrintable

Details

    Description

      Currently JSON_TABLE explicitly limits supported column types to a basic subset of types. Other types cause syntax error:

      bb-10.6-mdev17399-psergey2 8b533cc1d5

      MariaDB [test]> select * from json_table('["foo"]', '$[*]' columns(a enum('foo','bar') path '$')) a;
      ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'enum('foo','bar') path '$')) a' at line 1
      

      Works in MySQL:

      MySQL 8.0.23

      MySQL [test]> select * from json_table('["foo"]', '$[*]' columns(a enum('foo','bar') path '$')) a;
      +------+
      | a    |
      +------+
      | foo  |
      +------+
      1 row in set (0.001 sec)
      

      This is unexpected and, for example, MySQL, doesn't do that.

      Attachments

        Issue Links

          Activity

            People

              rucha174 Rucha Deodhar
              elenst Elena Stepanova
              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.