Skip to content
  • Jean Boussier's avatar
    bfcc13ab
    Arel: make `Or` nodes "Nary" like `And` · bfcc13ab
    Jean Boussier authored
    Fix: https://github.com/rails/rails/issues/51386
    
    This significantly reduce the depth of the tree for large `OR`
    conditions. I was initially a bit on the fence about that fix,
    but given that `And` is already implemented this way, I see no
    reasons not to do the same.
    
    Amusingly, the reported repro script now makes SQLite fail:
    
    ```ruby
    SQLite3::SQLException: Expression tree is too large (maximum depth 1000)
    ```
    bfcc13ab
    Arel: make `Or` nodes "Nary" like `And`
    Jean Boussier authored
    Fix: https://github.com/rails/rails/issues/51386
    
    This significantly reduce the depth of the tree for large `OR`
    conditions. I was initially a bit on the fence about that fix,
    but given that `And` is already implemented this way, I see no
    reasons not to do the same.
    
    Amusingly, the reported repro script now makes SQLite fail:
    
    ```ruby
    SQLite3::SQLException: Expression tree is too large (maximum depth 1000)
    ```
Loading