question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PANIC: Unknown column type 243 in /root/.cargo/registry/src/github.com-1ecc6299db9ec823/mysql_common-0.26.0/src/constants.rs:498:18

See original GitHub issue

Hi Prisma Team! My Prisma Client just crashed. This is the report:

Versions

Name Version
Node v16.11.1
OS debian-openssl-1.1.x
Prisma Client 3.5.0
Query Engine 0.1.0
Database mysql

Logs

  prisma:tryLoadEnv Environment variables loaded from /home/kaveh/projects/microservice/gensec-grpc/.env  
  prisma:tryLoadEnv Environment variables loaded from /home/kaveh/projects/microservice/gensec-grpc/.env  
  prisma:client clientVersion: 3.5.0  
  prisma:client:libraryEngine internalSetup  
  prisma:client:libraryEngine Search for Query Engine Library in /home/kaveh/projects/microservice/gensec-grpc/node_modules/.prisma/client  
  prisma:client:libraryEngine loadEngine using /home/kaveh/projects/microservice/gensec-grpc/node_modules/.prisma/client/libquery_engine-debian-openssl-1.1.x.so.node  
  prisma:client prisma.queryRaw(select fncIsPermitted(?,?) as isPermitted;, [2,1])  +5s
  prisma:client Prisma Client call:  
  prisma:client:libraryEngine sending request, this.libraryStarted: false  +5s
  prisma:client:libraryEngine library starting  
  prisma:client:libraryEngine library started  

Client Snippet

// PLEASE FILL YOUR CODE SNIPPET HERE

Schema

// PLEASE ADD YOUR SCHEMA HERE IF POSSIBLE

Prisma Engine Query

{"X":{}}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Luke-zhang-04commented, Dec 12, 2021

Hi there, thanks for the work on this amazing library! I’m facing the same issue, and I’ve found that casting the value somehow fixes it (see below).

Possibly related: https://github.com/blackbeam/rust-mysql-simple/issues/273 - exact same error

The query engine version seems to be consistent across Prisma ~3.0.0 and ~3.6.0, which is probably the Issue. I can open an issue in the engines repo instead if needed.

Versions

Name Version
Node v16.8.0
OS linux-arm-openssl-1.1.x and linux-arm64-openssl-1.1.x
Prisma Client 3.0.2 and 3.6.0
Query Engine 0.1.0
Database mysql

Logs

5;172;1mprisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:fetcher No User found  +3s
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  
  prisma:client prisma.queryRaw(
  prisma:client             select username
  prisma:client             from user
  prisma:client             where
  prisma:client                 username like ?
  prisma:client                 or levenshtein(username, ?) between 0 and 2;, ["\"%test 3%\"","'test 3'"])  +6s
  prisma:client Prisma Client call:  
  prisma:client:libraryEngine sending request, this.libraryStarted: true  

Client Snippet

// Does not work:
        const users = await db.$queryRaw`
            select username
            from user
            where
                username like ${"%" + search + "%"}
                or levenshtein(username, ${search}) between 0 and 2;`

// Works:
        const users = await db.$queryRaw`
            select username
            from user
            where
                username like ${"%" + search + "%"}
                or levenshtein(cast(username as char(255)), cast(${search} as char(255))) between 0 and 2;`

Levenshtein function:

CREATE FUNCTION levenshtein( s1 VARCHAR(255), s2 VARCHAR(255) )
    RETURNS INT
    DETERMINISTIC
    BEGIN
etc.

Schema

model User {
  uid        String   @id @unique @db.Char(36)
  email      String   @unique @db.VarChar(256)
  username   String   @db.VarChar(32)
  theme      Theme    @default(Light)
  lastActive DateTime @default(now()) @db.Timestamp(0)

  @@map("user")
}

Prisma Engine Query

{"X":{}}
0reactions
Weakkycommented, Jul 5, 2022

That’s good news, awesome, thanks for letting us know! 🙏

I’m gonna close indeed, thanks for reporting 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found