sync-source.py broke: column "published" does not exist

Bug #139550 reported by Martin Pitt
2
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Undecided
Celso Providelo

Bug Description

With yesterday's cherrypick, sync-source.py does not work any more:

lp_archive@drescher:~/syncs$ sync-source.py -b ccheney openoffice.org-voikko
Traceback (most recent call last):
  File "/srv/launchpad.net/codelines/current/scripts/ftpmaster-tools/sync-source.py", line 858, in ?
    main()
  File "/srv/launchpad.net/codelines/current/scripts/ftpmaster-tools/sync-source.py", line 853, in main
    current_binaries = read_current_binaries(Options.tosuite)
  File "/srv/launchpad.net/codelines/current/scripts/ftpmaster-tools/sync-source.py", line 483, in read_current_binaries
    cur.execute(query)
psycopg.ProgrammingError: ERROR: column "published" does not exist at character 397

    SELECT bpn.name, bpr.version, c.name
    FROM binarypackagerelease bpr, binarypackagename bpn, component c,
        securebinarypackagepublishinghistory sbpph, distroarchrelease dar
    WHERE
        bpr.binarypackagename = bpn.id AND
             sbpph.binarypackagerelease = bpr.id AND
        sbpph.component = c.id AND
        sbpph.distroarchrelease = dar.id AND
        sbpph.status = Published AND dar.id in (59, 60, 61, 62, 65, 63, 64)

Tags: lp-soyuz
Revision history for this message
Julian Edwards (julian-edwards) wrote :

"sbpph.status" = Published

For some reason this query:
    query = """
    SELECT bpn.name, bpr.version, c.name
    FROM binarypackagerelease bpr, binarypackagename bpn, component c,
        securebinarypackagepublishinghistory sbpph, distroarchrelease dar
    WHERE
        bpr.binarypackagename = bpn.id AND
             sbpph.binarypackagerelease = bpr.id AND
        sbpph.component = c.id AND
        sbpph.distroarchrelease = dar.id AND
        sbpph.status = %s AND dar.id in (%s)
     """ % (dbschema.PackagePublishingStatus.PUBLISHED, dar_ids)

is generating the dbschema's *title* instead of its enum value.

Revision history for this message
Björn Tillenius (bjornt) wrote : Re: [Bug 139550] Re: sync-source.py broke: column "published" does not exist

On Fri, Sep 14, 2007 at 08:10:01AM -0000, Julian Edwards wrote:
> "sbpph.status" = Published
>
> For some reason this query:
> query = """
> SELECT bpn.name, bpr.version, c.name
> FROM binarypackagerelease bpr, binarypackagename bpn, component c,
> securebinarypackagepublishinghistory sbpph, distroarchrelease dar
> WHERE
> bpr.binarypackagename = bpn.id AND
> sbpph.binarypackagerelease = bpr.id AND
> sbpph.component = c.id AND
> sbpph.distroarchrelease = dar.id AND
> sbpph.status = %s AND dar.id in (%s)
> """ % (dbschema.PackagePublishingStatus.PUBLISHED, dar_ids)
>
> is generating the dbschema's *title* instead of its enum value.

That's because you simply convert the PUBLISHED enum item to a string.
You need to sql quote it, using sqlvalues() or quote(), if you're going
to use it in a SQL query.

Revision history for this message
Celso Providelo (cprov) wrote :

Code will be merged soon, meanwhile drescher has the uncommited change in place:
{{{
lp_archive@drescher:~/syncs$ sync-source.py -b ccheney openoffice.org-voikko -n
Getting binaries for gutsy...
[Updating] openoffice.org-voikko (2.0.1-1build3 [Ubuntu] < 2.0.1-2 [Debian])
}}}

Changed in soyuz:
assignee: nobody → cprov
status: New → In Progress
Revision history for this message
Celso Providelo (cprov) wrote :

RF 4901

Changed in soyuz:
status: In Progress → Fix Committed
Celso Providelo (cprov)
Changed in soyuz:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.