Merge lp://staging/~jamesh/storm/bug-585704 into lp://staging/storm

Proposed by James Henstridge
Status: Merged
Merged at revision: 373
Proposed branch: lp://staging/~jamesh/storm/bug-585704
Merge into: lp://staging/storm
Diff against target: 83 lines (+9/-8)
4 files modified
NEWS (+1/-0)
storm/variables.py (+1/-1)
tests/databases/base.py (+1/-1)
tests/databases/postgres.py (+6/-6)
To merge this branch: bzr merge lp://staging/~jamesh/storm/bug-585704
Reviewer Review Type Date Requested Status
John O'Brien (community) Approve
Thomas Herve (community) Approve
Review via email: mp+26472@code.staging.launchpad.net

Description of the change

Fix some incompatibilities with the latest versions of pyscopg2.

The problems all seemed to indicate bugs in Storm, where we were passing text data to psycopg2 using binary types. With newer psycopg2, the Binary() type includes an explicit cast when interpolated, which caused the problems.

To post a comment you must log in.
Revision history for this message
Thomas Herve (therve) wrote :

Seems reasonable, +1!

review: Approve
Revision history for this message
John O'Brien (jdobrien) wrote :

After applying your fix, we are getting this:

ERROR: operator does not exist: lifecycle_status = bytea
LINE 1: ...th = E'~/Ubuntu One' AND UserDefinedFolder.status = E'Live':...

When we use a Type:

CREATE TYPE lifecycle_status as enum('Live', 'Dead')

review: Needs Information
Revision history for this message
John O'Brien (jdobrien) wrote :

> After applying your fix, we are getting this:
>
> ERROR: operator does not exist: lifecycle_status = bytea
> LINE 1: ...th = E'~/Ubuntu One' AND UserDefinedFolder.status = E'Live':...
>
> When we use a Type:
>
> CREATE TYPE lifecycle_status as enum('Live', 'Dead')

BTW, In order to fix this, we made sure we only assigned Unicode strings to the Properties.

Revision history for this message
James Henstridge (jamesh) wrote :

John: I assume you'd get that error without my fix if you move to the new version of psycopg2.

This branch doesn't change the way Storm passes byte strings down to psycopg2 (it has always wrapped them in psycopg2.Binary() objects) -- it just fixes a few cases inside Storm where we got byte string vs. unicode string wrong. Switching those custom variable types to use unicode strings was the correct fix for the U1 code.

Revision history for this message
John O'Brien (jdobrien) wrote :

thanks for the reply, this fix worked great for us.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to status/vote changes: