koishijs / koishi

Cross-platform chatbot framework made with love
https://koishi.chat
MIT License
4.53k stars 246 forks source link

Bug: mysql数据库使用漂流瓶插件存入图片地址时报错 #1322

Closed axlmly closed 10 months ago

axlmly commented 11 months ago

Describe the bug

7b8783b76383cfe

Steps to reproduce

使用mysql数据库时使用插件re-driftbottle插件,扔漂流瓶指令添加图片漂流瓶时报ER_DATA_TOO_LONG: Data too long for column 'content' at row 1

Expected behavior

可正常写入

Screenshots

7b8783b76383cfe -14d2c5ca2b93e7ff

Versions

System: OS: Windows 11 10.0.22631 CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz

Binaries: Node: 20.3.1 Yarn: 4.0.1

Koishi: Core: 4.16.2 Console: 5.22.6 Koishi Desktop: 1.0.0

Additional context

测试sqllite可正常操作

MaikoTan commented 11 months ago

I think it is the bug caused by the plugin itself not Koishi. I am seeing currently the type of content column is just string which would be resolved as varchar with a 255 length in MySQL, but resolved as TEXT in SQLite which allows longer length. What you should do is to fire an issue on the plugin re-driftbottle instead, requesting to change the type of the column content to have a longer length or another type such as text.

我认为这是插件本身引起的错误,而不是 Koishi。 我看到当前 content 列的类型只是字符串,在 MySQL 中它将被解析为长度为 255varchar ,但在 SQLite 中解析为 TEXT,这允许更长的长度。 您应该做的是在插件 re-driftbottle 上打开一个问题,请求将 content 列的类型更改为更长的长度或其他类型,例如 text

shigma commented 11 months ago

这是插件的问题,请前往插件的仓库提交 issue。