-
Notifications
You must be signed in to change notification settings - Fork 2.2k
adapter-mariadb select json field fail #28143
Copy link
Copy link
Closed
Labels
bug/1-unconfirmedBug should have enough information for reproduction, but confirmation has not happened yet.Bug should have enough information for reproduction, but confirmation has not happened yet.kind/bugA reported bug.A reported bug.topic: @prisma/adapter-mariadbtopic: JsonScalar type `Json`Scalar type `Json`topic: driverAdapterstopic: mariadbtopic: mysqltrackedThis issue is internally tracked by the Prisma Team on Linear.This issue is internally tracked by the Prisma Team on Linear.
Metadata
Metadata
Assignees
Labels
bug/1-unconfirmedBug should have enough information for reproduction, but confirmation has not happened yet.Bug should have enough information for reproduction, but confirmation has not happened yet.kind/bugA reported bug.A reported bug.topic: @prisma/adapter-mariadbtopic: JsonScalar type `Json`Scalar type `Json`topic: driverAdapterstopic: mariadbtopic: mysqltrackedThis issue is internally tracked by the Prisma Team on Linear.This issue is internally tracked by the Prisma Team on Linear.
Bug description
When using JSON fields from $queryRawUnsafe an error is returned:
"Unsupported column type: LONG_BLOB"
or
"Cannot serialize value of type object as Bytes"
Severity
Reproduction
schema extract
model test_json {
id Int @id @default(autoincrement()) @db.UnsignedInt
data Json? @db.Json
}
fill a row with json data
Code
prisma.$queryRawUnsafe("SELECT data FROM test_json")
Expected vs. Actual Behavior
return rows with json field as text (like with rust engine) (or json object).
Frequency
Consistently reproducible
Does this occur in development or production?
Only in development (e.g., CLI tools, migrations, Prisma Studio)
Is this a regression?
Works with rust engine.
Breaks with client engine and PrismaMariaDb adapter.
Workaround
Keep rust engine.
Prisma Schema & Queries
Prisma Config
// Add your `prisma.config.ts`Logs & Debug Info
Environment & Setup
Prisma Version
prisma@6.16.2