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

resultset changed with subselects without changing data

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 23.02.3, 23.02.4, 23.10.0, 23.02.8
    • 23.10.2
    • PrimProc
    • 2024-2

    Description

      to reproduce

      CREATE TABLE IF NOT EXISTS  `t1`  ( `id`  VARCHAR(50) NOT NULL) ENGINE=Columnstore DEFAULT CHARSET=utf8; 
      CREATE TABLE IF NOT EXISTS  `t2`  ( `id`  VARCHAR(50) NOT NULL) ENGINE=Columnstore DEFAULT CHARSET=utf8; 
        
       
      set max_recursive_iterations = 10000000;
       
      INSERT INTO `t1`  (
      with recursive series as (
      select 1 as id,LEFT(MD5(RAND()), 36) as r1 union all
      select id +1 as id, LEFT(MD5(RAND()), 36) as r1  from series
      where id < 100000)
      select r1 from series);
       
       
       
      insert into `t2` select * from `t1`;
       
      INSERT INTO `t2`  (
      with recursive series as (
      select 1 as id,LEFT(MD5(RAND()), 36) as r1 union all
      select id +1 as id, LEFT(MD5(RAND()), 36) as r1  from series
      where id < 50000)
      select r1 from series);
       
       
       
      insert into `t1` select * from `t2`;
       
      INSERT INTO `t1`  (
      with recursive series as (
      select 1 as id,LEFT(MD5(RAND()), 36) as r1 union all
      select id +1 as id, LEFT(MD5(RAND()), 36) as r1  from series
      where id < 5000)
      select r1 from series);
      

      repeat multipe time one or both statements

        select count(id) from t1 where id in (select id from t2);
        select count(id) from t2 where id in (select id from t1);
      

      Results differ sometimes:

      MariaDB [d1]>   select count(id) from t2 where id in (select id from t1);
      +-----------+
      | count(id) |
      +-----------+
      |    150000 |
      +-----------+
      1 row in set (0.299 sec)
       
      MariaDB [d1]>   select count(id) from t2 where id in (select id from t1);
      +-----------+
      | count(id) |
      +-----------+
      |     33616 |
      +-----------+
      1 row in set (0.290 sec)
      
      

      Attachments

        Activity

          allen.herrera Allen Herrera added a comment -

          Today i confirmed

          This is not fixed in 23.02.x and wont be fixed

          [root@ip-172-31-36-104 rocky]# mariadb -e "show status like '%Columnstore%';"
          +-------------------------+---------------+
          | Variable_name           | Value         |
          +-------------------------+---------------+
          | Columnstore_commit_hash | 7b64072-dirty |
          | Columnstore_version     | 23.02.11      |
          +-------------------------+---------------+
           
          MariaDB [test2]> select count(id) from t1 where id in (select id from t2);select count(id) from t2 where id in (select id from t1);
          +-----------+
          | count(id) |
          +-----------+
          |    116384 |
          +-----------+
          1 row in set (0.463 sec)
           
          +-----------+
          | count(id) |
          +-----------+
          |     33616 |
          +-----------+
          1 row in set (0.636 sec)
           
          MariaDB [test2]> select count(id) from t1 where id in (select id from t2);select count(id) from t2 where id in (select id from t1);
          +-----------+
          | count(id) |
          +-----------+
          |    247456 |
          +-----------+
          1 row in set (0.442 sec)
           
          +-----------+
          | count(id) |
          +-----------+
          |    150000 |
          +-----------+
          

          but is fixed in 23.10.2+

          +-------------------------+---------+
          | Variable_name           | Value   |
          +-------------------------+---------+
          | Columnstore_commit_hash | source  |
          | Columnstore_version     | 23.10.2 |
          +-------------------------+---------+
           
          MariaDB [test]>   select count(id) from t1 where id in (select id from t2);select count(id) from t2 where id in (select id from t1);
          +-----------+
          | count(id) |
          +-----------+
          |    250033 |
          +-----------+
          1 row in set (0.399 sec)
           
          +-----------+
          | count(id) |
          +-----------+
          |    150000 |
          +-----------+
          1 row in set (0.637 sec)
           
          MariaDB [test]>   select count(id) from t1 where id in (select id from t2);select count(id) from t2 where id in (select id from t1);
          +-----------+
          | count(id) |
          +-----------+
          |    250033 |
          +-----------+
          1 row in set (0.492 sec)
           
          +-----------+
          | count(id) |
          +-----------+
          |    150000 |
          +-----------+
          1 row in set (0.620 sec)
           
          MariaDB [test]>   select count(id) from t1 where id in (select id from t2);select count(id) from t2 where id in (select id from t1);
          +-----------+
          | count(id) |
          +-----------+
          |    250033 |
          +-----------+
          1 row in set (0.443 sec)
           
          +-----------+
          | count(id) |
          +-----------+
          |    150000 |
          +-----------+
          1 row in set (0.620 sec)
          

          allen.herrera Allen Herrera added a comment - Today i confirmed This is not fixed in 23.02.x and wont be fixed [root @ip - 172 - 31 - 36 - 104 rocky]# mariadb -e "show status like '%Columnstore%';" +-------------------------+---------------+ | Variable_name | Value | +-------------------------+---------------+ | Columnstore_commit_hash | 7b64072-dirty | | Columnstore_version | 23.02 . 11 | +-------------------------+---------------+   MariaDB [test2]> select count(id) from t1 where id in (select id from t2);select count(id) from t2 where id in (select id from t1); +-----------+ | count(id) | +-----------+ | 116384 | +-----------+ 1 row in set ( 0.463 sec)   +-----------+ | count(id) | +-----------+ | 33616 | +-----------+ 1 row in set ( 0.636 sec)   MariaDB [test2]> select count(id) from t1 where id in (select id from t2);select count(id) from t2 where id in (select id from t1); +-----------+ | count(id) | +-----------+ | 247456 | +-----------+ 1 row in set ( 0.442 sec)   +-----------+ | count(id) | +-----------+ | 150000 | +-----------+ but is fixed in 23.10.2+ +-------------------------+---------+ | Variable_name | Value | +-------------------------+---------+ | Columnstore_commit_hash | source | | Columnstore_version | 23.10 . 2 | +-------------------------+---------+   MariaDB [test]> select count(id) from t1 where id in (select id from t2);select count(id) from t2 where id in (select id from t1); +-----------+ | count(id) | +-----------+ | 250033 | +-----------+ 1 row in set ( 0.399 sec)   +-----------+ | count(id) | +-----------+ | 150000 | +-----------+ 1 row in set ( 0.637 sec)   MariaDB [test]> select count(id) from t1 where id in (select id from t2);select count(id) from t2 where id in (select id from t1); +-----------+ | count(id) | +-----------+ | 250033 | +-----------+ 1 row in set ( 0.492 sec)   +-----------+ | count(id) | +-----------+ | 150000 | +-----------+ 1 row in set ( 0.620 sec)   MariaDB [test]> select count(id) from t1 where id in (select id from t2);select count(id) from t2 where id in (select id from t1); +-----------+ | count(id) | +-----------+ | 250033 | +-----------+ 1 row in set ( 0.443 sec)   +-----------+ | count(id) | +-----------+ | 150000 | +-----------+ 1 row in set ( 0.620 sec)

          People

            alexey.antipovsky Alexey Antipovsky
            Richard Richard Stracke
            Votes:
            1 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.