dble
dble copied to clipboard
使用PS插入binary列时报错`Data too long`
使用Quick Start搭建环境.
dble-3.21.10.0-97a3b6d73a49cb374020f930c59f82746220b424-20211119064810
对于如下有binary列的SingleTable:
drop table testdb.tb_single;
create table testdb.tb_single (source_uuid binary(16) primary key);
在go中使用PreparedStatement插入:
import "github.com/satori/go.uuid"
bs := uuid.FromStringOrNil("ED042FFA-C7D8-11EA-A8DF-1C34DA5C1130").Bytes()
// len(bs) == 16
_, err = db.Exec("replace into testdb.tb_single values (?)", bs)
得到报错:
Error 1406: Data too long for column 'source_uuid' at row 1
直连MySQL则能正常插入。