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

Bug: MySQL下重复添加联合索引导致索引数超出MySQL范围 #25

Closed
ifrvn opened this issue Apr 27, 2023 · 2 comments
Closed

Comments

@ifrvn
Copy link
Contributor

ifrvn commented Apr 27, 2023

问题描述

本地调试插件时突然出现报错
ER_TOO_MANY_KEYS: Too many keys specified; max 64 keys allowed

image

复现过程

插件中建一个表,并设置联合索引

ctx.model.extend('test', {
  id: 'unsigned',
  test1: 'string',
  test2: 'string',
}, {
  autoInc: true,
  unique: [['test1', 'test2']],  // 这里使用联合索引
})

然后每次reload插件,查看MySQL的INFORMATION_SCHEMA.KEY_COLUMN_USAGE表,都能观察到新建了索引

image

64次后就会出现以上报错

版本

MySQL 8
koishi 4.12.6
@koishijs/plugin-database-mysql 5.4.4

@ilharp
Copy link

ilharp commented Apr 27, 2023

image

刚刚看了下,竟然真的存在这个问题,感觉还挺严重的,希望官方能够尽快修复

@shigma shigma closed this as completed in 8157998 May 8, 2023
@shigma
Copy link
Member

shigma commented May 8, 2023

问题应该已经修复,麻烦使用最新版本测试一下。如果仍然不行我会重新开启此 issue。

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

3 participants