This commit is contained in:
Lunny Xiao 2023-07-12 13:46:00 +08:00
parent e388ef801d
commit 2b48690616
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 4 additions and 4 deletions

View File

@ -269,14 +269,14 @@ func (statement *Statement) writeForUpdate(w io.Writer) error {
}
func (statement *Statement) writeMssqlPaginationCond(w *builder.BytesWriter) error {
if statement.RefTable == nil {
return errors.New("unsupported query limit without reference table")
}
if statement.dialect.URI().DBType != schemas.MSSQL || statement.Start <= 0 {
return nil
}
if statement.RefTable == nil {
return errors.New("unsupported query limit without reference table")
}
mssqlCondi := builder.NewWriter()
if err := statement.writeTop(mssqlCondi); err != nil {
return err