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

JSON_TABLE: CREATE VIEW involving EXISTS PATH ends up with invalid frm

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: N/A
    • Fix Version/s: 10.6.0
    • Component/s: JSON, Views
    • Labels:
      None

      Description

      CREATE VIEW v AS SELECT * FROM JSON_TABLE('[]', '$' COLUMNS (f INT EXISTS PATH '$')) a ;
      

      bb-10.6-mdev17399-psergey2 8b533cc1d5

      MariaDB [test]> CREATE VIEW v AS SELECT * FROM JSON_TABLE('[]', '$' COLUMNS (f INT EXISTS PATH '$')) a ;
      Query OK, 0 rows affected (0.015 sec)
       
      MariaDB [test]> SELECT * FROM v;
      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 ''$')) `a`' at line 1
      MariaDB [test]> show create view v;
      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 ''$')) `a`' at line 1
      

      .frm contents:

      $ cat data/test/v.frm 
      TYPE=VIEW
      query=select `a`.`f` AS `f` from JSON_TABLE(\'[]\', \'$\' COLUMNS (`f` int(11) EXISTS \'$\')) `a`
      md5=bbd1c0cae1934192b0e8ff8a3f6c491a
      updatable=1
      algorithm=0
      definer_user=root
      definer_host=localhost
      suid=2
      with_check_option=0
      timestamp=2021-03-15 15:10:36
      create-version=2
      source=SELECT * FROM JSON_TABLE(\'[]\', \'$\' COLUMNS (f INT EXISTS PATH \'$\')) a
      client_cs_name=utf8
      connection_cl_name=utf8_general_ci
      view_body_utf8=select `a`.`f` AS `f` from JSON_TABLE(\'[]\', \'$\' COLUMNS (`f` int(11) EXISTS \'$\')) `a`
      mariadb-version=100600
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              psergey Sergei Petrunia
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: