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

Panic when using latin1 charset and latin1_german1_ci collation #4172

Closed
timsehn opened this issue Aug 23, 2022 · 2 comments
Closed

Panic when using latin1 charset and latin1_german1_ci collation #4172

timsehn opened this issue Aug 23, 2022 · 2 comments
Assignees
Labels
bug Something isn't working sql Issue with SQL

Comments

@timsehn
Copy link
Contributor

timsehn commented Aug 23, 2022

Referencing example in: #4168

I decided to define the collations on the columns instead so I could test. This time it panics.

Repro:

MySQL [charsets_collations]> create table german1 (c char(10) CHARACTER SET latin1 COLLATE latin1_german1_ci);
Query OK, 0 rows affected (0.003 sec)

MySQL [charsets_collations]> create table german2 (c char(10) CHARACTER SET latin1 COLLATE latin1_german2_ci);
Query OK, 0 rows affected (0.002 sec)

MySQL [charsets_collations]> create table german3 (c char(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci);
Query OK, 0 rows affected (0.004 sec)

MySQL [charsets_collations]> INSERT INTO german1 VALUES ('Bar'), ('Bär');
Query OK, 2 rows affected (0.004 sec)

MySQL [charsets_collations]> INSERT INTO german2 VALUES ('Bar'), ('Bär');
Query OK, 2 rows affected (0.004 sec)

MySQL [charsets_collations]> INSERT INTO german3 VALUES ('Bar'), ('Bär');
Query OK, 2 rows affected (0.003 sec)

MySQL [charsets_collations]> SELECT * FROM german1 WHERE c = 'Bär';
ERROR 1105 (HY000): panic in ExchangeIterPartitionRows: runtime error: invalid memory address or nil pointer dereference
MySQL [charsets_collations]> show create table german1;
+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table   | Create Table                                                                                                                                            |
+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| german1 | CREATE TABLE `german1` (
  `c` char(10) CHARACTER SET latin1 COLLATE latin1_german1_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin |
+---------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.001 sec)

MySQL [charsets_collations]> SELECT * FROM german1 WHERE c = 'Bär';
ERROR 1105 (HY000): panic in ExchangeIterPartitionRows: runtime error: invalid memory address or nil pointer dereference
MySQL [charsets_collations]> SELECT * FROM german2 WHERE c = 'Bär';
ERROR 1105 (HY000): panic in ExchangeIterPartitionRows: runtime error: invalid memory address or nil pointer dereference
MySQL [charsets_collations]> SELECT * FROM german3 WHERE c = 'Bär';
+------+
| c    |
+------+
| Bar  |
| Bär  |
+------+
2 rows in set (0.001 sec)
@timsehn timsehn changed the title Collation Panic when using latin1 charset and latin1_german1_ci collation Panic when using latin1 charset and latin1_german1_ci collation Aug 23, 2022
@timsehn timsehn added the bug Something isn't working label Aug 23, 2022
@Hydrocharged
Copy link
Contributor

The issue here is that CREATE TABLE does not properly block not-yet-implemented collations. This has been fixed in dolthub/go-mysql-server#1215

@Hydrocharged
Copy link
Contributor

Hydrocharged commented Aug 24, 2022

Additionally, the above PR adds the latin1 character set, along with the following collations:

  • latin1_bin
  • latin1_general_ci
  • latin1_general_cs
  • latin1_german1_ci
  • latin1_german2_ci
  • latin1_swedish_ci

@timsehn timsehn added the sql Issue with SQL label Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sql Issue with SQL
Projects
None yet
Development

No branches or pull requests

2 participants