Browse Source

fix(nocodb): mark CallExpression on pt.right for division

pull/4543/head
Wing-Kam Wong 2 years ago
parent
commit
2500219d1c
  1. 5
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/formulaQueryBuilderFromString.ts
  2. 5
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/formulav2/formulaQueryBuilderv2.ts

5
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/formulaQueryBuilderFromString.ts

@ -136,6 +136,11 @@ export default function formulaQueryBuilder(
type: 'CallExpression', type: 'CallExpression',
arguments: [pt.left], arguments: [pt.left],
}; };
pt.right = {
callee: { name: 'FLOAT' },
type: 'CallExpression',
arguments: [pt.right],
};
} }
const query = knex.raw( const query = knex.raw(

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

@ -646,6 +646,11 @@ export default async function formulaQueryBuilderv2(
type: 'CallExpression', type: 'CallExpression',
arguments: [pt.left], arguments: [pt.left],
}; };
pt.right = {
callee: { name: 'FLOAT' },
type: 'CallExpression',
arguments: [pt.right],
};
} }
pt.left.fnName = pt.left.fnName || 'ARITH'; pt.left.fnName = pt.left.fnName || 'ARITH';
pt.right.fnName = pt.right.fnName || 'ARITH'; pt.right.fnName = pt.right.fnName || 'ARITH';

Loading…
Cancel
Save