From 6db391d8c86ba9555403aad5b2bd9551f3db48e5 Mon Sep 17 00:00:00 2001 From: Simon Leipold <s.leipold@adito.de> Date: Fri, 28 May 2021 14:53:02 +0200 Subject: [PATCH] [Projekt: Entwicklung - Neon][TicketNr.: 1081133][SqlBuilder newWhere mit bringt Fehler bei db.quote] --- process/Sql_lib/process.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/process/Sql_lib/process.js b/process/Sql_lib/process.js index 383117664cc..e7a2d4b4300 100644 --- a/process/Sql_lib/process.js +++ b/process/Sql_lib/process.js @@ -4497,10 +4497,11 @@ SqlUtils.getResolvingCaseWhenFromObject = function(pKeyValueObject, pUid, pTrans * Will quote all prepared statement values from the given statement. * * @param {PreparedSqlArray} pStatement Same as first paraemter of db.translateStatement. + * @param {String} pAlias The database alias * @param {Callback} pExecutionCallback (PreparedSqlArray) => String A function which must return the final SQL. * @return The SQL, same as the result of db.translateStatement. */ -SqlUtils.translateWithQuotes = function(pStatement, pExecutionCallback) +SqlUtils.translateWithQuotes = function(pStatement, pAlias, pExecutionCallback) { // Validate type of incoming paramter. if (!Array.isArray(pStatement)) @@ -4518,7 +4519,7 @@ SqlUtils.translateWithQuotes = function(pStatement, pExecutionCallback) return pValue; // As the first element represents the value it will be quoted here. - return [db.quote(pValue[0]), pValue[1]]; + return [db.quote(pValue[0], pAlias), pValue[1]]; }); return pExecutionCallback([pStatement[0], preparedStatements]); @@ -4533,7 +4534,7 @@ SqlUtils.translateWithQuotes = function(pStatement, pExecutionCallback) */ SqlUtils.translateStatementWithQuotes = function(pStatement, pAlias) { - return SqlUtils.translateWithQuotes(pStatement, function(pValue) + return SqlUtils.translateWithQuotes(pStatement, pAlias, function(pValue) { if (pAlias) return db.translateStatement(pValue, pAlias) @@ -4551,7 +4552,7 @@ SqlUtils.translateStatementWithQuotes = function(pStatement, pAlias) */ SqlUtils.translateConditionWithQuotes = function(pStatement, pAlias) { - return SqlUtils.translateWithQuotes(pStatement, function(pValue) + return SqlUtils.translateWithQuotes(pStatement, pAlias, function(pValue) { if (pAlias) return db.translateCondition(pValue, pAlias) -- GitLab