Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

quote_bound_value incorrectly works with new line chars in ActiveSupport::Multibyte::Chars

#999

ActiveRecord processes multibyte strings in wrong way:

Loading development environment (Rails 2.1.0)
>> Video.find(:all, :conditions => ['title = ?', "hello\r\nworld".chars])
ActiveRecord::StatementInvalid: Mysql::Error: Operand should contain 1 column(s): SELECT * FROM `videos`     WHERE (title = 'hello\r\n','world')

Attached patch for Rails 2.0.2 to fix this issue.

Reported by Dmytro Shteflyuk · September 9th, 2008 @ 08:41 AM

State: committed
Milestone: 2.1.2
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: High

Activity

  1. Jeremy Kemper
    Jeremy Kemper
    • State changed from new to open
    • Assigned user set to Jeremy Kemper
    • Milestone changed from 2.x to 2.1.2

    Could you include a test case? Thanks!

    September 9th, 2008 @ 06:00 PM

  2. Dmytro Shteflyuk
    Dmytro Shteflyuk

    Here is patch for Rails 2.1.1 (2-1-stable branch) with test case included.

    September 9th, 2008 @ 09:05 PM

  3. Repository
    Repository
    • State changed from open to committed

    (from [c75e71147a98ce2539e8201137ea4481408082a4]) Handle quoting multibyte strings with newlines.

    [#999 quote_bound_value incorrectly works with new line chars in ActiveSupport::Mul... state:committed] http://github.com/rails/rails/co...

    September 24th, 2008 @ 05:36 PM