Distinct and limit (top) with mssql #593
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#593
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?
In gogs gogits/gogs#4419, using
Distinct
andLimit
together in MSSQL results in a syntax error. I think that problem might be coming from xorm? Possibly from a Sprintf in statement.go.Currently the generated SQL looks like this:
It should have
DISTINCT
beforeTOP
, like this:@22222 please confirm that #596 fixed this issue.
Looks good to me. I tested with a local copy of gogs (using mssql), and the error stopped after updating to the version of xorm with this fix (the
lunny/fix_mssql_top_distinct
branch).Thanks for getting a fix in so quickly.