Storm may generate SQL errors on ResultSets.set for otherwise-working ResultSets.

Bug #674582 reported by Aaron Bentley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Storm
New
Undecided
Unassigned

Bug Description

For a resultset with multiple tables, like:
        Store.of(self).find(
            SourcePackageRecipeBuild,
            SourcePackageRecipeBuild.recipe==self,
            SourcePackageRecipeBuild.package_build_id == PackageBuild.id,
            PackageBuild.build_farm_job_id == BuildFarmJob.id,
            BuildFarmJob.date_finished == None)

Operations that rely on SELECT will work fine. set however does not:
[2010-11-12 10:00:36 EST] launchpad_main@launchpad_ftest ERROR: missing FROM-clause entry for table "packagebuild" at character 136
[2010-11-12 10:00:36 EST] launchpad_main@launchpad_ftest STATEMENT: UPDATE SourcePackageRecipeBuild SET recipe=NULL WHERE SourcePackageRecipeBuild.recipe = 1 AND SourcePackageRecipeBuild.package_build = PackageBuild.id AND PackageBuild.build_farm_job = BuildFarmJob.id AND BuildFarmJob.date_finished IS NULL

Storm appears not to know that on Postgres, such a query requires a FROM clause mentioning PackageBuild (and BuildFarmJob).

On platforms where UPDATE does not accept a FROM clause, it should automatically use a subselect, IMHO. A ResultSet should support all methods, and should not emit SQL errors when the methods are used as intended.

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.