Get ignores varchar(max) conditions for MSSQL #523
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#523
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
From https://github.com/go-gitea/gitea/issues/697
It appears that
has, err := x.Get(&PublicKey{ Content: content, Type: KeyTypeUser, })
Where content is of type
varchar(max)
. The content query condition is ignored. This ends up checking on the type condition, and returning incorrect values.MSSQL does support querying on text columns. Eg the below works
has, err := x.Where("content=?",content).Where("type=?",KeyTypeUser).Get(&PublicKey{})
Go-xorm should either support that in the "bean" or error out if it is not supported. Silently dropping it leads to unexpected results.
This is because MSSQL don't support use
TEXT
column as query condition. So xorm will ignore it.Maybe we should give an error clearly.