We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
3.2409.0
MySQL规则,联合索引,必须使用联合索引的首字段误报错
CREATE TABLE `user_1` ( `id` int NOT NULL AUTO_INCREMENT, `name` INT NOT NULL, `age` varchar(20) NOT NULL, `desc` varchar(100) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `IDX_UID_CHANNEL` (`name`, `age`), KEY `idx_PARTNER_UID_CHANNEL` (`desc`, `age`) ) ENGINE = InnoDB AUTO_INCREMENT = 2 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
SELECT * FROM user_1 WHERE name = 't' AND age = 12;
表user_1存在两个联合索引,两个联合索引第二个字段都是 age 字段,联合索引最左不同,复现的SQL能满足IDX_UID_CHANNEL索引,但是不满足idx_PARTNER_UID_CHANNEL联合索引
UNIQUE KEY `IDX_UID_CHANNEL` (`name`, `age`), KEY `idx_PARTNER_UID_CHANNEL` (`desc`, `age`)
The text was updated successfully, but these errors were encountered:
ColdWaterLW
No branches or pull requests
版本信息(Version)
3.2409.0
问题描述(Describe)
MySQL规则,联合索引,必须使用联合索引的首字段误报错
截图或日志(Log)
如何复现(To Reproduce)
问题原因
表user_1存在两个联合索引,两个联合索引第二个字段都是 age 字段,联合索引最左不同,复现的SQL能满足IDX_UID_CHANNEL索引,但是不满足idx_PARTNER_UID_CHANNEL联合索引
解决方案
变更影响面
受影响的模块或功能
外部引用的潜在问题或风险
版本兼容性
测试建议
The text was updated successfully, but these errors were encountered: