Skip to content

2.2.1

Choose a tag to compare

@BJNSTNKVC BJNSTNKVC released this 26 Sep 19:31
· 15 commits to master since this release

Fixed

  • A comparison against a null column inside a negated group now stays unknown, as in SQL, so the record is excluded. whereNot((query) => query.where('age', '>', 26)) and whereNone(['age'], '>', 26) no longer match a record whose age is null.
  • whereNotIn with a null in the list no longer matches values missing from the list, since comparing against that null is unknown.
  • whereNotBetween with a null bound now matches only values the other bound rules out, and whereBetween with a null bound no longer treats that bound as a real limit.
  • whereNotLike and not like no longer match a value that is not a string, such as a number or a date. Only strings are matched by either form.
  • A date part constraint such as whereYear against a value that holds no date is now unknown rather than false, so negating it inside a group no longer matches.
  • Comparing against null with any operator other than equality or inequality, such as where('age', '>', null), is now unknown and matches nothing, including when negated.

Changed

  • where('age', null) is now short for whereNull('age'), and where('age', '!=', null) for whereNotNull('age'). This covers =, ==, ===, !=, <> and !==, treats undefined like null, and whereNot flips the check. Previously where('age', null) matched nothing.
  • Constraints now follow SQL's three-valued logic through nested groups, negation, in lists, between bounds and like patterns. Queries that relied on these matching null or non-string values will return fewer records. Use whereNull, whereNotNull or orWhereNull to ask for null values explicitly.