Skip to content

v4.43.0 broke delete flag handling #10600

Closed

Description

@PaddyMann

What are you doing?

After upgrading to 4.43.0 (from 4.42.0), we can see the following SQL being produced:

UPDATE `Response` SET `deleted`='true',`updatedBy`=24751,`updatedAt`=NOW() WHERE `id` = 416695 AND `deleted` = 'false'

Note that deleted is being correctly to a string. This leads to the following error:

Error Code: 1292. Truncated incorrect DOUBLE value: 'false'

This code being used is:

await Response.update(
  {
    deleted: true,
  },
  {
    where: {id: existingResponse.id},
    ...context,
  }
);

The column is defined in the model as:

deleted: {
  type: DataTypes.TINYINT,
},

Reverting to 4.42.0 fixes the issue.

What do you expect to happen?

The latest version of Sequelize 4 should not convert my deleted booleans to strings.

What is actually happening?

The latest version of Sequelize 4 is converting my deleted booleans to strings.

Dialect: mysql
Database version: 5.7.23
Sequelize version: 4.43.0
Tested with latest release: Yes (of Sequelize 4)

Activity

  1. SimonSchick commented on Mar 22, 2019

    @SimonSchick
    Contributor

    Apparently #10496 broke this?

  2. SimonSchick commented on Mar 23, 2019

    @SimonSchick
    Contributor

    Please provide a full repro.

  3. added a commit that references this issue on Mar 28, 2019
    3e94ac2
  4. gabegorelick commented on Mar 28, 2019

    @gabegorelick
    Contributor

    Sorry about that.

    Note that deleted is being correctly to a string

    The issue is that it should not be converted to the string 'false'. Instead it should be the literal FALSE (or 0).

    #10644 should fix this. It will need to be backported to v4 once it's merged, but I'm happy to do that.

  5. sushantdhiman commented on Mar 29, 2019

    @sushantdhiman
    Contributor

    🎉 This issue has been resolved in version 5.2.4 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

  6. added a commit that references this issue on Mar 30, 2019
    58870ad
  7. sushantdhiman commented on Mar 30, 2019

    @sushantdhiman
    Contributor

    🎉 This issue has been resolved in version 4.43.1 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

  8. PaddyMann commented on Apr 1, 2019

    @PaddyMann
    Author

    Awesome — thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions