[Koha-bugs] [Bug 12647] New: QueryParser fails tests
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Thu Jul 24 11:14:30 CEST 2014
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12647
Bug ID: 12647
Summary: QueryParser fails tests
Change sponsored?: ---
Product: Koha
Version: master
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P5 - low
Component: Searching
Assignee: gmcharlt at gmail.com
Reporter: colin.campbell at ptfs-europe.com
QA Contact: testopia at bugs.koha-community.org
QueryParser.t will usually fail using a more current perl.
Here are two runs of QueryParser.t using perl 5.18.1
~/kohaclone$ prove t/QueryParser.t
t/QueryParser.t .. 1/?
# Failed test 'super simple keyword query'
# at t/QueryParser.t line 22.
# got: '@attr 1=1003 @attr 4=6 "smith"'
# expected: '@or @or @attr 1=1016 @attr 4=6 "smith" @attr 9=20 @attr 2=102
@attr 4=6 "smith" @attr 9=34 @attr 2=102 @attr 4=6 "smith"'
# Failed test 'keyword search sorted by acqdate descending'
# at t/QueryParser.t line 33.
# got: '@or @attr 7=1 @attr 1=32 0 @attr 1=1003 @attr 4=6 "smith"'
# expected: '@or @attr 1=32 @attr 7=1 0 @attr 1=1003 @attr 4=6 "smith"'
# Looks like you failed 2 tests of 28.
t/QueryParser.t .. Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/28 subtests
Test Summary Report
-------------------
t/QueryParser.t (Wstat: 512 Tests: 28 Failed: 2)
Failed tests: 6, 17
Non-zero exit status: 2
Files=1, Tests=28, 0 wallclock secs ( 0.02 usr 0.01 sys + 0.17 cusr 0.01
csys = 0.21 CPU)
Result: FAIL
~/kohaclone$ prove t/QueryParser.t
t/QueryParser.t .. 1/?
# Failed test 'super simple keyword query'
# at t/QueryParser.t line 22.
# got: '@attr 1=4 @attr 4=6 "smith"'
# expected: '@or @or @attr 1=1016 @attr 4=6 "smith" @attr 9=20 @attr 2=102
@attr 4=6 "smith" @attr 9=34 @attr 2=102 @attr 4=6 "smith"'
# Failed test 'relevance-bumped query'
# at t/QueryParser.t line 26.
# got: '@attr 1=4 @attr 2=102 @attr 9=20 @attr 4=6 "smith"'
# expected: '@attr 1=4 @attr 9=20 @attr 2=102 @attr 4=6 "smith"'
# Failed test 'keyword search sorted by acqdate descending'
# at t/QueryParser.t line 33.
# got: '@or @attr 7=1 @attr 1=32 0 @attr 1=1003 @attr 4=6 "smith"'
# expected: '@or @attr 1=32 @attr 7=1 0 @attr 1=1003 @attr 4=6 "smith"'
# Looks like you failed 3 tests of 28.
t/QueryParser.t .. Dubious, test returned 3 (wstat 768, 0x300)
Failed 3/28 subtests
Test Summary Report
-------------------
t/QueryParser.t (Wstat: 768 Tests: 28 Failed: 3)
Failed tests: 6, 10, 17
Non-zero exit status: 3
Files=1, Tests=28, 0 wallclock secs ( 0.03 usr 0.01 sys + 0.18 cusr 0.01
csys = 0.23 CPU)
Result: FAIL
The nature of the fails suggests that the parser is assuming that elements in a
hash are ordered and generating the query from that. While that has never been
the case current versions of perl ensure that hash elements are not returned in
the same sequence as a predictable one was a security weakness. So if running
with a later perl the dequence of elements in the generated query is random
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list