Skip to content
This repository has been archived by the owner on Sep 7, 2021. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

Get ignores varchar(max) conditions for MSSQL #523

Open
btrepp opened this issue Jan 19, 2017 · 1 comment
Open

Get ignores varchar(max) conditions for MSSQL #523

btrepp opened this issue Jan 19, 2017 · 1 comment
Milestone

Comments

@btrepp
Copy link

btrepp commented Jan 19, 2017

From go-gitea/gitea#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.

@lunny
Copy link
Member

lunny commented Feb 12, 2017

This is because MSSQL don't support use TEXT column as query condition. So xorm will ignore it.

@lunny lunny added this to the 0.8 milestone Mar 17, 2017
@lunny lunny modified the milestones: 0.8, 0.8.1 Jan 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants