Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.6, 11.6(EOL)
-
None
Description
SET @@note_verbosity='all'; |
CREATE OR REPLACE TABLE t1 (f CHAR(8) CHARACTER SET latin1, KEY(f)); |
INSERT INTO t1 VALUES (''),(''); |
SELECT * FROM t1 WHERE f IN ('a',3); |
SHOW WARNINGS;
|
+---------+------+---------------------------------------+
|
| Level | Code | Message |
|
+---------+------+---------------------------------------+
|
| Warning | 1292 | Truncated incorrect DECIMAL value: '' |
|
| Warning | 1292 | Truncated incorrect DECIMAL value: '' |
|
+---------+------+---------------------------------------+
|
Notice, there is no a warning about the data type problem for the pair (f,3).
The expected behavior would be to report the data type mismatch for this pair.
If I change replace the 3 to a string literal with a COLLATE clause, it correctly reports the collation mismatch for this pair:
SELECT * FROM t1 WHERE f IN ('a',_latin1'b' COLLATE latin1_german2_ci); |
SHOW WARNINGS;
|
+---------+------+--------------------------------------------------------------------------------------------+
|
| Level | Code | Message |
|
+---------+------+--------------------------------------------------------------------------------------------+
|
| Note | 1105 | Cannot use key `f` part[0] for lookup: `test`.`t1`.`f` of type `char` >= "3" of type `int` |
|
| Warning | 1292 | Truncated incorrect DOUBLE value: '' |
|
| Warning | 1292 | Truncated incorrect DOUBLE value: 'a' |
|
| Warning | 1292 | Truncated incorrect DOUBLE value: '' |
|
| Warning | 1292 | Truncated incorrect DOUBLE value: 'a' |
|
+---------+------+--------------------------------------------------------------------------------------------+
|
Attachments
Issue Links
- relates to
-
MDEV-32203 Raise notes when an index cannot be used on data type mismatch
- Closed
-
MDEV-32957 Unusable key notes report wrong predicates for > and >=
- Closed
-
MDEV-32958 Unusable key notes do not get reported for some operations
- Closed
-
MDEV-34600 Wrong unusable key column on char_col BETWEEN 'a' AND 3
- Open