Browse Source

fix(nocodb): cast char first before casting as double for FLOAT

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

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

@ -36,7 +36,7 @@ const mysql2 = {
MID: 'SUBSTR',
FLOAT: (args: MapFnArgs) => {
return args.knex
.raw(`CAST(${args.fn(args.pt.arguments[0])} as DOUBLE)${args.colAlias}`)
.raw(`CAST(CAST(${args.fn(args.pt.arguments[0])} as CHAR) AS DOUBLE)${args.colAlias}`)
.wrap('(', ')');
},
DATEADD: ({ fn, knex, pt, colAlias }: MapFnArgs) => {

Loading…
Cancel
Save