go-xorm / xorm

Simple and Powerful ORM for Go, support mysql,postgres,tidb,sqlite3,mssql,oracle, Moved to https://gitea.com/xorm/xorm
BSD 3-Clause "New" or "Revised" License
6.67k stars 754 forks source link

MariaDB数据表字段默认值有问题 #1204

Open richardchey opened 5 years ago

richardchey commented 5 years ago

MySQL: default

MariaDB: default

导致使用MariaDB时,DBMetas的返回结果,列的默认值(Column.Default)多了一层单引号。另外在调用Sync时会产生不符实际的告警信息。

richardchey commented 5 years ago

也不是所有的MariaDB都会这样,我试了下,10.1.37没有问题,但是10.3.12会出问题。

zxysilent commented 5 years ago

同样发现这个问题 默认值不对应

zxysilent commented 5 years ago

[xorm] [warn] 2019/06/06 15:54:03.911124 Table article Column addr db default is '''', struct default is '' [xorm] [warn] 2019/06/06 15:54:03.912121 Table article Column area db default is '''', struct default is '' [xorm] [warn] 2019/06/06 15:54:03.913118 Table article Column utime db default is 'NULL', struct default is NULL [xorm] [warn] 2019/06/06 15:54:03.914116 Table article Column ctime db default is 'NULL', struct default is NULL

image