Skip to content

Conversation

@mpalmerlee
Copy link

Description of change

Duplicate change as typeorm#10443 except this is branched off of the commit tied to the latest typeorm release at the time of this PR's creation 0.3.17

Changes behavior of getWherePredicateCondition and buildWhere methods to match the behavior in typeorm 0.2, which is to apply an IsNull() condition to null values and not ignore undefined values so that when passing undefined queries do not return any data (null or []) rather than excluding that condition which is a vector for security issues.

Closes: typeorm#9316

BREAKING CHANGE: passing an undefined value in a query will not return any rows, passing null will match with IsNull()

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • npm run format to apply prettier formatting
  • npm run test passes with this change
  • This pull request links relevant issues as Fixes #0000
  • There are new or updated unit tests validating the change
  • Documentation has been updated to reflect this change
  • The new commits follow conventions explained in CONTRIBUTING.md

Changes behavior of `getWherePredicateCondition` and `buildWhere` methods to match the behavior in typeorm 0.2, which is to apply an IsNull() condition to null values and not ignore undefined values so that when passing undefined queries do not return any data (null or []) rather than excluding that condition which is a vector for security issues.

Closes: typeorm#9316

BREAKING CHANGE: passing an undefined value in a query will not return any rows, passing null will match with IsNull()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

typeorm findOneBy( { id: null or undefined } ) method return the first record on the table !

2 participants