Skip to content

issue 2797 solid cache arel binderror fix - #2809

Open
andynu wants to merge 2 commits into
rsim:masterfrom
andynu:repro/issue-2797-solid-cache-arel-binderror-fix
Open

issue 2797 solid cache arel binderror fix#2809
andynu wants to merge 2 commits into
rsim:masterfrom
andynu:repro/issue-2797-solid-cache-arel-binderror-fix

Conversation

@andynu

@andynu andynu commented May 27, 2026

Copy link
Copy Markdown
Collaborator

So solid cache is doing a very specific gsub:
https://github.com/rails/solid_cache/blob/4e7219c4210d165e03176439dfca99238ba6fde9/app/models/solid_cache/entry.rb#L114-L122
"1111, 2222" and the oracle adapter is not including the space, so the substitution doesn't happen, so the number of bind question marks ends up wrong.

An upstream fix to solid cache would be reasonable too, but adding a space here doesn't cost us much.

Fixes #2797

andynu added 2 commits May 26, 2026 09:26
`visit_Arel_Nodes_HomogeneousIn` was joining IN-list values with bare
"," instead of ", ". The whitespace is irrelevant to Oracle's parser
but breaks Solid Cache 1.0.10's `read_multi`, which composes prepared
statements via literal-string gsub against the to_sql output:

    where(key_hash: [1111, 2222]).select(...).to_sql
      .gsub("1111, 2222", "?, ?")

oracle-enhanced returned "IN (1111,2222)" -- gsub no-op'd, leaving
zero placeholders in the template while the caller still passed bind
values, producing Arel::BindError("wrong number of bind variables").

Aligning the separator with every other adapter (and every other
comma-joiner in oracle-enhanced itself) unblocks Solid Cache without
behavioural change for first-party AR queries.
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.

Oracle Enhanced 8.0.0 + Solid Cache on Rails 8.0.4: Rails.cache.fetch raises Arel::BindError

1 participant