upsert fails on MSSQL with composite unique key #11240
Labels
dialect: mssql
For issues and PRs. Things that involve MSSQL (and do not involve all dialects).
type: bug
What are you doing?
upsert in MSSQL with composite unique key
To Reproduce
Steps to reproduce the behavior:
What do you expect to happen?
Unique key values specified must be used as where even if a key value is an empty string
What is actually happening?
Sequelize mssql dialect exclude unique keys value from where because one of the key values is an empty string.
This behaviour happens because empty string is evaluated falsy exactly at
sequelize/lib/dialects/mssql/query-generator.js
Line 442 in f3b5f99
Environment
Dialect:
Dialect tedious version: 5.0.3
Database version: SQL SERVER 2017 - 14.0.3045.24
Sequelize version: 4.44.2
Node Version: 8.11.2
OS: Linux
If TypeScript related: TypeScript version: XXX
Tested with latest release:
The text was updated successfully, but these errors were encountered: