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

JSON paths containing dashes are reported as syntax errors in procedures

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 10.9.1
    • Fix Version/s: 10.9.5
    • Component/s: JSON
    • Labels:
    • Environment:
      EndeavorOS but with MariaDB 10.9.2 from Dockerhub container

      Description

      JSON paths with dashes in them are reported as syntax errors inside procedures. If they are free-standing, they work fine.

      DROP PROCEDURE IF EXISTS my_proc;
       
      DELIMITER $$
      CREATE PROCEDURE my_proc()
      BEGIN
      DECLARE result TEXT;
      SET result = JSON_EXTRACT('{ "my-key": 1 }', '$."my-key"');
      END $$
      DELIMITER ;
       
      CALL my_proc();
      

      --------------
      CALL my_proc()
      --------------
       
      ERROR 4042 (HY000) at line 11: Syntax error in JSON path in argument 2 to function 'json_extract' at position 6
      

      This syntax works in procedures on MariaDB 10.8.4 and prior.

      More about the environment:

      $ cat /etc/os-release
      NAME='EndeavourOS'
      PRETTY_NAME='EndeavourOS'
      ID=endeavouros
      ID_LIKE=arch
      BUILD_ID=2021.04.17
      ANSI_COLOR="38;2;23;147;209"
      HOME_URL='https://endeavouros.com'
      DOCUMENTATION_URL='https://discovery.endeavouros.com'
      SUPPORT_URL='https://forum.endeavouros.com'
      BUG_REPORT_URL='https://forum.endeavouros.com/c/arch-based-related-questions/bug-reports'
      LOGO=endeavouros
      

      Dockerized MariaDB:

      Server version: 10.9.2-MariaDB-1:10.9.2+maria~ubu2204 mariadb.org binary distribution
      

      $ mysql --version
      mysql  Ver 15.1 Distrib 10.8.4-MariaDB, for Linux (x86_64) using readline 5.1
      

      But also tested with the client included in the docker container, same result:

      $ docker exec -it 97795998875c bin/mysql --version
      bin/mysql  Ver 15.1 Distrib 10.9.2-MariaDB, for debian-linux-gnu (x86_64) using  EditLine wrapper
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rucha174 Rucha Deodhar
              Reporter:
              andrei-pavel Andrei Pavel
              Votes:
              3 Vote for this issue
              Watchers:
              8 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.