This project is archived and is in readonly mode.

#94 ✓resolved
Lars Kanis

quote_string don't work with some postgres drivers

Reported by Lars Kanis | May 2nd, 2008 @ 09:24 AM

A special code path is used for postgres drivers that don't define PGconn.escape. This code path does not work and throws the following exception.

Attached is a patch with the simple fix.

d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/postgresql_adapter.rb:352:in `quote_string': undefined method `quote_string' for # (NoMethodError)

from d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/quoting.rb:19:in `quote'

from d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/postgresql_adapter.rb:333:in `quote'

from d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1880:in `quote_bound_value'

from d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1851:in `replace_bind_variables'

from d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1851:in `gsub'

from d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1851:in `replace_bind_variables'

from d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1819:in `sanitize_sql_hash_for_conditions'

from d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/base.rb:1778:in `sanitize_sql'

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>

Attachments

Referenced by

Pages