return a clear error for set TEXT type as compare condition #2062
|
@ -827,10 +827,6 @@ func (statement *Statement) buildConds2(table *schemas.Table, bean interface{},
|
|||
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 {
|
||||
continue
|
||||
}
|
||||
|
@ -862,6 +858,15 @@ func (statement *Statement) buildConds2(table *schemas.Table, bean interface{},
|
|||
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
|
||||
if b, ok := getFlagForColumn(mustColumnMap, col); ok {
|
||||
if b {
|
||||
|
|
Loading…
Reference in New Issue
Block a user