You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ORM executes invalid SELECT query after upsertMany to table with a composite primary key. It works fine with upsert.
It seems problem is in additional non-primary column in table. It works if I remove createdAt column.
Stack trace
DriverException: select `u0`.`user_id`, `u0`.`action`, `u0`.`created_at` from `user_actions` as `u0` where (`u0`.`user_id`, `u0`.`action`) is null - Operand should contain 1 column(s)
at MySqlExceptionConverter.convertException (node_modules/@mikro-orm/core/platforms/ExceptionConverter.js:8:16)
at MySqlExceptionConverter.convertException (node_modules/@mikro-orm/mysql/MySqlExceptionConverter.js:80:22)
at MySqlDriver.convertException (node_modules/@mikro-orm/core/drivers/DatabaseDriver.js:201:54)
at node_modules/@mikro-orm/core/drivers/DatabaseDriver.js:205:24
at SqlEntityManager.upsertMany (node_modules/@mikro-orm/core/EntityManager.js:690:27)
at Object.<anonymous> (json.test.ts:56:18)
previous Error: select `u0`.`user_id`, `u0`.`action`, `u0`.`created_at` from `user_actions` as `u0` where (`u0`.`user_id`, `u0`.`action`) is null - Operand should contain 1 column(s)
at Packet.asError (node_modules/mysql2/lib/packets/packet.js:728:17)
at Query.execute (node_modules/mysql2/lib/commands/command.js:29:26)
at Connection.handlePacket (node_modules/mysql2/lib/connection.js:478:34)
at PacketParser.onPacket (node_modules/mysql2/lib/connection.js:97:12)
at PacketParser.executeStart (node_modules/mysql2/lib/packet_parser.js:75:16)
at Socket.<anonymous> (node_modules/mysql2/lib/connection.js:104:25)
Describe the bug
ORM executes invalid
SELECT
query afterupsertMany
to table with a composite primary key. It works fine withupsert
.It seems problem is in additional non-primary column in table. It works if I remove
createdAt
column.Stack trace
To Reproduce
Versions
The text was updated successfully, but these errors were encountered: