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

SIGSEGV in Item_func_json_extract::read_json when using JSON_EXTRACT<=>VARCHAR

    XMLWordPrintable

Details

    • Can result in hang or crash

    Description

      I noticed a crash on every version of MariaDB when running something similar to the following:

      create table tst(val json);
      insert into tst values('{}');
      select t.val<=>json_extract('[]','$') from tst t;
      

      Though it can be reproduced also by running just this

      select '[]'<=>json_extract('[]','$')
      

      The problem being the comparison of JSON and VARCHAR with the <=> operator.

      I suppose the problem is that even though MariaDB accepts the token json as data type, it desugars to longtext, but internally, there is still a distinct type for json data.

      Attachments

        Issue Links

          Activity

            People

              rucha174 Rucha Deodhar
              cbeikov Christian Beikov
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.