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

    • Bug
    • Status: Confirmed (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5(EOL), 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL)
    • 10.6
    • Optimizer

    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

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

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - Not Specified
                Not Specified
                Logged:
                Time Spent - 20m
                20m

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.