Reporter searches for actor.org_unit for id AND NULL

Bug #886155 reported by Liam Whalen
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Invalid
Undecided
Unassigned

Bug Description

Evergreen 2.0.8
OpenSRF 2.0.1
PostgreSQL 9.0.4
Ubuntu 10.0.4

When creating a report to detail cataloguing statistics, if the report is filtered by Bibliographic Record -> Call Number/Volume -> Item :: Circulating Library -> Org_unit the report searches for both the id supplied in the report and id = NULL. It should not be inserting id = NULL.

Create a report with the follwing fields:

Bibliographic Record -> Call Number/Volume -> Item :: Circulating Library -> Short (Policy) Name
Bibliographic Record -> Basic Record Descriptor :: BLvl -> Bib Level Code
Bibliographic Record -> Basic Record Descriptor :: Type -> Item Type
Bibliographic Record -> Basic Record Descriptor :: Type -> Record Creatation Date/Time As a Count transform

Then filter the report with

Bibliographic Record -> Basic Record Descriptor :: Type -> Record Creatation Date/Time As Year + Month transfrom =
Bibliographic Record -> Call Number/Volume -> Item :: Circulating Library -> Organizational Unit Id =

I modified this report to filter on Record Creation Date/TIme Raw Data and put in some garbage, which produced the following SQL

The SQL command attempted was:

 SELECT "6b9bd799d746ad40deafe442defd4fe5"."shortname" AS "Location Code",
 "f19550385b6aaeed2ccfe2cb9bc6f334"."item_type" AS "Item Type (e=map, a=monograph)",
 "f19550385b6aaeed2ccfe2cb9bc6f334"."bib_level" AS "BLvl (a/c/m = monograph, s/i/b = serial)",
 COUNT("d94d9ed7d30666ea41bbd3190401885c"."create_date") AS "Records Created"
  FROM biblio.record_entry AS "d94d9ed7d30666ea41bbd3190401885c"
 LEFT OUTER JOIN asset.call_number AS "284511cb8982143280e95b2458c695ff" ON ("d94d9ed7d30666ea41bbd3190401885c"."id" = "284511cb8982143280e95b2458c695ff"."record")
 LEFT OUTER JOIN asset.copy AS "b72e2d9fad2ab7bd5fbb688750d49db2" ON ("284511cb8982143280e95b2458c695ff"."id" = "b72e2d9fad2ab7bd5fbb688750d49db2"."call_number")
 LEFT OUTER JOIN actor.org_unit AS "6b9bd799d746ad40deafe442defd4fe5" ON ("b72e2d9fad2ab7bd5fbb688750d49db2"."circ_lib" = "6b9bd799d746ad40deafe442defd4fe5"."id")
 LEFT OUTER JOIN metabib.rec_descriptor AS "f19550385b6aaeed2ccfe2cb9bc6f334" ON ("d94d9ed7d30666ea41bbd3190401885c"."id" = "f19550385b6aaeed2ccfe2cb9bc6f334"."record")
  WHERE "d94d9ed7d30666ea41bbd3190401885c"."create_date" = 'asdfsda'
 AND (("6b9bd799d746ad40deafe442defd4fe5"."id") IS NULL OR "6b9bd799d746ad40deafe442defd4fe5"."id" = '127')
  GROUP BY 1, 2, 3
  ORDER BY "6b9bd799d746ad40deafe442defd4fe5"."shortname" ASC, "f19550385b6aaeed2ccfe2cb9bc6f334"."item_type" ASC, "f19550385b6aaeed2ccfe2cb9bc6f334"."bib_level" ASC, COUNT("d94d9ed7d30666ea41bbd3190401885c"."create_date") ASC

In the WHERE clause actor.org_unit is searched for id = NULL OR id = 127

Liam Whalen (lwhalen)
description: updated
James Fournie (jfournie)
tags: added: reporter
tags: added: report reports
Revision history for this message
Thomas Berezansky (tsbere) wrote :

From me reading this, my view is that this is likely solved with the nullability selection ability, allowing choice of whether nulls are or are not allowed across the links.

Revision history for this message
Jason Stephenson (jstephenson) wrote :

James and/or Liam,

Does Thomas' suggestion resolve this for you?

Jason

Changed in evergreen:
status: New → Incomplete
Changed in evergreen:
status: Incomplete → Triaged
Revision history for this message
Chris Sharp (chrissharp123) wrote :

Marking this bug "Invalid" with the agreement that this issue is resolved with nullability selection. That was still relatively new at the time the bug was reported and wasn't very well documented.

Changed in evergreen:
status: Triaged → Invalid
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.