Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-5051

ifnull(column1, '') mediumtext comparison results in Sig 11 kill Exemgr - `ERROR 1815 (HY000): Internal error: InetStreamSocket::readToMagic: Remote is closed'

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.6.5
    • Fix Version/s: 22.08.1
    • Component/s: PrimProc
    • Labels:
      None
    • Sprint:
      2021-17

      Description

      Here is table schema and query that causes the Seg 11 Kills Exemgr - restarting at least 3 subprocesses

      CREATE TABLE `tpp_white_list` (
        `TABLE_NAME` mediumtext DEFAULT NULL,
        `COLUMN_NAME` mediumtext DEFAULT NULL,
        `CODE` mediumtext DEFAULT NULL,
        `NAME` mediumtext DEFAULT NULL,
        `CS_CODE` mediumtext DEFAULT NULL,
        `LIST_KBN` mediumtext DEFAULT NULL
      ) ENGINE=Columnstore DEFAULT CHARSET=utf8;
       
      # You need the data to reproduce - see comments for data
      cpimport client tpp_white_list -E '"' -s "," list.csv 
       
      WITH
      temp1 AS (select 1 as num,'aa1' as name, 111 as VALUE union all
      select 2 as num,'aa2' as name, 112 as VALUE union all
      select 3 as num,'aa3' as name, 113 as VALUE union all
      select 4 as num, NULL as name, 'MDCDX2' as VALUE union all
      select 5 as num, null as name, 115 as VALUE union all
      select 4 as num, "" as name, null as VALUE union all
      select 5 as num, null as name, null as VALUE union all
      select 4 as num,'*1068' as name, '99D01' as VALUE union all
      select 5 as num,'*1554' as NAME, '99D01' as VALUE union all
      select 4 as num,'0063001' as NAME, '99D01' as VALUE
      )
      SELECT COUNT(1)
      from temp1 a
      where exists (select 1 from tpp_white_list b
      WHERE b.TABLE_NAME = 'IF001'
      AND (b.COLUMN_NAME = 'プロブレム1セット' OR b.COLUMN_NAME ='プロブレム2セット')
      and ifnull(a.name,'') = ifnull(b.code,'') 
      AND ifnull(a.value,'') = ifnull(b.cs_code,'') 
      );
      

      What actually happens
      Debug.log

      Apr 19 15:10:09 ip-172-31-30-7 systemd: mcs-exemgr.service: main process exited, code=killed, status=11/SEGV
      

      Client:

      ERROR 1815 (HY000): Internal error: InetStreamSocket::readToMagic: Remote is closed
      

      What clients expect to happen
      No error or restart of exemgr & ddlproc & WriteEngineServer - just the response similar to the work arounds

      +----------+
      | COUNT(1) |
      +----------+
      |        3 |
      +----------+
      1 row in set (6.962 sec)
      

      Work arounds

      • Removing the ifnull functions around the medium text
      • using varchar(1000) instead of mediumtext
      • write query with a subselect

        # Subselect re-write
        WITH
        temp1 AS (select 1 as num,'aa1'     as name, 111 as VALUE union all
                  select 2 as num,'aa2'     as name, 112 as VALUE union all
                  select 3 as num,'aa3'     as name, 113 as VALUE union all
                  select 4 as num, NULL     as name, 'MDCDX2' as VALUE union all
                  select 5 as num, null     as name, 115 as VALUE union all
                  select 4 as num, ""       as name, null as VALUE union all
                  select 5 as num, null     as name, null as VALUE union all
                  select 4 as num,'*1068'   as name, '99D01' as VALUE union all
                  select 5 as num,'*1554'   as NAME, '99D01' as VALUE union all
                  select 4 as num,'0063001' as NAME, '99D01' as VALUE 
                 )
        ,temp2 as (select * from tpp_white_list)
        SELECT COUNT(1)
        from temp1 a
        where exists (select 1 from temp2 b
                      WHERE b.TABLE_NAME = 'IF001' 
                        AND (b.COLUMN_NAME = 'プロブレム1セット' OR b.COLUMN_NAME ='プロブレム2セット')
                        and ifnull(a.name,'') = ifnull(b.code,'')
                        AND ifnull(a.value,'') = ifnull(b.cs_code,'')
                     );
        

        Attachments

          Activity

            People

            Assignee:
            Andrey Andrey Piskunov
            Reporter:
            allen.lee@mariadb.com Allen Lee
            Votes:
            0 Vote for this issue
            Watchers:
            6 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.