badmfck-api-server 2.8.1 → 2.8.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -155,6 +155,12 @@ class MysqlAdapter {
|
|
155
155
|
}
|
156
156
|
async query(request) {
|
157
157
|
const query = this.prepareQuery(request);
|
158
|
+
if (request.parseQueryOnly) {
|
159
|
+
return {
|
160
|
+
data: [{ query }],
|
161
|
+
error: null,
|
162
|
+
};
|
163
|
+
}
|
158
164
|
if (!this.pool) {
|
159
165
|
(0, LogService_1.logError)("${MysqlAdapter.js}", "No pool created, can't execute query");
|
160
166
|
const error = {
|
@@ -263,13 +269,13 @@ class MysqlAdapter {
|
|
263
269
|
for (let i in fields) {
|
264
270
|
const name = i;
|
265
271
|
const value = fields[i];
|
266
|
-
if (typeof value === "string")
|
272
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean")
|
267
273
|
fields[i] = { value: value, system: false };
|
268
274
|
if (value === undefined)
|
269
275
|
continue;
|
270
276
|
if (value === null)
|
271
277
|
fields[i] = { value: null, system: true };
|
272
|
-
const parsed = MysqlAdapter.prepareQueryFieldValue(
|
278
|
+
const parsed = MysqlAdapter.prepareQueryFieldValue(fields[i]);
|
273
279
|
query = query.replaceAll("@" + name, parsed + "");
|
274
280
|
}
|
275
281
|
}
|