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

Inconsistent result with aggregate function over zerofill column in FROM subquery vs direct query

    XMLWordPrintable

    Details

      Description

      create table t1 (a int unsigned zerofill);
      insert into t1 values (1),(2);
      select min(a) from t1;
      select * from (select min(a) from t1) sq;
       
      # Cleanup
      drop table t1;
      

      10.5 a16e3c32

      select min(a) from t1;
      min(a)
      1
      select * from (select min(a) from t1) sq;
      min(a)
      0000000001
      

      Whichever result is correct, the other one must be wrong.

      Reproducible on all MariaDB 10.x with at least InnoDB, MyISAM, Aria.
      Also reproducible on MySQL 5.6, 8.0.

        Attachments

          Activity

            People

            Assignee:
            psergei Sergei Petrunia
            Reporter:
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration