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

Wrong result for CASE on a mixture of signed and unsigned expressions

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5, 10.0, 10.1, 10.2, 10.3
    • Fix Version/s: 10.3.0
    • Component/s: OTHER
    • Labels:

      Description

      This problem is similar to MDEV-11497, but now for the simple CASE operator:

      CASE suffers from the same problem:

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a BIGINT, b BIGINT UNSIGNED);
      INSERT INTO t1 VALUES (-9223372036854775808,18446744073709551615);
      SELECT
        CASE -1
          WHEN -9223372036854775808 THEN 'one'
          WHEN 18446744073709551615 THEN 'two'
        END;
      

      +-------------------------------------------------------------------------------------------------+
      | CASE -1
          WHEN -9223372036854775808 THEN 'one'
          WHEN 18446744073709551615 THEN 'two'
        END |
      +-------------------------------------------------------------------------------------------------+
      | two                                                                                             |
      +-------------------------------------------------------------------------------------------------+
      

      The expected result is to return NULL.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bar Alexander Barkov
                Reporter:
                bar Alexander Barkov
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: