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

MySQL Enum Search is not respecting collation #1192

Open
altmannmarcelo opened this issue Apr 2, 2024 · 0 comments
Open

MySQL Enum Search is not respecting collation #1192

altmannmarcelo opened this issue Apr 2, 2024 · 0 comments

Comments

@altmannmarcelo
Copy link
Contributor

Description

Readyset enum matching is not taking into consideration field collation.

CREATE TABLE `employees` (
  `emp_no` int NOT NULL,
  `birth_date` date NOT NULL,
  `first_name` varchar(14) NOT NULL,
  `last_name` varchar(16) NOT NULL,
  `gender` enum('M','F') NOT NULL,
  `hire_date` date NOT NULL,
  PRIMARY KEY (`emp_no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci

Table is using collation _ci

Select directly on upstream:

mysql> SELECT COUNT(*) FROM employees WHERE gender = 'm';
+----------+
| COUNT(*) |
+----------+
|   179973 |
+----------+
1 row in set (0,05 sec)

mysql> SELECT COUNT(*) FROM employees WHERE last_name = 'facello';
+----------+
| COUNT(*) |
+----------+
|      186 |
+----------+
1 row in set (0,05 sec)

Select on Readyset:

mysql> SELECT COUNT(*) FROM employees WHERE gender = 'm';
+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (0,00 sec)

mysql> SELECT COUNT(*) FROM employees WHERE last_name = 'facello';
+----------+
| COUNT(*) |
+----------+
|      186 |
+----------+
1 row in set (0,05 sec)

Note: Collation is been taken into consideration to last_name

Change in user-visible behavior

Requires documentation change

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

No branches or pull requests

1 participant