Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug: Formula field: miscellaneous observations #4768

Closed
3 tasks done
dstala opened this issue Jan 7, 2023 · 4 comments
Closed
3 tasks done

🐛 Bug: Formula field: miscellaneous observations #4768

dstala opened this issue Jan 7, 2023 · 4 comments
Assignees
Labels
🐛 Type: Bug Something is broken or incorrect unexpectedly.

Comments

@dstala
Copy link
Member

dstala commented Jan 7, 2023

Please confirm if bug report does NOT exists already ?

  • I confirm there is no existing issue for this

Steps to reproduce ?

  • MOD(({number} / 10), 2) : no data gets loaded in column; number field was of datatype number
error: select MOD((CAST("number" as DOUBLE PRECISION)) / (CAST(10 as DOUBLE PRECISION)) ,2) as "formula", "nc_k6bn___Sheet-1"."id" as "Id", "nc_k6bn___Sheet-1"."created_at" as "CreatedAt", "nc_k6bn___Sheet-1"."updated_at" as "UpdatedAt", "nc_k6bn___Sheet-1"."number" as "number" from "nc_k6bn___Sheet-1" order by "id" asc limit 25 - function mod(double precision, integer) does not exist
    at Parser.parseErrorMessage (/Users/rajuudava/NocoDB/nocodb/packages/nocodb/node_modules/pg-protocol/src/parser.ts:369:69)
    at Parser.handlePacket (/Users/rajuudava/NocoDB/nocodb/packages/nocodb/node_modules/pg-protocol/src/parser.ts:188:21)
    at Parser.parse (/Users/rajuudava/NocoDB/nocodb/packages/nocodb/node_modules/pg-protocol/src/parser.ts:103:30)
    at Socket.<anonymous> (/Users/rajuudava/NocoDB/nocodb/packages/nocodb/node_modules/pg-protocol/src/index.ts:7:48)
    at Socket.emit (node:events:520:28)
    at Socket.emit (node:domain:475:12)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at Socket.Readable.push (node:internal/streams/readable:228:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23) {
  length: 222,
  severity: 'ERROR',
  code: '42883',
  detail: undefined,
  hint: 'No function matches the given name and argument types. You might need to add explicit type casts.',
  position: '8',
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'parse_func.c',
  line: '523',
  routine: 'ParseFuncOrColumn'
}
dataList :: InternalServerError: Internal Server Error, check server log for more details
    at Function.internalServerError (/Users/rajuudava/NocoDB/nocodb/packages/nocodb/src/lib/meta/helpers/catchError.ts:50:11)
    at getDataList (/Users/rajuudava/NocoDB/nocodb/packages/nocodb/src/lib/meta/api/dataApis/dataAliasApis.ts:128:13)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at dataList (/Users/rajuudava/NocoDB/nocodb/packages/nocodb/src/lib/meta/api/dataApis/dataAliasApis.ts:17:12)
    at /Users/rajuudava/NocoDB/nocodb/packages/nocodb/src/lib/meta/helpers/catchError.ts:6:14
  • Use of - in column name leads to error during formula creation
    similar observation when using a + in column name. didn't try for other symbols.
    Screenshot 2023-01-07 at 2 35 43 PM

Desired Behavior

Work as expected

Project Details

Node: v16.14.0
Arch: arm64
Platform: darwin
Docker: false
RootDB: pg
PackageVersion: 0.101.0-beta.0

Attachements

No response

@dstala dstala added the 🐛 Type: Bug Something is broken or incorrect unexpectedly. label Jan 7, 2023
@wingkwong wingkwong added this to the Next Release: 0.101.0 milestone Jan 7, 2023
@sptv2reg
Copy link

sptv2reg commented Jan 8, 2023

I'm not sure if this is related but with the latest version I've started to receive errors like this:

image

This is the formula that I'm using:

IF(OR((LEN(CONCAT({SearchConf}, "-")) == 1), ({SearchConf} == {LastSearchConf})), "1", "0")

The whole system is actually broken because of this. The rows are not shown any longer (they will reappear if I delete the formula field).

@wingkwong
Copy link
Member

@sptv2reg Please provide the following info.

  1. Your Project Info
  2. Column type for SearchConf and LastSearchConf
  3. Sample data for SearchConf and LastSearchConf

@sptv2reg
Copy link

sptv2reg commented Jan 8, 2023

Sorry, was actually looking for some version info but couldn't find it. Thanks for guide:

Node: **v18.12.1**
Arch: **x64**
Platform: **linux**
Docker: **true**
RootDB: **pg**
PackageVersion: **0.101.0-beta.0**

SearchConf is LongText
LastSearchConf = SingleLineText

SampleData - attached

test_data_csv.csv

Update: Even a simple formula like this one will trigger the error:

IF(OR((1 == 1), (2 == 2)), true, false)

@wingkwong wingkwong added 👀 Status: In Review The PR is currently being verified. 🚀 Status: Ready for Next Release and removed 👀 Status: In Review The PR is currently being verified. labels Jan 11, 2023
@github-actions
Copy link
Contributor

Fixed in v0.101.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Type: Bug Something is broken or incorrect unexpectedly.
Projects
Development

No branches or pull requests

3 participants