@pi-r/mysql 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/index.js +6 -6
- package/package.json +1 -1
package/client/index.js
CHANGED
|
@@ -323,16 +323,16 @@ async function executeBatchQuery(batch, options = '', outResult) {
|
|
|
323
323
|
mysqlClient = undefined;
|
|
324
324
|
}
|
|
325
325
|
commandType = this.commandType.SELECT;
|
|
326
|
-
|
|
326
|
+
const [rows] = await client.query(query, params);
|
|
327
327
|
this.add(item, 4 /* DB_TRANSACTION.COMMIT */);
|
|
328
328
|
if ((0, types_1.isArray)(rows)) {
|
|
329
|
-
|
|
330
|
-
|
|
329
|
+
const [row1, row2] = rows;
|
|
330
|
+
if (rows.length === 2 && Array.isArray(row1) && !Array.isArray(row2) && isResultSetHeader(row2)) {
|
|
331
|
+
resolve(row1);
|
|
331
332
|
}
|
|
332
|
-
else
|
|
333
|
-
rows
|
|
333
|
+
else {
|
|
334
|
+
resolve(!isResultSetHeader(row1) ? this.setQueryResult(source, removePoolProperties(credential), queryString, rows, cacheValue) : null);
|
|
334
335
|
}
|
|
335
|
-
resolve(rows.length ? this.setQueryResult(source, removePoolProperties(credential), queryString, rows, cacheValue) : null);
|
|
336
336
|
}
|
|
337
337
|
else {
|
|
338
338
|
resolve(null);
|