Prisma-client-js: Error when executing findMany query

Created on 2 Mar 2020  Â·  4Comments  Â·  Source: prisma/prisma-client-js

I created a minimal sample showing the error: https://github.com/esistgut/prisma-issue
To run the sample first execute npm i && npm run prismation. There are two functions: populate to create the required data and test to show the error. Please comment/uncomment as required (populate should only be run once).

The test should show the following error:
(MariaDB)

PrismaClientUnknownRequestError: 
Invalid `prisma.services.findMany()` invocation in
/home/esistgut/coding/typescript/prisma-test/index.ts:92:57

→  88 Error occurred during query execution:
ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(Server(ServerError { code: 1241, message: "Operand should contain 1 column(s)", state: "21000" })) })
    at PrismaClientFetcher.request (/home/esistgut/coding/typescript/prisma-test/node_modules/@prisma/client/index.js:89:17)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

(Sqlite)

PrismaClientUnknownRequestError: 
Invalid `prisma.services.findMany()` invocation in
/home/esistgut/coding/typescript/prisma-test/index.ts:92:57

→  88 Error occurred during query execution:
ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(SqliteFailure(Error { code: Unknown, extended_code: 1 }, Some("sub-select returns 4 columns - expected 1"))) })
    at PrismaClientFetcher.request (/home/esistgut/coding/typescript/prisma-test/node_modules/@prisma/client/index.js:89:17)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

This looks like a bug but I'm not really sure about it.

bu2-confirmed enginequery engine kinbug tecengines broken query

All 4 comments

I simplified my test after receiving some input on Slack. The error is still there.

Thanks for the reproduction. That was really helpful. I can also confirm this happens with preview023 as well.

Laying out reproduction steps here so that we can quickly go through them:

  1. Clone https://github.com/esistgut/prisma-issue
  2. Run npm install
  3. Run npm run prismation (This will run prisma2 migrate)
  4. Open index.ts and execute the populate method in main
  5. Run ts-node index.ts
  6. Now execute the test method in main function
  7. Run ts-node index.ts to reproduce.

Is there any way around this at the moment?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

divyenduz picture divyenduz  Â·  4Comments

timsuchanek picture timsuchanek  Â·  4Comments

AhmedElywa picture AhmedElywa  Â·  4Comments

divyenduz picture divyenduz  Â·  3Comments

pantharshit00 picture pantharshit00  Â·  4Comments