不要怂,就是干,撸起袖子干!

Commit 835828a2 by Mick Hansen

fix limit default when undefined but offset is set

1 parent de207ba9
...@@ -1765,7 +1765,7 @@ var QueryGenerator = { ...@@ -1765,7 +1765,7 @@ var QueryGenerator = {
addLimitAndOffset: function(options, model) { addLimitAndOffset: function(options, model) {
var fragment = ''; var fragment = '';
if (options.offset && !options.limit) { if (options.offset && !options.limit) {
fragment += ' LIMIT ' + this.escape(options.offset) + ', ' + 18440000000000000000; fragment += ' LIMIT ' + this.escape(options.offset) + ', ' + 10000000000000;
} else if (options.limit) { } else if (options.limit) {
if (options.offset) { if (options.offset) {
fragment += ' LIMIT ' + this.escape(options.offset) + ', ' + this.escape(options.limit); fragment += ' LIMIT ' + this.escape(options.offset) + ', ' + this.escape(options.limit);
......
...@@ -332,7 +332,7 @@ if (Support.dialectIsMySQL()) { ...@@ -332,7 +332,7 @@ if (Support.dialectIsMySQL()) {
}, { }, {
title: 'uses default limit if only offset is specified', title: 'uses default limit if only offset is specified',
arguments: ['myTable', {offset: 2}], arguments: ['myTable', {offset: 2}],
expectation: 'SELECT * FROM `myTable` LIMIT 2, 18440000000000000000;', expectation: 'SELECT * FROM `myTable` LIMIT 2, 10000000000000;',
context: QueryGenerator context: QueryGenerator
}, { }, {
title: 'multiple where arguments', title: 'multiple where arguments',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!