Skip to content

Commit 8da05ef

Browse files
authored
Merge pull request #84 from halcyon-tech:issue83
Fix errors when certain SQL statements return no result set
2 parents 65220c7 + e45b4ba commit 8da05ef

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

src/connection/serverComponent.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const octokit = new Octokit();
1414

1515
// During development, you can set the SERVER_VERSION in .vscode/launch.json
1616
// Otherwise, fall back to the working version
17-
const SERVER_VERSION = process.env[`SERVER_VERSION`] || `v1.0.0-alpha-32`;
17+
const SERVER_VERSION = process.env[`SERVER_VERSION`] || `v1.0.0-alpha-33`;
1818

1919
const ExecutablePathDir = `$HOME/.vscode/`;
2020

@@ -185,4 +185,4 @@ function downloadFile(url, outputPath) {
185185
return fetch(url)
186186
.then(x => x.arrayBuffer())
187187
.then(x => writeFile(outputPath, Buffer.from(x)));
188-
}
188+
}

src/connection/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export interface SetConfigResult extends ServerResponse {
4141
export interface QueryResult<T> extends ServerResponse {
4242
metadata: QueryMetaData,
4343
is_done: boolean;
44+
has_results: boolean;
4445
data: T[];
4546
}
4647

src/testing/jobs.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,19 @@ export const JobsSuite: TestSuite = {
113113
newJob.close();
114114
}},
115115

116+
{name: `SQL with no result set`, test: async () => {
117+
assert.strictEqual(ServerComponent.isInstalled(), true);
118+
119+
let newJob = new SQLJob();
120+
await newJob.connect();
121+
122+
let result = await newJob.query(`create or replace table qtemp.tt as (select * from sysibm.sysdummy1) with data on replace delete rows`).run();
123+
assert.equal(result.success, true);
124+
assert.equal(result.has_results, false);
125+
assert.equal(result.data, undefined);
126+
newJob.close();
127+
}},
128+
116129
{name: `CL Command (success)`, test: async () => {
117130
assert.strictEqual(ServerComponent.isInstalled(), true);
118131

0 commit comments

Comments
 (0)