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

Trim with remove_str Fails on Spider SE

Details

    Description

      When using trim() with remove_str (for example trim(leading '*' from col_a)) using the spider storage engine, it fails with ERROR 1582 (42000): Incorrect parameter count in the call to native function 'ltrim')

      How to Repeat

      1. Create tables on backends:

      bk.sql

      CREATE TABLE t1 (
          id int,
          info varchar(30)
      )ENGINE=InnoDB;
      

      2. Create the table on spider:

      spider.sql

      CREATE TABLE t1 (
          id int,
          info varchar(30)
      )ENGINE=Spider COMMENT='wrapper "mysql", table "t1"'
      PARTITION BY LIST (id%2) (
          PARTITION pt1 VALUES IN (0) COMMENT = 'srv "backend0"' ENGINE=SPIDER,
          PARTITION pt2 VALUES IN (1) COMMENT = 'srv "backend1"' ENGINE=SPIDER
      );
      

      3. Then, execute a SQL with trim() on spider:

      trim.sql

      MariaDB [test]> UPDATE t1 SET info = trim(LEADING '[' FROM info) WHERE id = 12345;
      

      Then, it fails with error

      ERROR 1582 (42000): Incorrect parameter count in the call to native function 'ltrim'

      Suggested fix

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

      Attachments

        Activity

          yongxinxu Yongxin Xu created issue -
          elenst Elena Stepanova made changes -
          Field Original Value New Value
          Fix Version/s 10.3 [ 22126 ]
          Assignee Kentoku Shiba [ kentoku ]
          serg Sergei Golubchik made changes -
          Status Open [ 1 ] Confirmed [ 10101 ]
          serg Sergei Golubchik made changes -
          Assignee Kentoku Shiba [ kentoku ] Sergei Golubchik [ serg ]
          serg Sergei Golubchik made changes -
          Priority Minor [ 4 ] Major [ 3 ]
          serg Sergei Golubchik made changes -
          Status Confirmed [ 10101 ] In Review [ 10002 ]
          serg Sergei Golubchik made changes -
          Fix Version/s 10.4 [ 22408 ]
          Fix Version/s 10.5 [ 23123 ]
          Fix Version/s 10.6 [ 24028 ]

          nayuta-yanagisawa, would you mind reviewing it and applying, if it looks ok? thanks!

          serg Sergei Golubchik added a comment - nayuta-yanagisawa , would you mind reviewing it and applying, if it looks ok? thanks!
          serg Sergei Golubchik made changes -
          Assignee Sergei Golubchik [ serg ] Nayuta Yanagisawa [ JIRAUSER47117 ]

          serg Sure, but I will work on https://github.com/MariaDB/server/pull/1842 , because the one in the description is closed.

          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - serg Sure, but I will work on https://github.com/MariaDB/server/pull/1842 , because the one in the description is closed.
          Yongxin Xu Yongxin Xu added a comment -

          I create a new pull request on https://github.com/MariaDB/server/pull/1879 for this fix, since I pressed the wrong button in the previous pr.

          Yongxin Xu Yongxin Xu added a comment - I create a new pull request on https://github.com/MariaDB/server/pull/1879 for this fix, since I pressed the wrong button in the previous pr.
          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - pushed to bb-10.3-mdev-24020 https://github.com/MariaDB/server/commit/0f45ac60342dccdd7c0041659abf2a3fe16a4a7b

          The spider does not push down the TRIM function on SELECT statements. So, the issue is about UPDATE.

          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - The spider does not push down the TRIM function on SELECT statements. So, the issue is about UPDATE.
          nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - Closed by https://github.com/MariaDB/server/commit/43099af95bc554ff870b00bbe965dbcf4662ec86
          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 ]
          Fix Version/s 10.6 [ 24028 ]
          Resolution Fixed [ 1 ]
          Status In Review [ 10002 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 114917 ] MariaDB v4 [ 158501 ]

          People

            nayuta-yanagisawa Nayuta Yanagisawa (Inactive)
            yongxinxu Yongxin Xu
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.