Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field querying does not work as expected with integers and some operations #226

Open
georgifarashev opened this issue Feb 5, 2019 · 0 comments

Comments

@georgifarashev
Copy link
Contributor

If field querying is used with numbers and operations lt or gt the comparison is done alphabetically.
For example: col1 gt 12 in a table containing rows with col1 from 1 to 14 will return result with col1 from 2 to 9, 13 and 14 instead of just 13 and 14.
The problematic code seems to be here:

clause := fmt.Sprintf("%s.%s::text %s %s", baseTableName, option.LeftOp, sqlOperation, rightOpBindVar)

and more specifically the ::text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant