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 f91dee6 + d1ea01e commit b3fd989Copy full SHA for b3fd989
lib/sql.js
@@ -1131,11 +1131,13 @@ SQLConnector.prototype._buildWhere = function(model, where) {
1131
branches.push(stmtForClause.sql);
1132
}
1133
1134
- stmt.merge({
1135
- sql: '(' + branches.join(' ' + key.toUpperCase() + ' ') + ')',
1136
- params: branchParams,
1137
- });
1138
- whereStmts.push(stmt);
+ if (branches.length > 0) {
+ stmt.merge({
+ sql: '(' + branches.join(' ' + key.toUpperCase() + ' ') + ')',
+ params: branchParams,
+ });
1139
+ whereStmts.push(stmt);
1140
+ }
1141
continue;
1142
1143
// The value is not an array, fall back to regular fields
0 commit comments