Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Error when executing findMany query #550

Closed
esistgut opened this issue Mar 2, 2020 · 4 comments · Fixed by prisma/prisma-engines#1072
Closed

Error when executing findMany query #550

esistgut opened this issue Mar 2, 2020 · 4 comments · Fixed by prisma/prisma-engines#1072
Assignees
Labels
bug/2-confirmed We have confirmed that this is a bug. engines/query engine Issue in the query engine kind/bug A reported bug. tech/engines Issue for tech Engines. topic: broken query
Milestone

Comments

@esistgut
Copy link

esistgut commented Mar 2, 2020

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.

@esistgut esistgut changed the title Issue when executing findMany query Error when executing findMany query Mar 2, 2020
@esistgut
Copy link
Author

esistgut commented Mar 3, 2020

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

@pantharshit00
Copy link
Contributor

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.

@pantharshit00 pantharshit00 transferred this issue from prisma/prisma Mar 5, 2020
@pantharshit00 pantharshit00 added bug/2-confirmed We have confirmed that this is a bug. kind/bug A reported bug. labels Mar 5, 2020
@stale stale bot added the status/needs-action Issue has no activity for a long time, needs some action. label Jul 25, 2020
@hatchli
Copy link

hatchli commented Aug 2, 2020

Is there any way around this at the moment?

@stale stale bot removed the status/needs-action Issue has no activity for a long time, needs some action. label Aug 2, 2020
@janpio janpio added the process/candidate Candidate for next Milestone. label Aug 3, 2020
@mavilein mavilein added tech/engines Issue for tech Engines. engines/query engine Issue in the query engine labels Aug 5, 2020
@janpio janpio added this to the Backlog 2.5.0 milestone Aug 5, 2020
@janpio janpio added topic: broken query and removed process/candidate Candidate for next Milestone. labels Aug 5, 2020
@janpio janpio modified the milestones: Milestone 2.5.0, Backlog 2.6.0 Aug 18, 2020
@mavilein
Copy link
Member

Might be the same as: prisma/prisma#3078

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug/2-confirmed We have confirmed that this is a bug. engines/query engine Issue in the query engine kind/bug A reported bug. tech/engines Issue for tech Engines. topic: broken query
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants