Skip to content

Commit

Permalink
Merge pull request #48 from RunOnFlux/development
Browse files Browse the repository at this point in the history
enable set session
  • Loading branch information
alihm authored Aug 13, 2023
2 parents b8f5178 + 6fe6329 commit e1813a2
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions ClusterOperator/Backlog.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,10 @@ class BackLog {
if (Array.isArray(BLResult) && BLResult[2]) {
log.error(`Error in SQL: ${JSON.stringify(BLResult[2])}`);
} else {
let setSession = false;
if (query.toLowerCase().startsWith('create')) {
setSession = false;
}
if (connId === false) {
if (setSession) await this.UserDBClient.query("SET SESSION sql_mode='IGNORE_SPACE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'", false, fullQuery);
if (query.toLowerCase().startsWith('create')) await this.UserDBClient.query("SET SESSION sql_mode='IGNORE_SPACE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'", false, fullQuery);
result = await this.UserDBClient.query(query, false, fullQuery);
} else if (connId >= 0) {
if (setSession) await ConnectionPool.getConnectionById(connId).query("SET SESSION sql_mode='IGNORE_SPACE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'", false, fullQuery);
result = await ConnectionPool.getConnectionById(connId).query(query, false, fullQuery);
}
if (Array.isArray(result) && result[2]) {
Expand Down Expand Up @@ -242,7 +237,6 @@ class BackLog {
}
try {
if (config.dbType === 'mysql') {

const record = await this.BLClient.query(`SELECT * FROM ${config.dbBacklogCollection} WHERE seq=${index}`);
// log.info(`backlog records ${startFrom},${pageSize}:${JSON.stringify(totalRecords)}`);
return record;
Expand Down

0 comments on commit e1813a2

Please sign in to comment.