Browse Source

Merge pull request #5221 from nocodb/fix/concat-formula

fix(nocodb): escape ? for raw sql query
pull/5223/head
Raju Udava 2 years ago committed by GitHub
parent
commit
bbd1009017
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/formulav2/formulaQueryBuilderv2.ts

2
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/formulav2/formulaQueryBuilderv2.ts

@ -753,7 +753,7 @@ async function _formulaQueryBuilder(
sql = `${sql} ${colAlias}`;
}
}
const query = knex.raw(sql);
const query = knex.raw(sql.replace(/\?/g, '\\?'));
if (prevBinaryOp && pt.operator !== prevBinaryOp) {
query.wrap('(', ')');
}

Loading…
Cancel
Save