John Maslanik via RT wrote on 6/17/09 1:21 AM:
Show quoted text> Queue: Search-QueryParser-SQL
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=46881 >
>
> Peter,
>
> Attached or modified Query.pm and SQL.pm files. They are modified
> from the cvs link below. The following features and/or bug fixes are
> added.
>
> 1. Added "aliases" option to the constructor. If passed, column
> names will be transformed in accordance with the alias hash.
> 2. Added int_op option to the constructor. This sets what default
> operator to use for int fields. There was also a bug where the int
> operator was set to GT, this is not valid for mysql.
> 3. Made -keyword queries work. This consists of setting "NOT $like"
> when the $prefix is '-' and joining sub queries with "AND" instead of
> OR when the $prefix is '-', it also sets op to != for ints.
> 4. In the unwind_subQ function, $like had padding added twice when
> doing the int check.
>
> Let me know how it looks.
>
John,
Thanks for the patches.
First, those look like decent changes, but it's hard to tell without tests.
Show quoted text>> be sure to include tests and docs for the new features.
I didn't see those.
Second, those patches cause 4 existing tests to fail. Output below:
t/00-load.t ....... 1/1 # Testing Search::QueryParser::SQL 0.008
t/00-load.t ....... ok
t/01-parser.t ..... 1/30
# Failed test 'query8 fuzzy int with wildcard string'
# at t/01-parser.t line 94.
# got: 'bar<=1'
# expected: 'bar>=1'
# Failed test 'query8 fuzzy int no wildcard string'
# at t/01-parser.t line 98.
# got: 'bar<=1'
# expected: 'bar>=1'
# Looks like you failed 2 tests of 30.
t/01-parser.t ..... Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/30 subtests
t/02-dbi.t ........ 1/29
# Failed test 'parser4_query dbi->[0]'
# at t/02-dbi.t line 91.
# got: 'foo ILIKE ? AND bar<=? AND dt<=?'
# expected: 'foo ILIKE ? AND bar>=? AND dt>=?'
# Looks like you failed 1 test of 29.
t/02-dbi.t ........ Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/29 subtests
t/03-orm.t ........ 1/23
# Failed test 'parser4_query string'
# at t/03-orm.t line 183.
# Structures begin differing at:
# $got->[1][3]{ge} = Does not exist
# $expected->[1][3]{ge} = '123'
# Looks like you failed 1 test of 23.
t/03-orm.t ........ Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/23 subtests
pek
--
Peter Karman .
http://peknet.com/ . peter@peknet.com
gpg key: 37D2 DAA6 3A13 D415 4295 3A69 448F E556 374A 34D9