-
-
Notifications
You must be signed in to change notification settings - Fork 641
Open
Description
Having this error. I've reduced it to the minimal expression.
CREATE TABLE `broken` (
`confidence` tinyint unsigned NOT NULL,
CONSTRAINT `confidence_percentage` CHECK(`broken`.`confidence` between ? and ?)
);
Error: Malformed communication packet.
at PromiseConnection.execute (/Users/qcho/Avature/code/nexus/node_modules/.pnpm/[email protected]/node_modules/mysql2/lib/promise/connection.js:47:22)
at Object.query (/Users/qcho/Avature/code/nexus/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:81019:40)
at mysqlPush (/Users/qcho/Avature/code/nexus/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:84244:22)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async Object.handler (/Users/qcho/Avature/code/nexus/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:93782:9)
at async run (/Users/qcho/Avature/code/nexus/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:93059:7) {
code: 'ER_MALFORMED_PACKET',
errno: 1835,
sql: 'CREATE TABLE `broken` (\n' +
'\t`confidence` tinyint unsigned NOT NULL,\n' +
'\tCONSTRAINT `confidence_percentage` CHECK(`broken`.`confidence` between ? and ?)\n' +
');\n',
sqlState: 'HY000',
sqlMessage: 'Malformed communication packet.'
}
The problem is with the confidence_percentage
constraint. If I remove this i works just fine.
- DrizzleORM source code for the record:
export const brokenTable = mysqlTable(
"broken",
{
confidence: tinyint({ unsigned: true }).notNull()
},
(t) => [
check("confidence_percentage", between(t.confidence, 0, 100)),
],
)
- Mysql query works just fine:
CREATE TABLE `broken` (
`confidence` tinyint unsigned NOT NULL,
CONSTRAINT `confidence_percentage` CHECK(`broken`.`confidence` between 0 and 10)
);
Metadata
Metadata
Assignees
Labels
No labels