Comments (2)
Interesting.
So this limitation isn't very surprising when you know that Arel compilation uses the common visitor pattern, so Arel will commonly use K * tree_depth
stack frames to compile an AST, and Ruby the Ruby stack is finite, hence Arel has an implicit max depth limit.
Interestingly, in your stacktraces, it's the hash
method that raises, but it's because it similarly recursively digest child nodes, so same problem. #41597 is what started calling hash
, but I suspect compiling to SQL would similarly run out of stack space (if not the limit probably isn't that much further).
One way we may be able to improve this is by changing the Or
node, so it's no longer a binary node, but can contain any number of conditions.
That would fix your specific problem, and generally probably reduce the depth of trees a bit, but the same problem may exist with other types of nodes. And I'm also not sure yet whether this solution is even doable, I'd need to try to see.
And also, even if it works, it would be a big enough change that I don't think it would be realistic to backport it as a bug fix to be honest.
from rails.
Thank you @casperisfine - I'll try patching this locally and see if it solves our specific use-case!
from rails.
Related Issues (20)
- Postgresql date type is not properly typecasted when using direct SQL queries like select_all HOT 7
- Guides CSS processing output is overwritten by existing assets HOT 1
- Rails error reporter not reporting exceptions inheriting directly from the Exception class HOT 10
- Issue: ActiveRecord PG - Issue deleting records (in execute_and_clear & exec_delete) HOT 9
- Composite PKs break fixture loading for many-to-many associations HOT 2
- `#resource` and `#resources` fail quietly and succeed quietly when invalid arguments are passed to `:only` and `:except` options respectively HOT 1
- counter_cache doesn't work with composite PKs (revisited) HOT 3
- composite PKs: update_all doesn't work when .order is used in postgres HOT 1
- ActiveSupport::OrderedOptions#respond_to?(:call) true - breaking check for callable objects HOT 2
- How the heck do I use this site lol. I hope y'all don't think of me as a retard just trying to figure out how to work this so I can understand. Thank you
- `order Arel.sql` is wrong, has bad disign and generally useless HOT 8
- Rails.cach.fetch always returns Nil HOT 3
- `validates_associated` does not work with `accepts_nested_attributes_for` for `has_many` associations HOT 7
- Trix toolbar doesn't render correctly with Propshaft HOT 7
- ActiveRecord::UnknownAttributeReference have too much false positive HOT 14
- Should Active Model's `ImmutableString` type observe the `limit` parameter?
- Feature Request: Option to Opt-Out of Auto-Generated Negative Scopes in ActiveRecord HOT 2
- DOCS - ActionMailer::Base.smtp_settings missing documentation for ca_path
- `bin/rails db:prepare` breaks virtual/generated columns in `db/schema.rb` HOT 1
- Calling `pluck` on a `strict_loading!` association will execute the N+1 instead of raising `ActiveRecord::StrictLoadingViolationError`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rails.