Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10176 (closed defect: fixed)

Opened 8 months ago

Last modified 8 months ago

[PATCH] Postgres Database Adapter handles decoding of bytea incorrectly

Reported by: jbasdf Assigned to: core
Priority: normal Milestone: 2.x
Component: ActiveRecord Version: edge
Severity: major Keywords:
Cc:

Description

The change from 7328 to 7329 involves a fairly extensive makeover of the postgres database adapter. In this change the handling of bytea fields was modified and is now broken.

I posted this issue to my blog and received this response:

The regexp should be /\\\d{3}/ not /\\\\\d{3}/ as it is in both cases.

A bit of tinkering has shown me the main use for byteas (images) often have a \ followed by a character that requires encoding so they generally match the original regexp and therefore nothing is noticed.

blog post is here: http://www.justinball.com/2007/09/17/edge-rails-openid-and-the-dreaded-sorry-the-openid-verification-failed-error/

Attachments

postgresql_adapter_bytea_escaping.diff (2.4 kB) - added by tmacedo on 11/22/07 00:55:39.
postgresql adapter bytea escaping patch

Change History

11/15/07 20:15:55 changed by bitsweat

Please include a failing test. It'd be great to get this nailed down and prevent future regression.

11/22/07 00:55:39 changed by tmacedo

  • attachment postgresql_adapter_bytea_escaping.diff added.

postgresql adapter bytea escaping patch

11/22/07 00:56:47 changed by tmacedo

  • summary changed from Postgres Database Adapter handles decoding of bytea incorrectly to [PATCH] Postgres Database Adapter handles decoding of bytea incorrectly.

I came across this issue too.

I turned jbasdf's fix into a patch and included a failing test.

Everything is working as it should now.

11/22/07 01:29:23 changed by bitsweat

  • status changed from new to closed.
  • resolution set to fixed.

(In [8185]) PostgreSQL: correct binary escaping. References #8049, closes #10176 [jbasdf, tmacedo]

11/22/07 01:30:25 changed by bitsweat

(In [8186]) Add example.log for binary escaping test. References #10176.