[MDEV-30057] strnncollsp_nchars() gets called in a suspicious way from InnoDB Created: 2022-11-21 Updated: 2022-11-21 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Character Sets, Storage Engine - InnoDB |
| Affects Version/s: | 10.4 |
| Fix Version/s: | 10.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Marko Mäkelä |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I apply this patch:
The idea of the assert is to prove that InnoDB for the CHAR(N) data type:
Then I run this script:
the server crashes on the new assert when doing the insert into t2. Tracing in gdb show that the lengths are different indeed:
If I change the collation from latin1_bin to latin1_german1_ci:
it does not crash. Tracing the same place shows that lengths are equal:
This looks suspicious. The two collations should work symmetrically in this context.
|
| Comments |
| Comment by Marko Mäkelä [ 2022-11-21 ] | |||||||||||||||||||||||||||||||||
|
The code has been refactored in
The first added assertion would fail in a number of tests:
FOREIGN KEY constraints or column prefix indexes seem to be a common theme. For example, innodb.blob_cmp_empty hits the assertion failure on the UPDATE:
|