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

RAND() uses static seed of 0

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Won't Fix
    • 6.2.3
    • 23.10.2
    • PrimProc
    • None

    Description

      Unless there's a specific reason for it, maybe RAND() in Columnstore should behave like the Server's implementation by using a random seed as default parameter.

      Columnstore Test Case

      CREATE TABLE `test_rand` (
        `c1` int(11) DEFAULT NULL
      ) ENGINE=Columnstore DEFAULT CHARSET=utf8;
       
      insert into test_rand values (1),(2),(3),(4),(5),(6);
       
      select * from (select c1,count(*) cnt from test_rand group by c1 order by cnt) x order by rand() limit 3;
      select * from (select c1,count(*) cnt from test_rand group by c1 order by cnt) x order by rand() limit 3;
      

      MariaDB Server

      CREATE TABLE `test_rand2` (
        `c1` int(11) DEFAULT NULL
      ) ENGINE=Innodb DEFAULT CHARSET=utf8;
       
      insert into test_rand2 values (1),(2),(3),(4),(5),(6);
       
      select * from (select c1,count(*) cnt from test_rand2 group by c1 order by cnt) x order by rand() limit 3;
      select * from (select c1,count(*) cnt from test_rand2 group by c1 order by cnt) x order by rand() limit 3;
      

      Attachments

        Activity

          People

            drrtuy Roman
            claudio.nanni Claudio Nanni
            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.