Avoid duplicate column restriction in where
This commit is contained in:
parent
5307f68364
commit
710cb0779f
|
@ -1159,7 +1159,12 @@ SQLConnector.prototype._buildWhere = function(model, where) {
|
|||
}
|
||||
}
|
||||
}
|
||||
whereStmts.push(stmt);
|
||||
var columnRestricted = false;
|
||||
whereStmts.forEach(function(stmt) {
|
||||
if (columnRestricted) return;
|
||||
columnRestricted = stmt.sql.indexOf(columnName) >= 0;
|
||||
});
|
||||
if (!columnRestricted) whereStmts.push(stmt);
|
||||
}
|
||||
var params = [];
|
||||
var sqls = [];
|
||||
|
|
Loading…
Reference in New Issue