CmsWing icon indicating copy to clipboard operation
CmsWing copied to clipboard

注册 用户名太长 没有限制导致报错

Open lazyTai opened this issue 6 years ago • 1 comments

注册的时候我使用了 [email protected]的长度字符串报错 也没有提示 后来看了后台logs

m','18819448261',1565861057993,0,1), Time: 5ms
{ Error: ER_DATA_TOO_LONG: Data too long for column 'username' at row 1
    at Query.Sequence._packetToError (/Users/macbook/Downloads/CmsWing/node_modules/[email protected]@mysql/lib/protocol/sequences/Sequence.js:47:14)
    at Query.ErrorPacket (/Users/macbook/Downloads/CmsWing/node_modules/[email protected]@mysql/lib/protocol/sequences/Query.js:77:18)
    at Protocol._parsePacket (/Users/macbook/Downloads/CmsWing/node_modules/[email protected]@mysql/lib/protocol/Protocol.js:291:23)
    at Parser._parsePacket (/Users/macbook/Downloads/CmsWing/node_modules/[email protected]@mysql/lib/protocol/Parser.js:433:10)
    at Parser.write (/Users/macbook/Downloads/CmsWing/node_modules/[email protected]@mysql/lib/protocol/Parser.js:43:10)
    at Protocol.write (/Users/macbook/Downloads/CmsWing/node_modules/[email protected]@mysql/lib/protocol/Protocol.js:38:16)
    at Socket.<anonymous> (/Users/macbook/Downloads/CmsWing/node_modules/[email protected]@mysql/lib/Connection.js:91:28)
    at Socket.<anonymous> (/Users/macbook/Downloads/CmsWing/node_modules/[email protected]@mysql/lib/Connection.js:525:10)
    at Socket.emit (events.js:189:13)
    at addChunk (_stream_readable.js:284:12)
    at readableAddChunk (_stream_readable.js:265:11)
    at Socket.Readable.push (_stream_readable.js:220:10)
    at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
    --------------------
    at Protocol._enqueue (/Users/macbook/Downloads/CmsWing/node_modules/[email protected]@mysql/lib/protocol/Protocol.js:144:48)
    at PoolConnection.query (/Users/macbook/Downloads/CmsWing/node_modules/[email protected]@mysql/lib/Connection.js:201:25)
    at Promise (/Users/macbook/Downloads/CmsWing/node_modules/[email protected]@think-helper/index.js:83:10)
    at new Promise (<anonymous>)
    at args (/Users/macbook/Downloads/CmsWing/node_modules/[email protected]@think-helper/index.js:82:12)
    at ThinkMysql.[think-mysql-query] (/Users/macbook/Downloads/CmsWing/node_modules/[email protected]@think-mysql/index.js:169:12)
    at getConnection.then.connection (/Users/macbook/Downloads/CmsWing/node_modules/[email protected]@think-mysql/index.js:247:25)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  code: 'ER_DATA_TOO_LONG',

lazyTai avatar Aug 15 '19 09:08 lazyTai

数据库字段限制了长度,这个后面修复下

arterli avatar Aug 24 '19 04:08 arterli