[MDEV-11554] Wrong result for CASE on a mixture of signed and unsigned expressions Created: 2016-12-13  Updated: 2017-05-25  Resolved: 2016-12-17

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: 5.5, 10.0, 10.1, 10.2, 10.3
Fix Version/s: 10.3.0

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: datatype

Issue Links:
Blocks
blocks MDEV-4912 Data type plugin API version 1 Closed
Relates
relates to MDEV-11555 CASE with a mixture of TIME and DATET... Closed
relates to MDEV-11497 Wrong result for (int_expr IN (mixtur... Closed

 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.



 Comments   
Comment by Alexander Barkov [ 2016-12-17 ]

Pushed into bb-10.2-ext

Generated at Thu Feb 08 07:50:51 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.