[MDEV-11497] Wrong result for (int_expr IN (mixture of signed and unsigned expressions)) Created: 2016-12-07  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-11514 IN with a mixture of TIME and DATETIM... Closed
relates to MDEV-11554 Wrong result for CASE on a mixture of... Closed

 Description   

This script:

DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a BIGINT, b BIGINT UNSIGNED);
INSERT INTO t1 VALUES (-9223372036854775808,18446744073709551615);
SELECT * FROM t1 WHERE -1 IN (a,b);

erroneously returns the row:

+----------------------+----------------------+
| a                    | b                    |
+----------------------+----------------------+
| -9223372036854775808 | 18446744073709551615 |
+----------------------+----------------------+

If I now change the left argument to DECIMAL or DOUBLE, it starts to work fine and return an empty set:

SELECT * FROM t1 WHERE -1.0 IN (a,b);
SELECT * FROM t1 WHERE -1e0 IN (a,b);

CASE suffers from the same problem. See MDEV-11554.



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

Pushed into bb-10.2-ext

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