Files
bisheng/docker
Kinyoo 755e67058b fix(knowledge): stop the space list 500-ing on a collation mismatch
Joining spaces to their members casts Knowledge.id to text, and on MySQL
that cast carries `collation_connection` — utf8mb4_0900_ai_ci on a stock
MySQL 8 — while space_channel_member.business_id carries the table's
utf8mb4_unicode_ci. Two IMPLICIT collations that differ make MySQL raise
1267 rather than run the join, so the endpoint returned a 500.

StrJoinKey renders the cast with an EXPLICIT `COLLATE utf8mb4_unicode_ci`
on MySQL, which outranks whatever the other side carries; the keys are
digit strings, so no utf8mb4 collation orders them differently. Other
dialects keep the plain cast — DaMeng has no per-column collation to
clash with and would reject the clause outright.

The container config was meant to prevent this and did not:

- `SET collation_connection = x, NAMES utf8mb4` undoes itself, because
  `SET NAMES` resets the collation to the charset's default. It becomes
  one statement: `SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci`.
- init_connect is skipped entirely for users with SUPER /
  CONNECTION_ADMIN, and BiSheng connects as root — so
  skip-character-set-client-handshake is required, not the optional
  extra its commented-out line implied.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-24 10:40:09 +08:00
..
2026-07-17 20:07:14 +08:00
2024-03-01 18:28:41 +08:00
2023-11-01 22:30:37 +08:00
2026-04-03 16:03:25 +08:00
2025-09-17 00:39:24 +08:00
2026-08-11 15:45:25 +08:00