We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 16a364a + 003dd12 commit bd3f4a4Copy full SHA for bd3f4a4
lib/sql.js
@@ -299,13 +299,14 @@ var sql = {
299
300
if (options.limit) {
301
queryPart += 'LIMIT ' + options.limit + ' ';
302
- } else {
303
- // Some MySQL hackery here. For details, see:
304
- // http://stackoverflow.com/questions/255517/mysql-offset-infinite-rows
305
- queryPart += 'LIMIT 18446744073709551610 ';
306
}
307
308
if (options.skip) {
+ // Some MySQL hackery here. For details, see:
+ // http://stackoverflow.com/questions/255517/mysql-offset-infinite-rows
+ if (!options.limit) {
+ queryPart += 'LIMIT 18446744073709551610 ';
309
+ }
310
queryPart += 'OFFSET ' + options.skip + ' ';
311
312
0 commit comments