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

JSON_LENGTH does not return error upon wrong number of parameters

    XMLWordPrintable

Details

    Description

      JSON_LENGTH documented (both for MariaDB and MySQL) as taking one mandatory and one optional parameter:

      JSON_LENGTH(json_doc[, path])
      

      However, in MariaDB it accepts extra parameters without complaining:

      10.5 1b12e251

      MariaDB [test]> SELECT JSON_LENGTH('{"a":"b"}','$','$', 'foo');
      +-----------------------------------------+
      | JSON_LENGTH('{"a":"b"}','$','$', 'foo') |
      +-----------------------------------------+
      |                                       1 |
      +-----------------------------------------+
      1 row in set (0.000 sec)
      

      MySQL returns an error:

      MySQL [test]> SELECT JSON_LENGTH('{"a":"b"}','$','$', 'foo');
      ERROR 1582 (42000): Incorrect parameter count in the call to native function 'JSON_LENGTH'
      

      Attachments

        Activity

          People

            danblack Daniel Black
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 50m
                50m

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.