[MDEV-11514] IN with a mixture of TIME and DATETIME returns a wrong result Created: 2016-12-09  Updated: 2017-05-25  Resolved: 2016-12-17

Status: Closed
Project: MariaDB Server
Component/s: Temporal Types
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 query correctly returns TRUE:

SELECT TIME'10:20:30' IN (102030,TIME'10:20:31');

+-------------------------------------------+
| TIME'10:20:30' IN (102030,TIME'10:20:31') |
+-------------------------------------------+
|                                         1 |
+-------------------------------------------+

If I add more values into the IN list, it returns FALSE with a warning:

SELECT TIME'10:20:30' IN (102030,TIME'10:20:31',TIMESTAMP'2001-01-01 10:20:32');
SHOW WARNINGS;

+--------------------------------------------------------------------------+
| TIME'10:20:30' IN (102030,TIME'10:20:31',TIMESTAMP'2001-01-01 10:20:32') |
+--------------------------------------------------------------------------+
|                                                                        0 |
+--------------------------------------------------------------------------+
+---------+------+------------------------------------+
| Level   | Code | Message                            |
+---------+------+------------------------------------+
| Warning | 1292 | Incorrect datetime value: '102030' |
+---------+------+------------------------------------+

CASE demonstrates the same problem. See MDEV-11555.



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

Pushed into bb-10.2-ext

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