Hello and thanks for the awesome work 🙏
Bug description
A field named dataName in the database is a tinyint unsigned with only values such as 0 and 1
When trying to query this table:
prisma.myTable.findOne({
where: {
id: 666,
},
});
this error occurs:
Attempted to serialize scalar 'false' with incompatible type 'Int'
If you don't select the dataName field, there is no error:
prisma.myTable.findOne({
where: {
id: 666,
},
select: {
id: true,
dataName: false,
}
});
Introspecting and querying with 2.7.1 works flawlessly
Expected behavior
No bug 😄
Prisma information
Versions
Starting form 2.8.0
Schema
model myTable {
id Int @id @default(autoincrement())
dataName Int @default(0)
}
Client debug output
prisma-client Prisma Client call: +27ms
prisma-client prisma.myTable.findOne({
prisma-client where: {
prisma-client id: 666
prisma-client }
prisma-client }) +0ms
prisma-client Generated request: +0ms
prisma-client query {
prisma-client findOnemyTable(where: {
prisma-client id: 666
prisma-client }) {
prisma-client id
prisma-client dataName
prisma-client }
prisma-client }
prisma-client +0ms
engine {
engine error: zf [Error]: Attempted to serialize scalar 'false' with incompatible type 'Int'
engine at yw.graphQLToJSError (xxx/node_modules/@prisma/client/runtime/index.js:129:4637)
engine at xxx/node_modules/@prisma/client/runtime/index.js:129:2977
engine at processTicksAndRejections (internal/process/task_queues.js:97:5) {
engine clientVersion: '2.9.0'
engine }
engine } +257ms
prisma-client Error: Attempted to serialize scalar 'false' with incompatible type 'Int'
prisma-client at yw.graphQLToJSError (xxx/node_modules/@prisma/client/runtime/index.js:129:4637)
prisma-client at xxx/node_modules/@prisma/client/runtime/index.js:129:2977
Environment & setup
- OS : Mac OS
- Database: MySQL 8
- Node.js version: 12.18.3
- Prisma Version: starting from 2.8.0 to 2.9.0
Here is the output from prisma -v
@prisma/cli : 2.9.0
@prisma/client : Not found
Current platform : darwin
Query Engine : query-engine 369b3694b7edb869fad14827a33ad3f3f49bbc20 (at ../../.nvm/versions/node/v12.18.3/lib/node_modules/@prisma/cli/query-engine-darwin)
Migration Engine : migration-engine-cli 369b3694b7edb869fad14827a33ad3f3f49bbc20 (at ../../.nvm/versions/node/v12.18.3/lib/node_modules/@prisma/cli/migration-engine-darwin)
Introspection Engine : introspection-core 369b3694b7edb869fad14827a33ad3f3f49bbc20 (at ../../.nvm/versions/node/v12.18.3/lib/node_modules/@prisma/cli/introspection-engine-darwin)
Format Binary : prisma-fmt 369b3694b7edb869fad14827a33ad3f3f49bbc20 (at ../../.nvm/versions/node/v12.18.3/lib/node_modules/@prisma/cli/prisma-fmt-darwin)
Studio : 0.296.0
- Prisma client version installed in the project: 2.9.0
Summary
Prisma version: 2.9.0
Database type: MySLQ 8
Name of the table: myTable
Name of the field: dataName
Type of the field: tinyint unsigned
All the values in the field are either 0 or 1
Used to work with 2.7.1
Failing query:
prisma.myTable.findOne({
where: {
id: 666,
},
});
Error:
Attempted to serialize scalar 'false' with incompatible type 'Int'
Succeeding query:
prisma.myTable.findOne({
where: {
id: 666,
},
select: {
id: true,
dataName: false,
}
});
Hello and thanks for the awesome work 🙏
Bug description
A field named
dataNamein the database is atinyint unsignedwith only values such as0and1When trying to query this table:
this error occurs:
If you don't select the
dataNamefield, there is no error:Introspecting and querying with
2.7.1works flawlesslyExpected behavior
No bug 😄
Prisma information
Versions
Starting form 2.8.0
Schema
Client debug output
Environment & setup
Here is the output from
prisma -vSummary
Prisma version:
2.9.0Database type:
MySLQ 8Name of the table:
myTableName of the field:
dataNameType of the field:
tinyint unsignedAll the values in the field are either
0or1Used to work with
2.7.1Failing query:
Error:
Succeeding query: