Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefix index implementation for utf8 string is incorrect #397

Closed
birdstorm opened this issue Jul 19, 2018 · 0 comments · Fixed by #400
Closed

Prefix index implementation for utf8 string is incorrect #397

birdstorm opened this issue Jul 19, 2018 · 0 comments · Fixed by #400
Assignees

Comments

@birdstorm
Copy link
Contributor

Related to pingcap/tidb#7104

mysql> show create table t1;
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                                                         |
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| t1    | CREATE TABLE `t1` (
  `name` varchar(12) DEFAULT NULL,
  KEY `pname` (`name`(12))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci |
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> insert into t1 values('借款策略集_网页');
Query OK, 1 row affected (0.14 sec)
scala> spark.sql("select * from t1 where name = '借款策略集_网页'").show
+----+
|name|
+----+
+----+

scala> spark.sql("select * from t1 where name < '借款策略集_网页'").show
+----+
|name|
+----+
|借款策略|
+----+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant