Skip to content

Commit

Permalink
fix: empty offset in cell update queries
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio286 committed May 31, 2021
1 parent 865dad8 commit acc1eeb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/libs/clients/MySQLClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,7 @@ export class MySQLClient extends AntaresCore {
const limitRaw = this._query.limit.length ? `LIMIT ${this._query.limit.join(', ')} ` : '';

// OFFSET
const offsetRaw = this._query.limit.length ? `OFFSET ${this._query.offset.join(', ')} ` : '';
const offsetRaw = this._query.offset.length ? `OFFSET ${this._query.offset.join(', ')} ` : '';

return `${selectRaw}${updateRaw ? 'UPDATE' : ''}${insertRaw ? 'INSERT ' : ''}${this._query.delete ? 'DELETE ' : ''}${fromRaw}${updateRaw}${whereRaw}${groupByRaw}${orderByRaw}${limitRaw}${offsetRaw}${insertRaw}`;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/libs/clients/PostgreSQLClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@ export class PostgreSQLClient extends AntaresCore {
const limitRaw = selectArray.length && this._query.limit.length ? `LIMIT ${this._query.limit.join(', ')} ` : '';

// OFFSET
const offsetRaw = selectArray.length && this._query.limit.length ? `OFFSET ${this._query.offset.join(', ')} ` : '';
const offsetRaw = selectArray.length && this._query.offset.length ? `OFFSET ${this._query.offset.join(', ')} ` : '';

return `${selectRaw}${updateRaw ? 'UPDATE' : ''}${insertRaw ? 'INSERT ' : ''}${this._query.delete ? 'DELETE ' : ''}${fromRaw}${updateRaw}${whereRaw}${groupByRaw}${orderByRaw}${limitRaw}${offsetRaw}${insertRaw}`;
}
Expand Down

0 comments on commit acc1eeb

Please sign in to comment.