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

Incorrect operator when comparing large unsigned integers.

    XMLWordPrintable

Details

    Description

      DROP DATABASE IF EXISTS database98;
      CREATE DATABASE database98;
      USE database98;
      CREATE TABLE t0(c0 BOOLEAN  UNIQUE NOT NULL, c1 MEDIUMINT  UNIQUE NOT NULL, c2 BOOLEAN  UNIQUE NOT NULL) engine=MyISAM;
      CREATE OR REPLACE TABLE t1(c0 INT  UNIQUE NOT NULL, c1 VARCHAR(100)  UNIQUE NOT NULL, PRIMARY KEY(c1, c0));
      INSERT INTO t0 VALUES (127885159, -441428384, 540566410);
      INSERT INTO t0 VALUES (-70694447, 228215695, -294915985);
      INSERT INTO t1 VALUES (-1668852992, 'rklt');
      INSERT INTO t1 VALUES (97930192, '');
      SELECT COUNT(*) FROM t0 WHERE ((1363502665 | -277659069) > c0);
      SELECT SUM(count) FROM (SELECT (((1363502665 | -277659069) > c0) IS TRUE) as count FROM t0) as asdf;
      

      The expected result is that the two query statements have the same query result, but in fact, the first query result is 1, and the second query result is 2

      Attachments

        Activity

          People

            Johnston Rex Johnston
            guozhentang guozhentang
            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.