Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL)
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.
Attachments
Issue Links
- blocks
-
MDEV-4912 Data type plugin API version 1
-
- Closed
-
- relates to
-
MDEV-11555 CASE with a mixture of TIME and DATETIME returns a wrong result
-
- Closed
-
-
MDEV-11497 Wrong result for (int_expr IN (mixture of signed and unsigned expressions))
-
- Closed
-
Activity
Description |
This query correctly returns {{TRUE}}:
{code:sql} SELECT TIME'10:20:30' IN (102030,TIME'10:20:31'); {code} {noformat} +-------------------------------------------+ | TIME'10:20:30' IN (102030,TIME'10:20:31') | +-------------------------------------------+ | 1 | +-------------------------------------------+ {noformat} If I add more value into the {{IN}} list, it returns {{FALSE}} with a warning: {code:sql} SELECT TIME'10:20:30' IN (102030,TIME'10:20:31',TIMESTAMP'2001-01-01 10:20:32'); SHOW WARNINGS; {code} {noformat} +--------------------------------------------------------------------------+ | 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' | +---------+------+------------------------------------+ {noformat} |
This query correctly returns {{TRUE}}:
{code:sql} SELECT TIME'10:20:30' IN (102030,TIME'10:20:31'); {code} {noformat} +-------------------------------------------+ | TIME'10:20:30' IN (102030,TIME'10:20:31') | +-------------------------------------------+ | 1 | +-------------------------------------------+ {noformat} If I add more values into the {{IN}} list, it returns {{FALSE}} with a warning: {code:sql} SELECT TIME'10:20:30' IN (102030,TIME'10:20:31',TIMESTAMP'2001-01-01 10:20:32'); SHOW WARNINGS; {code} {noformat} +--------------------------------------------------------------------------+ | 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' | +---------+------+------------------------------------+ {noformat} |
Link |
This issue relates to |
Description |
This query correctly returns {{TRUE}}:
{code:sql} SELECT TIME'10:20:30' IN (102030,TIME'10:20:31'); {code} {noformat} +-------------------------------------------+ | TIME'10:20:30' IN (102030,TIME'10:20:31') | +-------------------------------------------+ | 1 | +-------------------------------------------+ {noformat} If I add more values into the {{IN}} list, it returns {{FALSE}} with a warning: {code:sql} SELECT TIME'10:20:30' IN (102030,TIME'10:20:31',TIMESTAMP'2001-01-01 10:20:32'); SHOW WARNINGS; {code} {noformat} +--------------------------------------------------------------------------+ | 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' | +---------+------+------------------------------------+ {noformat} |
This query correctly returns {{TRUE}}:
{code:sql} SELECT TIME'10:20:30' IN (102030,TIME'10:20:31'); {code} {noformat} +-------------------------------------------+ | TIME'10:20:30' IN (102030,TIME'10:20:31') | +-------------------------------------------+ | 1 | +-------------------------------------------+ {noformat} If I add more values into the {{IN}} list, it returns {{FALSE}} with a warning: {code:sql} SELECT TIME'10:20:30' IN (102030,TIME'10:20:31',TIMESTAMP'2001-01-01 10:20:32'); SHOW WARNINGS; {code} {noformat} +--------------------------------------------------------------------------+ | 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' | +---------+------+------------------------------------+ {noformat} {{CASE}} demonstrates the same problem: {code:sql} SELECT CASE TIME'10:20:30' WHEN 102030 THEN 'one' WHEN TIME'10:20:31' THEN 'two' END AS good, CASE TIME'10:20:30' WHEN 102030 THEN 'one' WHEN TIME'10:20:31' THEN 'two' WHEN TIMESTAMP'2001-01-01 10:20:32' THEN 'three' END AS bad; SHOW WARNINGS; {code} {noformat} {noformat} |
Description |
This query correctly returns {{TRUE}}:
{code:sql} SELECT TIME'10:20:30' IN (102030,TIME'10:20:31'); {code} {noformat} +-------------------------------------------+ | TIME'10:20:30' IN (102030,TIME'10:20:31') | +-------------------------------------------+ | 1 | +-------------------------------------------+ {noformat} If I add more values into the {{IN}} list, it returns {{FALSE}} with a warning: {code:sql} SELECT TIME'10:20:30' IN (102030,TIME'10:20:31',TIMESTAMP'2001-01-01 10:20:32'); SHOW WARNINGS; {code} {noformat} +--------------------------------------------------------------------------+ | 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' | +---------+------+------------------------------------+ {noformat} {{CASE}} demonstrates the same problem: {code:sql} SELECT CASE TIME'10:20:30' WHEN 102030 THEN 'one' WHEN TIME'10:20:31' THEN 'two' END AS good, CASE TIME'10:20:30' WHEN 102030 THEN 'one' WHEN TIME'10:20:31' THEN 'two' WHEN TIMESTAMP'2001-01-01 10:20:32' THEN 'three' END AS bad; SHOW WARNINGS; {code} {noformat} {noformat} |
This query correctly returns {{TRUE}}:
{code:sql} SELECT TIME'10:20:30' IN (102030,TIME'10:20:31'); {code} {noformat} +-------------------------------------------+ | TIME'10:20:30' IN (102030,TIME'10:20:31') | +-------------------------------------------+ | 1 | +-------------------------------------------+ {noformat} If I add more values into the {{IN}} list, it returns {{FALSE}} with a warning: {code:sql} SELECT TIME'10:20:30' IN (102030,TIME'10:20:31',TIMESTAMP'2001-01-01 10:20:32'); SHOW WARNINGS; {code} {noformat} +--------------------------------------------------------------------------+ | 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' | +---------+------+------------------------------------+ {noformat} {{CASE}} demonstrates the same problem: {code:sql} SELECT CASE TIME'10:20:30' WHEN 102030 THEN 'one' WHEN TIME'10:20:31' THEN 'two' END AS good, CASE TIME'10:20:30' WHEN 102030 THEN 'one' WHEN TIME'10:20:31' THEN 'two' WHEN TIMESTAMP'2001-01-01 10:20:32' THEN 'three' END AS bad; SHOW WARNINGS; {code} {noformat} +------+------+ | good | bad | +------+------+ | one | NULL | +------+------+ {noformat} {noformat} +---------+------+------------------------------------+ | Level | Code | Message | +---------+------+------------------------------------+ | Warning | 1292 | Incorrect datetime value: '102030' | +---------+------+------------------------------------+ {noformat} |
Link |
This issue relates to |
Description |
This query correctly returns {{TRUE}}:
{code:sql} SELECT TIME'10:20:30' IN (102030,TIME'10:20:31'); {code} {noformat} +-------------------------------------------+ | TIME'10:20:30' IN (102030,TIME'10:20:31') | +-------------------------------------------+ | 1 | +-------------------------------------------+ {noformat} If I add more values into the {{IN}} list, it returns {{FALSE}} with a warning: {code:sql} SELECT TIME'10:20:30' IN (102030,TIME'10:20:31',TIMESTAMP'2001-01-01 10:20:32'); SHOW WARNINGS; {code} {noformat} +--------------------------------------------------------------------------+ | 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' | +---------+------+------------------------------------+ {noformat} {{CASE}} demonstrates the same problem: {code:sql} SELECT CASE TIME'10:20:30' WHEN 102030 THEN 'one' WHEN TIME'10:20:31' THEN 'two' END AS good, CASE TIME'10:20:30' WHEN 102030 THEN 'one' WHEN TIME'10:20:31' THEN 'two' WHEN TIMESTAMP'2001-01-01 10:20:32' THEN 'three' END AS bad; SHOW WARNINGS; {code} {noformat} +------+------+ | good | bad | +------+------+ | one | NULL | +------+------+ {noformat} {noformat} +---------+------+------------------------------------+ | Level | Code | Message | +---------+------+------------------------------------+ | Warning | 1292 | Incorrect datetime value: '102030' | +---------+------+------------------------------------+ {noformat} |
This query correctly returns {{TRUE}}:
{code:sql} SELECT TIME'10:20:30' IN (102030,TIME'10:20:31'); {code} {noformat} +-------------------------------------------+ | TIME'10:20:30' IN (102030,TIME'10:20:31') | +-------------------------------------------+ | 1 | +-------------------------------------------+ {noformat} If I add more values into the {{IN}} list, it returns {{FALSE}} with a warning: {code:sql} SELECT TIME'10:20:30' IN (102030,TIME'10:20:31',TIMESTAMP'2001-01-01 10:20:32'); SHOW WARNINGS; {code} {noformat} +--------------------------------------------------------------------------+ | 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' | +---------+------+------------------------------------+ {noformat} {{CASE}} demonstrates the same problem. See |
Status | Open [ 1 ] | In Progress [ 3 ] |
Assignee | Alexander Barkov [ bar ] | Oleksandr Byelkin [ sanja ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Assignee | Oleksandr Byelkin [ sanja ] | Alexander Barkov [ bar ] |
Fix Version/s | 10.3.0 [ 22127 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Labels | datatype |
Workflow | MariaDB v3 [ 78691 ] | MariaDB v4 [ 151339 ] |
Pushed into bb-10.2-ext