Repository navigation
fix(mysql): 修复 JdbcStore 在 utf8mb4 下初始化表失败 - #1781
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR fixes MysqlJdbcStoreDialect failing to create tables under utf8mb4 encoding due to the composite primary key exceeding InnoDB's 3072-byte index limit. The fix reduces namespace_path to VARCHAR(512) and increases item_key to VARCHAR(255), yielding (512+255) × 4 = 3068 bytes ≤ 3072 — mathematically correct. A regression test validates the constraint. The namespace_path reduction from 768 to 512 is a silent truncation, though the original value was already unusable under utf8mb4.
(inline comments could not be attached — line numbers fell outside PR hunks. See archived report.)
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR fixes MysqlJdbcStoreDialect failing to create tables under utf8mb4 encoding due to the composite primary key exceeding InnoDB's 3072-byte index limit. The fix reduces namespace_path to VARCHAR(512) and increases item_key to VARCHAR(255), yielding (512+255) × 4 = 3068 bytes ≤ 3072 — mathematically correct. A regression test validates the constraint. The namespace_path reduction from 768 to 512 is a silent truncation, though the original value was already unusable under utf8mb4.
(inline comments could not be attached — line numbers fell outside PR hunks. See archived report.)
关联 Issue
背景
MySQL/MariaDB 下
agentscope_store的联合主键在utf8mb4编码下超过 InnoDB 3072 字节限制,导致 schema 初始化失败。修改
namespace_path调整为VARCHAR(512)item_key调整为VARCHAR(255)utf8mb4限制验证
mvn -pl agentscope-extensions/agentscope-extensions-mysql -am -Dtest=MysqlJdbcStoreDialectTest test