This commit is contained in:
Lunny Xiao 2020-11-03 14:13:04 +08:00
parent 28c346073c
commit 451f81287a
1 changed files with 3 additions and 0 deletions

View File

@ -247,6 +247,9 @@ func (statement *Statement) genSelectSQL(columnStr string, needLimit, needOrderB
top = fmt.Sprintf("TOP %d ", LimitNValue)
}
if statement.Start > 0 {
if statement.RefTable == nil {
return "", nil, errors.New("Unsupported query limit without reference table")
}
var column string
if len(statement.RefTable.PKColumns()) == 0 {
for _, index := range statement.RefTable.Indexes {