return a clear error for set TEXT type as compare condition
This commit is contained in:
parent
2c064b6da6
commit
94ac175648
|
@ -827,10 +827,6 @@ func (statement *Statement) buildConds2(table *schemas.Table, bean interface{},
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if statement.dialect.URI().DBType == schemas.MSSQL && (col.SQLType.Name == schemas.Text ||
|
|
||||||
col.SQLType.IsBlob() || col.SQLType.Name == schemas.TimeStampz) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if col.IsJSON {
|
if col.IsJSON {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -862,6 +858,15 @@ func (statement *Statement) buildConds2(table *schemas.Table, bean interface{},
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if statement.dialect.URI().DBType == schemas.MSSQL && (col.SQLType.Name == schemas.Text ||
|
||||||
|
col.SQLType.IsBlob() || col.SQLType.Name == schemas.TimeStampz) {
|
||||||
|
if utils.IsValueZero(fieldValue) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil, fmt.Errorf("column %s is a TEXT type which cannot be as compare condition", col.Name)
|
||||||
|
}
|
||||||
|
|
||||||
requiredField := useAllCols
|
requiredField := useAllCols
|
||||||
if b, ok := getFlagForColumn(mustColumnMap, col); ok {
|
if b, ok := getFlagForColumn(mustColumnMap, col); ok {
|
||||||
if b {
|
if b {
|
||||||
|
|
Loading…
Reference in New Issue