From d0f14fecfc9e0c2ac7bbceb706c13032d4ab23ec Mon Sep 17 00:00:00 2001 From: Charlie Moog Date: Sat, 26 Mar 2022 09:51:28 -0500 Subject: [PATCH] fix: mysql driver logic for multiple query rendering --- package.json | 2 +- src/driver.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 295c965..a0ac7d0 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "repository": { "url": "https://github.com/cmoog/vscode-sql-notebook" }, - "version": "0.5.0", + "version": "0.5.1", "preview": false, "engines": { "vscode": "^1.59.0" diff --git a/src/driver.ts b/src/driver.ts index b2df8a3..4fe7012 100644 --- a/src/driver.ts +++ b/src/driver.ts @@ -112,8 +112,9 @@ function mysqlConn(conn: mysql.PoolConnection, queryTimeout: number): Conn { return [[result]]; } - // this reliably indicates whether there are results for multiple distinct queries - const hasMultipleResults = ok.length > 1; + // this indicates whether there are results for multiple distinct queries + const hasMultipleResults = + ok.length > 1 && ok.some((a: any) => a?.length); if (hasMultipleResults) { // when we have `ResultSetHeader`, which is the result of an exec request, // we want to nest that into an array so that is display as a single row table