diff --git a/extensions/ql-vscode/CHANGELOG.md b/extensions/ql-vscode/CHANGELOG.md index 70d73a96037..6667433dffe 100644 --- a/extensions/ql-vscode/CHANGELOG.md +++ b/extensions/ql-vscode/CHANGELOG.md @@ -3,8 +3,8 @@ ## [UNRELEASED] - Remove ability to download databases from LGTM. [#1467](https://github.com/github/vscode-codeql/pull/1467) -- 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) +- 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) +- 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) ## 1.6.12 - 1 September 2022 @@ -20,7 +20,7 @@ No user facing changes. No user facing changes. -## 1.6.9 - 20 July 2022 +## 1.6.9 - 20 July 2022 No user facing changes. diff --git a/extensions/ql-vscode/src/upgrades.ts b/extensions/ql-vscode/src/upgrades.ts index a7427c10abc..7ef3867f0f4 100644 --- a/extensions/ql-vscode/src/upgrades.ts +++ b/extensions/ql-vscode/src/upgrades.ts @@ -194,7 +194,14 @@ export async function upgradeDatabaseExplicit( void qs.logger.log('Running the following database upgrade:'); getUpgradeDescriptions(compileUpgradeResult.compiledUpgrades).map(s => s.description).join('\n'); - return await runDatabaseUpgrade(qs, dbItem, compileUpgradeResult.compiledUpgrades, progress, token); + const result = await runDatabaseUpgrade(qs, dbItem, compileUpgradeResult.compiledUpgrades, progress, token); + + // TODO Can remove the next lines when https://github.com/github/codeql-team/issues/1241 is fixed + // restart the query server to avoid a bug in the CLI where the upgrade is applied, but the old dbscheme + // is still cached in memory. + + await qs.restartQueryServer(progress, token); + return result; } catch (e) { void showAndLogErrorMessage(`Database upgrade failed: ${e}`);