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

MOD function returns wrong value?

    XMLWordPrintable

Details

    Description

      output from the second statement below (`select * from integers group by i%3 ;`) should not return the value 3.

      MariaDB [test]> select distinct i%3 from integers;
      +------+
      | i%3  |
      +------+
      |    0 |
      |    1 |
      |    2 |
      +------+
      3 rows in set (0.499 sec)
       
      MariaDB [test]> select * from integers  group by i%3 ;
      +---+--------------------------------------+
      | i | t1                                   |
      +---+--------------------------------------+
      | 3 | a44c970b-aff2-11eb-8dec-00155dfdb341 |
      | 1 | a19fcf11-aff2-11eb-8dec-00155dfdb341 |
      | 2 | a389475c-aff2-11eb-8dec-00155dfdb341 |
      +---+--------------------------------------+
      3 rows in set (0.553 sec)
       
      MariaDB [test]> select @@version;
      +----------------+
      | @@version      |
      +----------------+
      | 10.5.9-MariaDB |
      +----------------+
      1 row in set (0.000 sec)
      
      

      Table definition:

      CREATE TABLE `integers` (
        `i` int(11) NOT NULL,
        `t1` varchar(36) DEFAULT NULL,
        PRIMARY KEY (`i`),
        KEY `integers_t1` (`t1`)
      ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
      

      Impression of contents of this table:

      select min(i),max(i), count(*) from integers;
      +--------+---------+----------+
      | min(i) | max(i)  | count(*) |
      +--------+---------+----------+
      |      0 | 2097152 |  2097153 |
      +--------+---------+----------+
      

      Attachments

        Activity

          People

            danblack Daniel Black
            Luuk V Luuk V
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.