Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

[3.0] active_record: Quote numeric values compared to string columns. #9210

Merged
merged 2 commits into from Feb 8, 2013

Conversation

Projects
None yet
4 participants
Contributor

dylanahsmith commented Feb 7, 2013

This is a backport of pull #9207 to rails 3.0

@dylanahsmith dylanahsmith commented on an outdated diff Feb 7, 2013

activerecord/test/cases/relation/where_test.rb
+ end
+
+ def test_where_with_float_for_string_column
+ count = Post.where(:title => 0.0).count
+ assert_equal 0, count
+ end
+
+ def test_where_with_boolean_for_string_column
+ count = Post.where(:title => false).count
+ assert_equal 0, count
+ end
+
+ def test_where_with_decimal_for_string_column
+ count = Post.where(:title => BigDecimal.new(0)).count
+ if count > 0 && current_adapter?(:Mysql2Adapter)
+ return skip("upstream bug in mysql2")
@dylanahsmith

dylanahsmith Feb 7, 2013

Contributor

Upstream pull request submitted to mysql2 to fix this test for the mysql2 adapter brianmario/mysql2#351

@guilleiguaran guilleiguaran added a commit that referenced this pull request Feb 8, 2013

@guilleiguaran guilleiguaran Merge pull request #9210 from dylanahsmith/3-0-mysql-quote-numeric
[3.0] active_record: Quote numeric values compared to string columns.
663c9a6

@guilleiguaran guilleiguaran merged commit 663c9a6 into rails:3-0-stable Feb 8, 2013

I think this should be reverted? The JSON fix in #9126 was reverted, due to "no more 3.0 releases".

(Or, does this mean 3.0 will see a security release after all?)

It won't have a release, but the security fix is provided in the 3-0-stable branch.

@steveklabnik steveklabnik added a commit that referenced this pull request Feb 27, 2013

@steveklabnik steveklabnik Revert "Merge pull request #9210 from dylanahsmith/3-0-mysql-quote-nu…
…meric"

This reverts commit 663c9a6, reversing
changes made to 10513d2.
9fdd56c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment