[MDEV-8613] Full table scan for WHERE indexed_varchar_column <=> 'bad-character' Created: 2015-08-13  Updated: 2015-08-14  Resolved: 2015-08-13

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 5.5, 10.0, 10.1
Fix Version/s: 10.1.7

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

Issue Links:
Relates
relates to MDEV-6105 Emoji unicode character string search... Closed

 Description   

The patch for MDEV-6105 made this script

SET NAMES utf8;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8, KEY(a)) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('a'),('b'),('c'),('d'),('e');
EXPLAIN SELECT * FROM t1 WHERE a='��';

correct;y return "Impossible WHERE":

+------+-------------+-------+------+---------------+------+---------+------+------+-----------------------------------------------------+
| id   | select_type | table | type | possible_keys | key  | key_len | ref  | rows | Extra                                               |
+------+-------------+-------+------+---------------+------+---------+------+------+-----------------------------------------------------+
|    1 | SIMPLE      | NULL  | NULL | NULL          | NULL | NULL    | NULL | NULL | Impossible WHERE noticed after reading const tables |
+------+-------------+-------+------+---------------+------+---------+------+------+-----------------------------------------------------+

However, if I use <=> instead of =, it still switches to full table scan.

It should be fixed to return "Impossible WHERE" for <=>.


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