用 BINARY 比较绕过 utf8mb4_unicode_ci 与 utf8mb4_0900_ai_ci 的冲突。 shop code 均为纯 ASCII,BINARY 比较结果完全一致。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
-- 或由脚本拼接:
|
||||
-- echo "SET @shop_code='S001';" | cat - clear_shop.sql | mysql ...
|
||||
|
||||
SET @sid = (SELECT id FROM shops WHERE code = @shop_code LIMIT 1);
|
||||
SET @sid = (SELECT id FROM shops WHERE BINARY code = BINARY @shop_code LIMIT 1);
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user