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

SELECT ~0 on DOUBLE column: correct on MyISAM, wrong on InnoDB (signed LLONG_MAX)

    XMLWordPrintable

Details

    Description

      Summary

      On MariaDB 12.3.1-MariaDB-asan-log (rev 21a0714a), SELECT COUNT, ~0 on a DOUBLE column returns 18446744073709551615 on MyISAM (correct), but 9223372036854775807 on InnoDB (wrong). Integer columns behave correctly on both engines. This is a sibling of MDEV-39131: MyISAM is fixed, but InnoDB DOUBLE still triggers the old bug.

      Minimal Reproducer

      CREATE TABLE t_myisam (c0 DOUBLE) ENGINE = MyISAM;
      INSERT INTO t_myisam VALUES (1);
      SELECT COUNT(*), ~0 FROM t_myisam;
      -- → 1, 18446744073709551615  (correct)
       
      CREATE TABLE t_innodb (c0 DOUBLE) ENGINE = InnoDB;
      INSERT INTO t_innodb VALUES (1);
      SELECT COUNT(*), ~0 FROM t_innodb;
      -- → 1, 9223372036854775807  (wrong)
      

      Expected vs Actual

      Engine Column ~0 result Correct?
      MyISAM DOUBLE 18446744073709551615 yes
      InnoDB DOUBLE 9223372036854775807 no
      InnoDB INT 18446744073709551615 yes

      Notes

      • Official MDEV-39131 fixed MyISAM; this report documents the InnoDB DOUBLE path that remains broken.
      • Partial fix moved the bug to the former control engine.
      • Issue is related to `Item_copy_string::val_int()` unsigned handling.

      Environment

      Item Value
      Version 12.3.1-MariaDB-asan-log
      Revision 21a0714a118614982d20bfa504763d7247800091

      Suggested Fix

      Apply MDEV-39131 unsigned handling for ~0 consistently for InnoDB DOUBLE result metadata paths, not only MyISAM.

      Attachments

        Activity

          People

            raghunandan.bhat Raghunandan Bhat
            mu mu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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