fix: Legacy MsSQL - legacy offset select sql command bug #2446 (#2448)

fix for MsSQL legacy bug

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/xorm/xorm/pulls/2448
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Dacian Stanciu <daci28@yahoo.com>
Co-committed-by: Dacian Stanciu <daci28@yahoo.com>
This commit is contained in:
Dacian Stanciu 2024-04-24 13:47:05 +00:00 committed by Lunny Xiao
parent 8094e98a8f
commit 4e74c80b67
1 changed files with 2 additions and 1 deletions

View File

@ -19,8 +19,9 @@ func (statement *Statement) isUsingLegacyLimitOffset() bool {
func (statement *Statement) writeMssqlLegacySelect(buf *builder.BytesWriter, columnStr string) error { func (statement *Statement) writeMssqlLegacySelect(buf *builder.BytesWriter, columnStr string) error {
return statement.writeMultiple(buf, return statement.writeMultiple(buf,
statement.writeStrings("SELECT"), statement.writeStrings("SELECT"),
statement.writeDistinct,
statement.writeTop, statement.writeTop,
statement.writeDistinct,
statement.writeStrings(" ", columnStr),
statement.writeFrom, statement.writeFrom,
statement.writeWhereWithMssqlPagination, statement.writeWhereWithMssqlPagination,
statement.writeGroupBy, statement.writeGroupBy,