@pi-r/mariadb 0.2.3 → 0.2.4

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.
Files changed (2) hide show
  1. package/client/index.js +6 -6
  2. package/package.json +1 -1
package/client/index.js CHANGED
@@ -306,16 +306,16 @@ async function executeBatchQuery(batch, options = '', outResult) {
306
306
  }
307
307
  }
308
308
  else {
309
- let rows = await client.query(query, params);
309
+ const rows = await client.query(query, params);
310
310
  this.add(item, 4 /* DB_TRANSACTION.COMMIT */);
311
311
  if ((0, types_1.isArray)(rows)) {
312
- if (rows.length === 2 && Array.isArray(rows[0]) && !Array.isArray(rows[1]) && isOkPacket(rows[1])) {
313
- rows = rows[0];
312
+ const [row1, row2] = rows;
313
+ if (rows.length === 2 && Array.isArray(row1) && !Array.isArray(row2) && isOkPacket(row2)) {
314
+ resolve(row1);
314
315
  }
315
- else if (isOkPacket(rows[0])) {
316
- rows = [];
316
+ else {
317
+ resolve(!isOkPacket(row1) ? this.setQueryResult(source, removePoolProperties(credential), queryString, rows, cacheValue) : null);
317
318
  }
318
- resolve(rows.length ? this.setQueryResult(source, removePoolProperties(credential), queryString, rows, cacheValue) : null);
319
319
  }
320
320
  else {
321
321
  resolve(null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/mariadb",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "MariaDB client driver for E-mc.",
5
5
  "main": "client/index.js",
6
6
  "types": "client/index.d.ts",