Silence uninitialized var warnings in add_query_normalizer()

Bug #1193196 reported by Dan Scott
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
2.3
Fix Released
Undecided
Unassigned
2.5
Fix Released
Undecided
Unassigned

Bug Description

* Evergreen 2.4

After upgrading to 2.4, during a typical day we would get 7,000 warnings like the following in our logs:

[WARN:27030:Application.pm:590:137144451521915512] open-ils.storage.biblio.multiclass.staged.search_fts: Use of uninitialized value $field in hash element at /usr/local/share/perl/5.10.1/OpenILS/Application/Storage/QueryParser.pm line 388.
[WARN:10663:Application.pm:590:137144451523582268] open-ils.storage.biblio.multiclass.staged.search_fts: Use of uninitialized value $class in hash element at /usr/local/share/perl/5.10.1/OpenILS/Application/Storage/QueryParser.pm line 384.

Please see http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/dbs/silence_query_normalizer_init for a fix that simply checks to see if $field_info is defined before attempting to access its member variables; if not, then add_query_normalizer() is simply not called in that case, and the warnings are avoided.

Tags: pullrequest
Bill Erickson (berick)
Changed in evergreen:
assignee: nobody → Bill Erickson (erickson-esilibrary)
status: New → In Progress
Revision history for this message
Bill Erickson (berick) wrote :

Ohhh, Perl auto-vivifies the hash instead of dying on dereferencing an undef value. Was confused there for a second.. Tested and confirmed. Pushed to master, rel_2_4, and rel_2_3. Thanks!

Changed in evergreen:
status: In Progress → Fix Committed
assignee: Bill Erickson (erickson-esilibrary) → nobody
Revision history for this message
Bill Erickson (berick) wrote :

Milestone for 2.3 is unset, since the milestone needed has not been added yet. addressing...

Ben Shum (bshum)
Changed in evergreen:
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.