badmfck-api-server 3.5.8 → 3.6.0

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.
@@ -95,7 +95,7 @@ async function Initializer(services) {
95
95
  exports.Initializer = Initializer;
96
96
  class APIService extends BaseService_1.BaseService {
97
97
  static nextLogID = 0;
98
- version = "3.5.6";
98
+ version = "3.6.0";
99
99
  options;
100
100
  monitor = null;
101
101
  started = new Date();
@@ -177,7 +177,7 @@ class MysqlAdapter {
177
177
  const trxid = MysqlAdapter.nextTransactionID++;
178
178
  if (this.options.debug)
179
179
  (0, LogService_1.logDB)("Begin transaction with id ", trxid);
180
- const result = await this.query({ query: "START TRANSACTIONS" }, conn);
180
+ const result = await this.query({ query: "START TRANSACTION" }, conn);
181
181
  const trxRequest = {
182
182
  id: trxid,
183
183
  timestamp: Date.now(),
@@ -185,6 +185,7 @@ class MysqlAdapter {
185
185
  queries: []
186
186
  };
187
187
  if (result.error) {
188
+ (0, LogService_1.logCrit)("Can't start transaction! " + result.error.message);
188
189
  trxRequest.queries.push({ sql: "START TRANSACTION", status: "error" });
189
190
  this.rollbackTransaction(trxRequest);
190
191
  return result;
@@ -460,7 +461,7 @@ class MysqlAdapter {
460
461
  continue;
461
462
  if (!f.useInReplace)
462
463
  continue;
463
- onDuplicate.push('`' + f.name + f.__parsedValue);
464
+ onDuplicate.push('`' + f.name + '` = ' + f.__parsedValue);
464
465
  }
465
466
  query = query.replaceAll("@onduplicate", onDuplicate.join(" , "));
466
467
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "badmfck-api-server",
3
- "version": "3.5.8",
3
+ "version": "3.6.0",
4
4
  "description": "Simple API http server based on express",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",