Browse Source

fix(nocodb): wrap the second argument in formula RIGHT

pull/4351/head
Wing-Kam Wong 2 years ago
parent
commit
aac0ce28c2
  1. 4
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/functionMappings/mysql.ts

4
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/functionMappings/mysql.ts

@ -28,9 +28,9 @@ const mysql2 = {
}, },
RIGHT: (args: MapFnArgs) => { RIGHT: (args: MapFnArgs) => {
return args.knex.raw( return args.knex.raw(
`SUBSTR(${args.fn(args.pt.arguments[0])},-${args.fn( `SUBSTR(${args.fn(args.pt.arguments[0])}, -(${args.fn(
args.pt.arguments[1] args.pt.arguments[1]
)})${args.colAlias}` )}))${args.colAlias}`
); );
}, },
MID: 'SUBSTR', MID: 'SUBSTR',

Loading…
Cancel
Save