mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-04 14:38:50 +00:00
fix(execute): incorrect queryCount when sending single array
An array containing parameters, rather than arrays, is always a single query.
This commit is contained in:
1 parent
0537519c8a
commit
452d1ad5ee
1 file changed
+2
-1
@@ -11,11 +11,12 @@ export default async (invokingResource, query, parameters, cb) => {
|
|||||||
scheduleTick();
|
scheduleTick();
|
||||||
const connection = await pool.getConnection();
|
const connection = await pool.getConnection();
|
||||||
try {
|
try {
|
||||||
const queryCount = parameters.length;
|
let queryCount = parameters.length;
|
||||||
let results = [];
|
let results = [];
|
||||||
let executionTime = hrtime();
|
let executionTime = hrtime();
|
||||||
|
|
||||||
if (typeof parameters[0] !== 'object') {
|
if (typeof parameters[0] !== 'object') {
|
||||||
|
queryCount = 1
|
||||||
const [result] = await connection.execute(query, parameters);
|
const [result] = await connection.execute(query, parameters);
|
||||||
results[0] = response(type, result);
|
results[0] = response(type, result);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in new issue
Block a user