[MDEV-20279] Increase Aria index length limit Created: 2019-08-07 Updated: 2023-11-27 Due: 2019-08-18 Resolved: 2019-08-28 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Aria |
| Fix Version/s: | 10.5.0 |
| Type: | Task | Priority: | Major |
| Reporter: | Michael Widenius | Assignee: | Michael Widenius |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Description |
|
The max length of a key in Aria is limited by HA_MAX_KEY_LENGTH (1000 bytes). The reason for the limit is that Aria is storing keys on the stack while doing recursive searches in the b-tree. Just increasing the size of HA_MAX_KEY_LENGTH could cause problems with the stack. The solution would be to instead of using alloca() for storing key pages and indexes on the stack (as we do now) instead create a new interface that would use alloca() if there is stack available and otherwise malloc(). This would allow us to allocate just as much memory that is needed, instead of always allocating increments of HA_MAX_KEY_LENGTH and thus decrease the usage of stack size for common tables. The problem with Aria max key length has recently been highlighted by users trying to convert InnoDB tables with long utf8mb4 byte characters which failed because Aria (and thus S3 engine) has a smaller max key length than InnoDB. Example: (The error message should also be fixed...) |