(sql string, limitLoc ast.Loc)
| 248 | } |
| 249 | |
| 250 | func findCommaLimitCount(sql string, limitLoc ast.Loc) (countStart, countEnd int, found bool) { |
| 251 | pos := limitLoc.End |
| 252 | pos = skipWhitespaceAndComments(sql, pos) |
| 253 | if pos >= len(sql) || sql[pos] != ',' { |
| 254 | return 0, 0, false |
| 255 | } |
| 256 | pos++ |
| 257 | pos = skipWhitespaceAndComments(sql, pos) |
| 258 | countStart = pos |
| 259 | for pos < len(sql) && sql[pos] >= '0' && sql[pos] <= '9' { |
| 260 | pos++ |
| 261 | } |
| 262 | if pos == countStart { |
| 263 | return 0, 0, false |
| 264 | } |
| 265 | return countStart, pos, true |
| 266 | } |
| 267 | |
| 268 | func skipWhitespaceAndComments(sql string, pos int) int { |
| 269 | for pos < len(sql) { |
no test coverage detected