Skip to content

Commit

Permalink
fix: PoolConnection leaked by MysqlDriver (#8803)
Browse files Browse the repository at this point in the history
  • Loading branch information
pleerock committed Mar 26, 2022
1 parent 0494008 commit d2cfd22
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/driver/mysql/MysqlDriver.ts
Expand Up @@ -397,10 +397,12 @@ export class MysqlDriver implements Driver {
await queryRunner.release()
}

const result = (await this.createQueryRunner("master").query(
`SELECT VERSION() AS \`version\``,
)) as { version: string }[]
const queryRunner = this.createQueryRunner("master")
const result: {
version: string
}[] = await queryRunner.query(`SELECT VERSION() AS \`version\``)
const dbVersion = result[0].version
await queryRunner.release()

if (this.options.type === "mariadb") {
if (VersionUtils.isGreaterOrEqual(dbVersion, "10.0.5")) {
Expand Down

0 comments on commit d2cfd22

Please sign in to comment.