-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
7.1 update: strange serialize behavior #2410
Comments
I don't think this is strictly related to serialization. I'm seeing issues with CLOB/BLOB columns, even before getting serialization involved. I think the source of the nil comparison problem is here. The empty hash comparison I'm not sure about yet. I'll take a look next time I get a chance. |
I think I got my wires crossed earlier - I was testing the empty hashes with a non-serialized column. After sorting things out and testing again, the guard clause also seems to fix the empty hash queries. I've submitted a PR. |
This problem is because of considering text/binary columns as CLOB in #2258 |
That's a good catch! I reviewed brianthoman's PR (although I am not in any kind of authority in the project). Hopefully it will get merged soon. |
Currently, I try to update my app from rails 7.0 to 7.1.
One thing that I recognized it the behavior of searching for DB entries where
serialize
is used for a column to store aHash
Let's say, I have the model:
I would like to get all entries where
something
is empty/nil/null/...Using Rails 7.0:
I always get the same result.
When I do the same with Rails 7.1
I only get the correct result for
SomeModel.where('something is NULL').count
. The other queries do not work.Is this a new Rails 7.1 behavior, or is this related to the Oracle adapter? I would not be a fan of switching from
something: nil
to'something is NULL'
because I would need an additionalwhere
if I would further filter the entries, and rubocop would complain anyway (Use
where(something: nil)instead of manually constructing SQL. (convention:Rails/WhereEquals)
).System configuration
Rails version:
7.1.4
Oracle enhanced adapter version:
7.1.0
Ruby version:
3.3.4
Oracle Database version:
19.22 (19c)
The text was updated successfully, but these errors were encountered: