mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-02 06:28:54 +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();
|
||||
const connection = await pool.getConnection();
|
||||
try {
|
||||
const queryCount = parameters.length;
|
||||
let queryCount = parameters.length;
|
||||
let results = [];
|
||||
let executionTime = hrtime();
|
||||
|
||||
if (typeof parameters[0] !== 'object') {
|
||||
queryCount = 1
|
||||
const [result] = await connection.execute(query, parameters);
|
||||
results[0] = response(type, result);
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user