Legacy MsSQL - legacy offset select sql command bug #2446
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#2446
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?
Recently all my sql query eroors - because sql server is 2003 and won't be able to upgrade-it.
is fine just my mssql understands TOP 1 instead
OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY
so I had to use LEGACY OFFSET
The generated/executed query is
SELECT TOP 1 FROM tmp ORDER BY [b] DESC
It seems the select part is missed when legacy limit offset is set to true!
it should be
SELECT TOP 1 a,b FROM ...
found where the problem is:
func (statement *Statement) writeMssqlLegacySelect(buf *builder.BytesWriter, columnStr string)
from legacy_select.go
Solved it - please update the code...
legacy_select.go, insert in line 24 statement.writeStrings(" ",columnStr),
Please send a PR to fix it. Thank you in advance.