Skip to content

Commit 244b453

Browse files
committed
Fallback to using entire row for where clause
Signed-off-by: worksofliam <[email protected]>
1 parent 9eb16b1 commit 244b453

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/views/results/html.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ export function generateScroller(basicSelect: string, isCL: boolean, withCancel?
125125
const parentRow = trWithColumn.parentElement;
126126
127127
const updateKeyColumns = updateTable.columns.filter(col => col.useInWhere);
128+
if (updateKeyColumns.length === 0) return;
128129
129130
let idValues = [];
130131
for (let i = 0; i < parentRow.cells.length; i++) {

src/views/results/resultSetPanelProvider.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,15 @@ export class ResultSetPanelProvider implements WebviewViewProvider {
186186

187187
currentColumns = tableInfo.map((column) => ({name: column.COLUMN_NAME, jsType: column.NUMERIC_PRECISION ? `number` : `asString`, useInWhere: column.IS_IDENTITY === `YES` || column.CONSTRAINT_NAME !== null}));
188188

189-
if (currentColumns.some(c => c.useInWhere)) {
190-
updatable = {
191-
table: schema + `.` + ref.object.name,
192-
columns: currentColumns
193-
}
189+
if (!currentColumns.some(c => c.useInWhere)) {
190+
// Let's fallback and use all the columns in the where!
191+
currentColumns = tableInfo.map((column) => ({name: column.COLUMN_NAME, jsType: column.NUMERIC_PRECISION ? `number` : `asString`, useInWhere: true}))
194192
}
193+
194+
updatable = {
195+
table: schema + `.` + ref.object.name,
196+
columns: currentColumns
197+
};
195198
}
196199
}
197200
}

0 commit comments

Comments
 (0)