bmg 0.24.0 → 0.24.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1cf55d89350451dc43a50e85413570b8525fdb1af1467cf33c854d65cd885324
4
- data.tar.gz: a0a665602f3e4deceacfa6bc1bf301dd91e9344d96d93f3cc1df462e3b364fb1
3
+ metadata.gz: ff9e5fa48bb225feaeee07ddbfb15f8616e7943be2304113d727d7b8fd71dda2
4
+ data.tar.gz: b8924512fc6e1b4d8cdb6d86ab40e5e5f317850839ae6d8bc3f02ddd8534e578
5
5
  SHA512:
6
- metadata.gz: 2cf7cfe088705ba0ac9b90aaa47c457d2f5fbd7dc9d28f8dc246b91e8dbd4d492ff6ef0e892385d2fb6098998e9d07859d355b68f833154d4c4dbd2f6db87149
7
- data.tar.gz: bd120334a2e20ff7b20cd15d4d96ac3c3651fac5011aadc3dc6f3acf301f9b5f1245fc8e46571f7ab67ed8db4a45d463728605172c0e8d4213b753289d64959e
6
+ metadata.gz: dc7c8dde953a4792a17177abe5a3decd4a3aac156cda87c7ad8854382d2248b03a272a6d318a348fbcba255ba5302e5adbaa4f3764c6db04b61924e9d11e50f4
7
+ data.tar.gz: 5148e32c981959c62eedae0f8b15cd8816d9afc01f7e1e00e94cc4d7086892e22dc4b6da0a3bb07a57ec138e91060b3c2a839c9f6e4ef5b6af053df08382c20e
@@ -15,7 +15,7 @@ module Bmg
15
15
  def call(sexpr)
16
16
  if unjoinable?(sexpr)
17
17
  call(builder.from_self(sexpr))
18
- elsif unjoinable?(right)
18
+ elsif unjoinable?(right) || left_join_over_restricted_right?
19
19
  Join.new(builder.from_self(right), on, options, builder).call(sexpr)
20
20
  else
21
21
  super(sexpr)
@@ -37,6 +37,20 @@ module Bmg
37
37
  sexpr.set_operator? or sexpr.limit_or_offset? or sexpr.group_by?
38
38
  end
39
39
 
40
+ # A restriction carried by the right operand of a left join may not be
41
+ # merged into the WHERE of the whole expression: there it would also
42
+ # have to hold of the tuples the left join fills with nulls, which is an
43
+ # inner join and loses exactly what the left join is for. Kept inside a
44
+ # derived table instead, where it applies to the right operand alone.
45
+ #
46
+ # The join condition would hold it just as well, and with less SQL, but
47
+ # it is the one place a restriction may be anything -- `>`, `IN`, a
48
+ # negation -- while the from clause orderer models a join condition as
49
+ # equalities between two qualified names.
50
+ def left_join_over_restricted_right?
51
+ left_join? && !right.select_exp.predicate.nil?
52
+ end
53
+
40
54
  def join_set_quantifiers(left, right)
41
55
  left_q, right_q = left.set_quantifier, right.set_quantifier
42
56
  left_q == right_q ? left_q : builder.distinct
data/lib/bmg/version.rb CHANGED
@@ -2,7 +2,7 @@ module Bmg
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 24
5
- TINY = 0
5
+ TINY = 1
6
6
  end
7
7
  VERSION = "#{Version::MAJOR}.#{Version::MINOR}.#{Version::TINY}"
8
8
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bmg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.0
4
+ version: 0.24.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernard Lambeau
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2026-09-01 00:00:00.000000000 Z
10
+ date: 2026-10-03 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: predicate
@@ -333,7 +332,6 @@ homepage: http://github.com/enspirit/bmg
333
332
  licenses:
334
333
  - MIT
335
334
  metadata: {}
336
- post_install_message:
337
335
  rdoc_options: []
338
336
  require_paths:
339
337
  - lib
@@ -348,8 +346,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
348
346
  - !ruby/object:Gem::Version
349
347
  version: '0'
350
348
  requirements: []
351
- rubygems_version: 3.4.19
352
- signing_key:
349
+ rubygems_version: 3.6.2
353
350
  specification_version: 4
354
351
  summary: Bmg is Alf's successor.
355
352
  test_files: []