Browse Source

fix(nocodb): escape ? for raw sql query

pull/5221/head
Wing-Kam Wong 2 years ago
parent
commit
95ac2fe825
  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