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

Execution of JSON_REPLACE failed on Spider

Details

    Description

      How to repeat

      On Spider:

      spd.sql

      CREATE TABLE tbl_a (
        i INT,
        j JSON,
        PRIMARY KEY(i)
      ) ENGINE=SPIDER, PARTITION BY ...
       
      INSERT INTO tbl_a VALUES (1, '{ "a": 1, "b": [2, 3]}');
      UPDATE tbl_a SET j = JSON_REPLACE(j, '$.a', 10, '$.c', '[1, 2]');
      

      When the update statement is executed, it fails with

      query 'UPDATE tbl_a SET j = JSON_REPLACE(j, '$.a', 10, '$.c', '[1, 2]')' failed: 1305: FUNCTION auto_test_remote.json_update does not exist

      More critically, it will make the server crash on Windows on debug mode.

      Suggest fix

      https://github.com/MariaDB/server/pull/1735

      Attachments

        Activity

          yongxinxu Yongxin Xu created issue -
          yongxinxu Yongxin Xu made changes -
          Field Original Value New Value
          Description h2. How to repeat
          On Spider:
          {code:title=spd.sql|borderStyle=solid}
          CREATE TABLE tbl_a (
            i INT,
            j JSON,
            PRIMARY KEY(i)
          ) ENGINE=SPIDER, PARTITION BY ...

          INSERT INTO tbl_a VALUES (1, '{ "a": 1, "b": [2, 3]}');
          UPDATE tbl_a SET j = JSON_REPLACE(j, '$.a', 10, '$.c', '[1, 2]');
          {code}

          When the update statement is executed, it fails with
          {quote}query 'UPDATE tbl_a SET j = JSON_REPLACE(j, '$.a', 10, '$.c', '[1, 2]')' failed: 1305: FUNCTION auto_test_remote.json_update does not exist{quote}

          *More critically, it will make the server crash on Windows on debug mode.*
          h2. How to repeat
          On Spider:
          {code:title=spd.sql|borderStyle=solid}
          CREATE TABLE tbl_a (
            i INT,
            j JSON,
            PRIMARY KEY(i)
          ) ENGINE=SPIDER, PARTITION BY ...

          INSERT INTO tbl_a VALUES (1, '{ "a": 1, "b": [2, 3]}');
          UPDATE tbl_a SET j = JSON_REPLACE(j, '$.a', 10, '$.c', '[1, 2]');
          {code}

          When the update statement is executed, it fails with
          {quote}query 'UPDATE tbl_a SET j = JSON_REPLACE(j, '$.a', 10, '$.c', '[1, 2]')' failed: 1305: FUNCTION auto_test_remote.json_update does not exist{quote}

          *More critically, it will make the server crash on Windows on debug mode.*

          h2. Suggest fix
          https://github.com/MariaDB/server/pull/1735
          anel Anel Husakovic made changes -
          Assignee Kentoku Shiba [ kentoku ]
          serg Sergei Golubchik made changes -
          Fix Version/s 10.3 [ 22126 ]
          Fix Version/s 10.4 [ 22408 ]
          Fix Version/s 10.5 [ 23123 ]
          ralf.gebhardt Ralf Gebhardt made changes -
          Assignee Kentoku Shiba [ kentoku ] Alexey Botchkov [ holyfoot ]
          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
          Assignee Alexey Botchkov [ holyfoot ] Nayuta Yanagisawa [ JIRAUSER47117 ]
          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
          Status Open [ 1 ] Confirmed [ 10101 ]
          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
          Status Confirmed [ 10101 ] In Review [ 10002 ]

          JSON functions were introduced by 10.2.3. So, we should check 10.2 also. https://mariadb.com/kb/en/json_replace/

          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - JSON functions were introduced by 10.2.3. So, we should check 10.2 also. https://mariadb.com/kb/en/json_replace/
          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
          Status In Review [ 10002 ] Stalled [ 10000 ]
          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - Please review https://github.com/MariaDB/server/pull/1841
          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
          Assignee Nayuta Yanagisawa [ JIRAUSER47117 ] Sergei Golubchik [ serg ]
          Status Stalled [ 10000 ] In Review [ 10002 ]
          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
          Fix Version/s 10.3.31 [ 26028 ]
          Fix Version/s 10.4.21 [ 26030 ]
          Fix Version/s 10.5.12 [ 26025 ]
          Fix Version/s 10.6.4 [ 26033 ]
          Fix Version/s 10.3 [ 22126 ]
          Fix Version/s 10.4 [ 22408 ]
          Fix Version/s 10.5 [ 23123 ]
          Resolution Fixed [ 1 ]
          Status In Review [ 10002 ] Closed [ 6 ]
          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
          Affects Version/s 10.6 [ 24028 ]
          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
          Labels not-10.2

          ralf.gebhardt@mariadb.com This does not affect 10.2, because the Spider bundled with 10.2 does not pushdown functions to data nodes. I added not-10.2 label to the issue.

          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - ralf.gebhardt@mariadb.com This does not affect 10.2, because the Spider bundled with 10.2 does not pushdown functions to data nodes. I added not-10.2 label to the issue.
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 117810 ] MariaDB v4 [ 158749 ]

          People

            serg Sergei Golubchik
            yongxinxu Yongxin Xu
            Votes:
            0 Vote for this issue
            Watchers:
            5 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.