Skip to content

Commit 60c4d8d

Browse files
authored
Merge pull request #1519 from github/aeisenberg/upgrade-db-fix
Avoid error after upgrading a database
2 parents 5c8098f + bfc9a17 commit 60c4d8d

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

extensions/ql-vscode/CHANGELOG.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
## [UNRELEASED]
44

55
- Remove ability to download databases from LGTM. [#1467](https://github.com/github/vscode-codeql/pull/1467)
6-
- Removed the ability to manually upgrade databases from the context menu on databases. Databases are non-destructively upgraded automatically so
7-
for most users this was not needed. For advanced users this is still available in the Command Palette. [#1501](https://github.com/github/vscode-codeql/pull/1501)
6+
- Removed the ability to manually upgrade databases from the context menu on databases. Databases are non-destructively upgraded automatically so for most users this was not needed. For advanced users this is still available in the Command Palette. [#1501](https://github.com/github/vscode-codeql/pull/1501)
7+
- Always restart the query server after a manual database upgrade. This avoids a bug in the query server where an invalid dbscheme was being retained in memory after an upgrade. [#1519](https://github.com/github/vscode-codeql/pull/1519)
88

99
## 1.6.12 - 1 September 2022
1010

@@ -20,7 +20,7 @@ No user facing changes.
2020

2121
No user facing changes.
2222

23-
## 1.6.9 - 20 July 2022
23+
## 1.6.9 - 20 July 2022
2424

2525
No user facing changes.
2626

extensions/ql-vscode/src/upgrades.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,14 @@ export async function upgradeDatabaseExplicit(
194194
void qs.logger.log('Running the following database upgrade:');
195195

196196
getUpgradeDescriptions(compileUpgradeResult.compiledUpgrades).map(s => s.description).join('\n');
197-
return await runDatabaseUpgrade(qs, dbItem, compileUpgradeResult.compiledUpgrades, progress, token);
197+
const result = await runDatabaseUpgrade(qs, dbItem, compileUpgradeResult.compiledUpgrades, progress, token);
198+
199+
// TODO Can remove the next lines when https://github.com/github/codeql-team/issues/1241 is fixed
200+
// restart the query server to avoid a bug in the CLI where the upgrade is applied, but the old dbscheme
201+
// is still cached in memory.
202+
203+
await qs.restartQueryServer(progress, token);
204+
return result;
198205
}
199206
catch (e) {
200207
void showAndLogErrorMessage(`Database upgrade failed: ${e}`);

0 commit comments

Comments
 (0)