This project is archived and is in readonly mode.

#5457 ✓resolved
Brian Lopez

Arel/AR prepending 'AND' unconditionally after newlines in string literals in RC2

Reported by Brian Lopez | August 25th, 2010 @ 05:57 PM | in 3.0.2

Not sure if that title makes sense, but an easy way to reproduce it is:

SomeModel.where("varchar_test IS NULL\nor varchar_test IS NOT NULL")

Without the newline I get:

"SELECT mysql2_test.* FROM mysql2_test WHERE (varchar_test IS NULL or varchar_test IS NOT NULL)"

With the newline I get:

"SELECT mysql2_test.* FROM mysql2_test WHERE (varchar_test IS NULL\n AND or varchar_test IS NOT NULL)"

Which is invalid.

Trying to track down where this is happening, if I find it I'll try to come up with a patch but I figure you'd have a better idea of where it's happening.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>