Skip Menu |
 
rt.cpan.org will be shut down on March 1st, 2021.

This queue is for tickets about the Search-QueryParser-SQL CPAN distribution.

Report information
The Basics
Id: 46881
Status: resolved
Priority: 0/
Queue: Search-QueryParser-SQL

People
Owner: Nobody in particular
Requestors: maz [...] mlx.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



MIME-Version: 1.0 (Apple Message framework v929.2)
X-Spam-Status: No, hits=-0.0 required=8.0 tests=SPF_PASS
X-Mailer: Apple Mail (2.929.2)
content-type: text/plain; charset="utf-8"; format="flowed"
Message-ID: <DACEED66-F05D-4459-821F-C1D105734A6F [...] mlx.net>
X-Virus-Scanned: amavisd-new at squirtle.mlx.net
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id E2CBF4D8164 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Fri, 12 Jun 2009 05:20:35 -0400 (EDT)
Received: (qmail 12606 invoked by uid 103); 12 Jun 2009 09:20:34 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 12 Jun 2009 09:20:34 -0000
Received: from squirtle.mlx.net (HELO squirtle.mlx.net) (206.71.172.5) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Fri, 12 Jun 2009 02:20:26 -0700
Received: from localhost (localhost [127.0.0.1]) by squirtle.mlx.net (Postfix) with ESMTP id 6A69E528001 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Fri, 12 Jun 2009 02:18:40 -0700 (PDT)
Received: from squirtle.mlx.net ([127.0.0.1]) by localhost (squirtle.mlx.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5X9EymEpH07P for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Fri, 12 Jun 2009 02:18:35 -0700 (PDT)
Received: from [192.168.1.6] (unknown [203.213.220.150]) by squirtle.mlx.net (Postfix) with ESMTP id B2627C10023 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Fri, 12 Jun 2009 02:18:34 -0700 (PDT)
Delivered-To: cpan-bug+Search-QueryParser-SQL [...] diesel.bestpractical.com
Subject: INTs are being fuzzified
Return-Path: <maz [...] mlx.net>
X-Original-To: bug-Search-QueryParser-SQL [...] rt.cpan.org
X-Spam-Check-BY: 16.mx.develooper.com
Date: Fri, 12 Jun 2009 17:20:14 +0800
X-Spam-Level: *
To: bug-Search-QueryParser-SQL [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: John Maslanik <maz [...] mlx.net>
X-RT-Original-Encoding: US-ASCII
Content-Length: 206
Download (untitled) / with headers
text/plain 206b
Adding the following to the _doctor_value sub is how I fixed it. my $value = $subQ->{value}; + if($self->{_parser}->{_is_int}->{ $subQ->{field} }) { + return $value; + } John Maslanik
MIME-Version: 1.0
X-Spam-Status: No, hits=0.0 required=8.0 tests=
In-Reply-To: <rt-3.6.HEAD-13950-1244798458-1013.46881-4-0 [...] rt.cpan.org>
References: <RT-Ticket-46881 [...] rt.cpan.org> <DACEED66-F05D-4459-821F-C1D105734A6F [...] mlx.net> <rt-3.6.HEAD-13950-1244798458-1013.46881-4-0 [...] rt.cpan.org>
Message-ID: <4A326517.70104 [...] peknet.com>
Content-Type: text/plain; charset=UTF-8
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id 4B69E19B838B for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Fri, 12 Jun 2009 10:24:34 -0400 (EDT)
Received: (qmail 24349 invoked by uid 103); 12 Jun 2009 14:24:33 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 12 Jun 2009 14:24:33 -0000
Received: from conn.mc.mpls.visi.com (HELO conn-smtp.mc.mpls.visi.com) (208.42.156.2) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Fri, 12 Jun 2009 07:24:28 -0700
Received: from pekmac.local (karman.dsl.visi.com [209.98.116.241]) by conn-smtp.mc.mpls.visi.com (Postfix) with ESMTP id 35598120843 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Fri, 12 Jun 2009 09:24:24 -0500 (CDT)
Received: from pekmac.local (localhost [127.0.0.1]) by pekmac.local (Postfix) with ESMTP id E38A4F46E6 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Fri, 12 Jun 2009 09:24:23 -0500 (CDT)
Delivered-To: cpan-bug+Search-QueryParser-SQL [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #46881] INTs are being fuzzified
User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302)
Return-Path: <peter [...] peknet.com>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Search-QueryParser-SQL [...] rt.cpan.org
Date: Fri, 12 Jun 2009 09:24:23 -0500
X-Spam-Level: *
To: bug-Search-QueryParser-SQL [...] rt.cpan.org
X-Enigmail-Version: 0.95.7
Content-Transfer-Encoding: 7bit
From: Peter Karman <peter [...] peknet.com>
RT-Message-ID: <rt-3.6.HEAD-13950-1244816683-1395.46881-0-0 [...] rt.cpan.org>
Content-Length: 1015
Download (untitled) / with headers
text/plain 1015b
John Maslanik via RT wrote on 6/12/09 4:21 AM: Show quoted text
> Fri Jun 12 05:20:57 2009: Request 46881 was acted upon. > Transaction: Ticket created by maz@mlx.net > Queue: Search-QueryParser-SQL > Subject: INTs are being fuzzified > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: maz@mlx.net > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=46881 > > > > Adding the following to the _doctor_value sub is how I fixed it. > > my $value = $subQ->{value}; > > + if($self->{_parser}->{_is_int}->{ $subQ->{field} }) { > + return $value; > + } > > John Maslanik > >
Thanks. It was a little more complicated than that but definitely was on my todo list. I just needed the push to get it done. Please try svn trunk from here and confirm that it works for you and I'll release a new version to CPAN. https://svn.msi.umn.edu/sw/perl/Search-QueryParser-SQL/trunk/ -- Peter Karman . http://peknet.com/ . peter@peknet.com
MIME-Version: 1.0 (Apple Message framework v929.2)
X-Spam-Status: No, hits=2.5 required=8.0 tests=FRT_TODAY2,SPF_PASS
In-Reply-To: <rt-3.6.HEAD-13950-1244816683-1395.46881-6-0 [...] rt.cpan.org>
X-Mailer: Apple Mail (2.929.2)
References: <RT-Ticket-46881 [...] rt.cpan.org> <DACEED66-F05D-4459-821F-C1D105734A6F [...] mlx.net> <rt-3.6.HEAD-13950-1244798458-1013.46881-4-0 [...] rt.cpan.org> <4A326517.70104 [...] peknet.com> <rt-3.6.HEAD-13950-1244816683-1395.46881-6-0 [...] rt.cpan.org>
X-Virus-Scanned: amavisd-new at squirtle.mlx.net
Message-ID: <0AF14BE5-7AB4-4A8C-BF16-1104D98810F3 [...] mlx.net>
Content-Type: text/plain; charset="utf-8"; delsp="yes"; format="flowed"
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id 038E619B8253 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Mon, 15 Jun 2009 08:52:18 -0400 (EDT)
Received: (qmail 29363 invoked by uid 103); 15 Jun 2009 12:52:18 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 15 Jun 2009 12:52:18 -0000
Received: from squirtle.mlx.net (HELO squirtle.mlx.net) (206.71.172.5) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Mon, 15 Jun 2009 05:52:12 -0700
Received: from localhost (localhost [127.0.0.1]) by squirtle.mlx.net (Postfix) with ESMTP id 1D3CE528001 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Mon, 15 Jun 2009 05:50:20 -0700 (PDT)
Received: from squirtle.mlx.net ([127.0.0.1]) by localhost (squirtle.mlx.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LlBvboIIlNSa for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Mon, 15 Jun 2009 05:50:16 -0700 (PDT)
Received: from [192.168.1.6] (unknown [203.213.220.150]) by squirtle.mlx.net (Postfix) with ESMTP id B7773C10020 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Mon, 15 Jun 2009 05:50:15 -0700 (PDT)
Delivered-To: cpan-bug+Search-QueryParser-SQL [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #46881] INTs are being fuzzified
Return-Path: <maz [...] mlx.net>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Search-QueryParser-SQL [...] rt.cpan.org
Date: Mon, 15 Jun 2009 20:52:03 +0800
X-Spam-Level: **
To: bug-Search-QueryParser-SQL [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: John Maslanik <maz [...] mlx.net>
RT-Message-ID: <rt-3.6.HEAD-13950-1245070348-245.46881-0-0 [...] rt.cpan.org>
Content-Length: 3093
Peter, Thank you for the quick response. I apologize for my delay. I would be more than happy to test your changes, but I have hacked another feature into my copy. I needed to have the ability to have aliases for field names. For example, I use DBIx::Class and have a query that queries Inventory, InventoryXArtists and Artists tables. If I had inventory_id in my field list, the query would fail because inventory_id is in both inventory and inventoryxartist tables. So what I did was add an extra parameter to the constructor called "aliases" that consists of a hash of aliases. (i.e. { 'inventory_id' => 'me.inventory_id', 'name' => 'artist.name' }). I then added code that in your column loop after the "TODO better operator selection" comment that checks aliases and renames columns if they exists. I also want to add some type of call back functionality that handles things such as the following situation. The inventory table can be queried looking for entries added in the last x days. So when someone enters recent:30, the query needs to end up being, 'to_days(now()) - to_days(me.date_created) <= $recent'. Now that I'm thinking about it, the aliases feature handles everything but changing the operator. I would love to change columns to be something like: $columns = { 'column_name' => { 'type' => 'int|char|etc", 'alias' => 'name to use for sql query', 'op' => 'name of op to force', 'callback' => 'call to function that takes $column, $op, and $value and returns what's pushed on to buf' } } unfortunately I think that would break backwards compatibility. Maybe I could put something that loops through the columns hash, checking if the members are a string or a hash and convert them if needed. What are your thoughts? I'm more than willing to do the code, all you have to do is review it and submit it. Thanks, John Maslanik On Jun 12, 2009, at 10:24 PM, peter@peknet.com via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=46881 > > > John Maslanik via RT wrote on 6/12/09 4:21 AM:
>> Fri Jun 12 05:20:57 2009: Request 46881 was acted upon. >> Transaction: Ticket created by maz@mlx.net >> Queue: Search-QueryParser-SQL >> Subject: INTs are being fuzzified >> Broken in: (no value) >> Severity: (no value) >> Owner: Nobody >> Requestors: maz@mlx.net >> Status: new >> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=46881 > >> >> >> Adding the following to the _doctor_value sub is how I fixed it. >> >> my $value = $subQ->{value}; >> >> + if($self->{_parser}->{_is_int}->{ $subQ->{field} }) { >> + return $value; >> + } >> >> John Maslanik >> >>
> > Thanks. It was a little more complicated than that but definitely > was on my todo > list. I just needed the push to get it done. > > Please try svn trunk from here and confirm that it works for you and > I'll > release a new version to CPAN. > > https://svn.msi.umn.edu/sw/perl/Search-QueryParser-SQL/trunk/ > > -- > Peter Karman . http://peknet.com/ . peter@peknet.com >
MIME-Version: 1.0
X-Spam-Status: No, hits=2.5 required=8.0 tests=FRT_TODAY2
In-Reply-To: <rt-3.6.HEAD-13950-1245070348-245.46881-5-0 [...] rt.cpan.org>
References: <RT-Ticket-46881 [...] rt.cpan.org> <DACEED66-F05D-4459-821F-C1D105734A6F [...] mlx.net> <rt-3.6.HEAD-13950-1244798458-1013.46881-4-0 [...] rt.cpan.org> <4A326517.70104 [...] peknet.com> <rt-3.6.HEAD-13950-1244816683-1395.46881-6-0 [...] rt.cpan.org> <0AF14BE5-7AB4-4A8C-BF16-1104D98810F3 [...] mlx.net> <rt-3.6.HEAD-13950-1245070348-245.46881-5-0 [...] rt.cpan.org>
Message-ID: <4A36F314.4060400 [...] peknet.com>
Content-Type: text/plain; charset=UTF-8
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id 22F124D80D7 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Mon, 15 Jun 2009 21:19:26 -0400 (EDT)
Received: (qmail 26573 invoked by uid 103); 16 Jun 2009 01:19:26 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 16 Jun 2009 01:19:26 -0000
Received: from conn.mc.mpls.visi.com (HELO conn-smtp.mc.mpls.visi.com) (208.42.156.2) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Mon, 15 Jun 2009 18:19:20 -0700
Received: from pekmac.local (karman.dsl.visi.com [209.98.116.241]) by conn-smtp.mc.mpls.visi.com (Postfix) with ESMTP id F0E8F11B437 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Mon, 15 Jun 2009 20:19:16 -0500 (CDT)
Received: from pekmac.local (localhost [127.0.0.1]) by pekmac.local (Postfix) with ESMTP id AD63DFF135 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Mon, 15 Jun 2009 20:19:16 -0500 (CDT)
Delivered-To: cpan-bug+Search-QueryParser-SQL [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #46881] INTs are being fuzzified
User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302)
Return-Path: <peter [...] peknet.com>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Search-QueryParser-SQL [...] rt.cpan.org
Date: Mon, 15 Jun 2009 20:19:16 -0500
X-Spam-Level: **
To: bug-Search-QueryParser-SQL [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Peter Karman <peter [...] peknet.com>
RT-Message-ID: <rt-3.6.HEAD-13950-1245115178-434.46881-0-0 [...] rt.cpan.org>
Content-Length: 2488
Download (untitled) / with headers
text/plain 2.4k
John Maslanik via RT wrote on 6/15/09 7:52 AM: Show quoted text
> Queue: Search-QueryParser-SQL > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=46881 > > > Peter, > > Thank you for the quick response. I apologize for my delay. I would > be more than happy to test your changes, but I have hacked another > feature into my copy. I needed to have the ability to have aliases > for field names. For example, I use DBIx::Class and have a query that > queries Inventory, InventoryXArtists and Artists tables. If I had > inventory_id in my field list, the query would fail because > inventory_id is in both inventory and inventoryxartist tables. So > what I did was add an extra parameter to the constructor called > "aliases" that consists of a hash of aliases. (i.e. { 'inventory_id' > => 'me.inventory_id', 'name' => 'artist.name' }). I then added code > that in your column loop after the "TODO better operator selection" > comment that checks aliases and renames columns if they exists. > > I also want to add some type of call back functionality that handles > things such as the following situation. > > The inventory table can be queried looking for entries added in the > last x days. So when someone enters recent:30, the query needs to end > up being, 'to_days(now()) - to_days(me.date_created) <= $recent'. Now > that I'm thinking about it, the aliases feature handles everything but > changing the operator. > > I would love to change columns to be something like: > > $columns = { > 'column_name' => { > 'type' => 'int|char|etc", > 'alias' => 'name to use for sql query', > 'op' => 'name of op to force', > 'callback' => 'call to function that takes $column, $op, and $value > and returns what's pushed on to buf' > } > } > > unfortunately I think that would break backwards compatibility. > > Maybe I could put something that loops through the columns hash, > checking if the members are a string or a hash and convert them if > needed. > > What are your thoughts? I'm more than willing to do the code, all you > have to do is review it and submit it. >
column aliases, etc., sound fine, as long as current tests pass. feel free to patch against svn trunk here: https://svn.msi.umn.edu/sw/perl/Search-QueryParser-SQL/trunk/ be sure to include tests and docs for the new features. -- Peter Karman . http://peknet.com/ . peter@peknet.com gpg key: 37D2 DAA6 3A13 D415 4295 3A69 448F E556 374A 34D9
MIME-Version: 1.0 (Apple Message framework v929.2)
X-Spam-Status: No, hits=2.5 required=8.0 tests=FRT_TODAY2,SPF_PASS
In-Reply-To: <rt-3.6.HEAD-13950-1245115178-434.46881-6-0 [...] rt.cpan.org>
X-Mailer: Apple Mail (2.929.2)
References: <RT-Ticket-46881 [...] rt.cpan.org> <DACEED66-F05D-4459-821F-C1D105734A6F [...] mlx.net> <rt-3.6.HEAD-13950-1244798458-1013.46881-4-0 [...] rt.cpan.org> <4A326517.70104 [...] peknet.com> <rt-3.6.HEAD-13950-1244816683-1395.46881-6-0 [...] rt.cpan.org> <0AF14BE5-7AB4-4A8C-BF16-1104D98810F3 [...] mlx.net> <rt-3.6.HEAD-13950-1245070348-245.46881-5-0 [...] rt.cpan.org> <4A36F314.4060400 [...] peknet.com> <rt-3.6.HEAD-13950-1245115178-434.46881-6-0 [...] rt.cpan.org>
X-Virus-Checked: Checked by ClamAV on 16.mx.develooper.com
X-Virus-Scanned: amavisd-new at squirtle.mlx.net
Message-ID: <529C8A5F-0A76-4C71-9806-654767A474FC [...] mlx.net>
Content-Type: multipart/mixed; boundary=Apple-Mail-10-624478347
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id B952D4D80C0 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Wed, 17 Jun 2009 02:21:09 -0400 (EDT)
Received: (qmail 19021 invoked by uid 103); 17 Jun 2009 06:21:09 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 17 Jun 2009 06:21:09 -0000
Received: from squirtle.mlx.net (HELO squirtle.mlx.net) (206.71.172.5) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Tue, 16 Jun 2009 23:21:03 -0700
Received: from localhost (localhost [127.0.0.1]) by squirtle.mlx.net (Postfix) with ESMTP id 499CDC10022 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Tue, 16 Jun 2009 23:19:06 -0700 (PDT)
Received: from squirtle.mlx.net ([127.0.0.1]) by localhost (squirtle.mlx.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EHdDHF9JsCW2 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Tue, 16 Jun 2009 23:19:02 -0700 (PDT)
Received: from [192.168.1.6] (unknown [203.213.220.150]) by squirtle.mlx.net (Postfix) with ESMTP id AD880C10021 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Tue, 16 Jun 2009 23:19:00 -0700 (PDT)
Delivered-To: cpan-bug+Search-QueryParser-SQL [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #46881] INTs are being fuzzified
Return-Path: <maz [...] mlx.net>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Search-QueryParser-SQL [...] rt.cpan.org
Date: Wed, 17 Jun 2009 14:20:50 +0800
X-Spam-Level: **
To: bug-Search-QueryParser-SQL [...] rt.cpan.org
From: John Maslanik <maz [...] mlx.net>
RT-Message-ID: <rt-3.6.HEAD-13950-1245219679-430.46881-0-0 [...] rt.cpan.org>
Content-Length: 0
Content-Type: text/plain; charset="utf-8"; delsp="yes"; format="flowed"
Content-Transfer-Encoding: 7bit
X-RT-Original-Encoding: utf-8
Content-Length: 824
Download (untitled) / with headers
text/plain 824b
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. Thanks, John Maslanik
content-type: text/x-perl-script; name="SQL.pm"; x-unix-mode="0644"
content-disposition: attachment; filename="SQL.pm"
Content-Transfer-Encoding: 7bit
Content-Length: 6174
Download SQL.pm
text/x-perl 6k

Message body is not shown because sender requested not to inline it.

content-type: text/x-perl-script; name="Query.pm"; x-unix-mode="0644"
content-disposition: attachment; filename="Query.pm"
Content-Transfer-Encoding: 7bit
Content-Length: 9527
Download Query.pm
text/x-perl 9.3k

Message body is not shown because sender requested not to inline it.

Content-Type: text/plain; charset="utf-8"; delsp="yes"; format="flowed"
Content-Transfer-Encoding: 7bit
X-RT-Original-Encoding: utf-8
Content-Length: 2663
Download (untitled) / with headers
text/plain 2.6k
On Jun 16, 2009, at 9:19 AM, peter@peknet.com via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=46881 > > > John Maslanik via RT wrote on 6/15/09 7:52 AM:
>> Queue: Search-QueryParser-SQL >> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=46881 > >> >> Peter, >> >> Thank you for the quick response. I apologize for my delay. I would >> be more than happy to test your changes, but I have hacked another >> feature into my copy. I needed to have the ability to have aliases >> for field names. For example, I use DBIx::Class and have a query >> that >> queries Inventory, InventoryXArtists and Artists tables. If I had >> inventory_id in my field list, the query would fail because >> inventory_id is in both inventory and inventoryxartist tables. So >> what I did was add an extra parameter to the constructor called >> "aliases" that consists of a hash of aliases. (i.e. >> { 'inventory_id' >> => 'me.inventory_id', 'name' => 'artist.name' }). I then added code >> that in your column loop after the "TODO better operator selection" >> comment that checks aliases and renames columns if they exists. >> >> I also want to add some type of call back functionality that handles >> things such as the following situation. >> >> The inventory table can be queried looking for entries added in the >> last x days. So when someone enters recent:30, the query needs to >> end >> up being, 'to_days(now()) - to_days(me.date_created) <= $recent'. >> Now >> that I'm thinking about it, the aliases feature handles everything >> but >> changing the operator. >> >> I would love to change columns to be something like: >> >> $columns = { >> 'column_name' => { >> 'type' => 'int|char|etc", >> 'alias' => 'name to use for sql query', >> 'op' => 'name of op to force', >> 'callback' => 'call to function that takes $column, $op, and $value >> and returns what's pushed on to buf' >> } >> } >> >> unfortunately I think that would break backwards compatibility. >> >> Maybe I could put something that loops through the columns hash, >> checking if the members are a string or a hash and convert them if >> needed. >> >> What are your thoughts? I'm more than willing to do the code, all >> you >> have to do is review it and submit it. >>
> > column aliases, etc., sound fine, as long as current tests pass. > > feel free to patch against svn trunk here: > > https://svn.msi.umn.edu/sw/perl/Search-QueryParser-SQL/trunk/ > > be sure to include tests and docs for the new features. > > -- > Peter Karman . http://peknet.com/ . peter@peknet.com > gpg key: 37D2 DAA6 3A13 D415 4295 3A69 448F E556 374A 34D9 >
MIME-Version: 1.0
X-Spam-Status: No, hits=0.0 required=8.0 tests=
In-Reply-To: <rt-3.6.HEAD-13950-1245219679-430.46881-5-0 [...] rt.cpan.org>
References: <RT-Ticket-46881 [...] rt.cpan.org> <DACEED66-F05D-4459-821F-C1D105734A6F [...] mlx.net> <rt-3.6.HEAD-13950-1244798458-1013.46881-4-0 [...] rt.cpan.org> <4A326517.70104 [...] peknet.com> <rt-3.6.HEAD-13950-1244816683-1395.46881-6-0 [...] rt.cpan.org> <0AF14BE5-7AB4-4A8C-BF16-1104D98810F3 [...] mlx.net> <rt-3.6.HEAD-13950-1245070348-245.46881-5-0 [...] rt.cpan.org> <4A36F314.4060400 [...] peknet.com> <rt-3.6.HEAD-13950-1245115178-434.46881-6-0 [...] rt.cpan.org> <529C8A5F-0A76-4C71-9806-654767A474FC [...] mlx.net> <rt-3.6.HEAD-13950-1245219679-430.46881-5-0 [...] rt.cpan.org>
Message-ID: <4A399EEB.6060409 [...] peknet.com>
Content-Type: text/plain; charset=UTF-8
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id 634784D8164 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Wed, 17 Jun 2009 21:57:10 -0400 (EDT)
Received: (qmail 24403 invoked by uid 103); 18 Jun 2009 01:57:09 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 18 Jun 2009 01:57:09 -0000
Received: from conn.mc.mpls.visi.com (HELO conn-smtp.mc.mpls.visi.com) (208.42.156.2) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Wed, 17 Jun 2009 18:57:03 -0700
Received: from pekmac.local (karman.dsl.visi.com [209.98.116.241]) by conn-smtp.mc.mpls.visi.com (Postfix) with ESMTP id 30DE611B694 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Wed, 17 Jun 2009 20:57:00 -0500 (CDT)
Received: from pekmac.local (localhost [127.0.0.1]) by pekmac.local (Postfix) with ESMTP id DBA4FFF5FE for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Wed, 17 Jun 2009 20:56:59 -0500 (CDT)
Delivered-To: cpan-bug+Search-QueryParser-SQL [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #46881] INTs are being fuzzified
User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302)
Return-Path: <peter [...] peknet.com>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Search-QueryParser-SQL [...] rt.cpan.org
Date: Wed, 17 Jun 2009 20:56:59 -0500
X-Spam-Level: *
To: bug-Search-QueryParser-SQL [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Peter Karman <peter [...] peknet.com>
RT-Message-ID: <rt-3.6.HEAD-13950-1245290239-1365.46881-0-0 [...] rt.cpan.org>
Content-Length: 2542
Download (untitled) / with headers
text/plain 2.4k
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
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-13950-1245290239-1365.46881-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Charset: utf8
References: <RT-Ticket-46881 [...] rt.cpan.org> <DACEED66-F05D-4459-821F-C1D105734A6F [...] mlx.net> <rt-3.6.HEAD-13950-1244798458-1013.46881-4-0 [...] rt.cpan.org> <4A326517.70104 [...] peknet.com> <rt-3.6.HEAD-13950-1244816683-1395.46881-6-0 [...] rt.cpan.org> <0AF14BE5-7AB4-4A8C-BF16-1104D98810F3 [...] mlx.net> <rt-3.6.HEAD-13950-1245070348-245.46881-5-0 [...] rt.cpan.org> <4A36F314.4060400 [...] peknet.com> <rt-3.6.HEAD-13950-1245115178-434.46881-6-0 [...] rt.cpan.org> <529C8A5F-0A76-4C71-9806-654767A474FC [...] mlx.net> <rt-3.6.HEAD-13950-1245219679-430.46881-5-0 [...] rt.cpan.org> <4A399EEB.6060409 [...] peknet.com> <rt-3.6.HEAD-13950-1245290239-1365.46881-0-0 [...] rt.cpan.org>
Content-Type: text/plain
Message-ID: <rt-3.6.HEAD-13950-1245736963-1171.46881-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 2827
Download (untitled) / with headers
text/plain 2.7k
Thanks Peter for creating this module and John for your efforts to enhance it. I'm stuck with the same new features you need. I downloaded and tried your patches, and found that all of the tests worked. On Wed Jun 17 21:57:19 2009, peter@peknet.com wrote: Show quoted text
> John Maslanik via RT wrote on 6/17/09 1:21 AM:
> > 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
MIME-Version: 1.0
X-Spam-Status: No, hits=0.0 required=8.0 tests=
In-Reply-To: <rt-3.6.HEAD-13950-1245736963-1171.46881-5-0 [...] rt.cpan.org>
References: <RT-Ticket-46881 [...] rt.cpan.org> <DACEED66-F05D-4459-821F-C1D105734A6F [...] mlx.net> <rt-3.6.HEAD-13950-1244798458-1013.46881-4-0 [...] rt.cpan.org> <4A326517.70104 [...] peknet.com> <4A36F314.4060400 [...] peknet.com> <rt-3.6.HEAD-13950-1245115178-434.46881-6-0 [...] rt.cpan.org> <529C8A5F-0A76-4C71-9806-654767A474FC [...] mlx.net> <rt-3.6.HEAD-13950-1245219679-430.46881-5-0 [...] rt.cpan.org> <4A399EEB.6060409 [...] peknet.com> <rt-3.6.HEAD-13950-1245290239-1365.46881-5-0 [...] rt.cpan.org> <rt-3.6.HEAD-13950-1245736963-1171.46881-5-0 [...] rt.cpan.org>
Message-ID: <4A443E90.6010902 [...] peknet.com>
Content-Type: text/plain; charset=UTF-8
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id 00F464D801B for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Thu, 25 Jun 2009 23:20:58 -0400 (EDT)
Received: (qmail 29634 invoked by uid 103); 26 Jun 2009 03:20:58 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 26 Jun 2009 03:20:58 -0000
Received: from conn.mc.mpls.visi.com (HELO conn-smtp.mc.mpls.visi.com) (208.42.156.2) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Thu, 25 Jun 2009 20:20:52 -0700
Received: from pekmac.local (karman.dsl.visi.com [209.98.116.241]) by conn-smtp.mc.mpls.visi.com (Postfix) with ESMTP id 6A9E411B527 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Thu, 25 Jun 2009 22:20:49 -0500 (CDT)
Received: from pekmac.local (localhost [127.0.0.1]) by pekmac.local (Postfix) with ESMTP id F00331040F9 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Thu, 25 Jun 2009 22:20:48 -0500 (CDT)
Delivered-To: cpan-bug+Search-QueryParser-SQL [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #46881] INTs are being fuzzified
User-Agent: Thunderbird 2.0.0.22 (Macintosh/20090605)
Return-Path: <peter [...] peknet.com>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Search-QueryParser-SQL [...] rt.cpan.org
Date: Thu, 25 Jun 2009 22:20:48 -0500
X-Spam-Level: *
To: bug-Search-QueryParser-SQL [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Peter Karman <peter [...] peknet.com>
RT-Message-ID: <rt-3.6.HEAD-22552-1245986468-996.46881-0-0 [...] rt.cpan.org>
Content-Length: 686
Download (untitled) / with headers
text/plain 686b
Joe Slagel via RT wrote on 6/23/09 1:02 AM: Show quoted text
> Queue: Search-QueryParser-SQL > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=46881 > > > Thanks Peter for creating this module and John for your efforts to > enhance it. I'm stuck with the same new features you need. I > downloaded and tried your patches, and found that all of the tests worked.
yes, John's patches will pass against the tests in the released CPAN version 0.007. But they do not pass the tests in svn trunk here: https://svn.msi.umn.edu/sw/perl/Search-QueryParser-SQL/trunk -- Peter Karman . http://peknet.com/ . peter@peknet.com gpg key: 37D2 DAA6 3A13 D415 4295 3A69 448F E556 374A 34D9
MIME-Version: 1.0 (Apple Message framework v929.2)
X-Spam-Status: No, hits=-0.0 required=8.0 tests=SPF_PASS
In-Reply-To: <rt-3.6.HEAD-22552-1245986468-996.46881-6-0 [...] rt.cpan.org>
X-Mailer: Apple Mail (2.929.2)
References: <RT-Ticket-46881 [...] rt.cpan.org> <DACEED66-F05D-4459-821F-C1D105734A6F [...] mlx.net> <rt-3.6.HEAD-13950-1244798458-1013.46881-4-0 [...] rt.cpan.org> <4A326517.70104 [...] peknet.com> <529C8A5F-0A76-4C71-9806-654767A474FC [...] mlx.net> <rt-3.6.HEAD-13950-1245219679-430.46881-5-0 [...] rt.cpan.org> <4A399EEB.6060409 [...] peknet.com> <rt-3.6.HEAD-13950-1245290239-1365.46881-5-0 [...] rt.cpan.org> <rt-3.6.HEAD-13950-1245736963-1171.46881-5-0 [...] rt.cpan.org> <4A443E90.6010902 [...] peknet.com> <rt-3.6.HEAD-22552-1245986468-996.46881-6-0 [...] rt.cpan.org>
X-Virus-Scanned: amavisd-new at squirtle.mlx.net
Message-ID: <1806E5D6-273C-4CA7-8EAB-E99DD5B9625D [...] mlx.net>
Content-Type: text/plain; charset="utf-8"; delsp="yes"; format="flowed"
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id 2A7944D801B for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Thu, 25 Jun 2009 23:25:36 -0400 (EDT)
Received: (qmail 30640 invoked by uid 103); 26 Jun 2009 03:25:36 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 26 Jun 2009 03:25:36 -0000
Received: from squirtle.mlx.net (HELO squirtle.mlx.net) (206.71.172.5) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Thu, 25 Jun 2009 20:25:31 -0700
Received: from localhost (localhost [127.0.0.1]) by squirtle.mlx.net (Postfix) with ESMTP id BE943C10023 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Thu, 25 Jun 2009 20:25:27 -0700 (PDT)
Received: from squirtle.mlx.net ([127.0.0.1]) by localhost (squirtle.mlx.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W2d6nuyMOWxc for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Thu, 25 Jun 2009 20:25:24 -0700 (PDT)
Received: from [192.168.1.7] (unknown [203.213.220.150]) by squirtle.mlx.net (Postfix) with ESMTP id 71DC4C10022 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Thu, 25 Jun 2009 20:25:23 -0700 (PDT)
Delivered-To: cpan-bug+Search-QueryParser-SQL [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #46881] INTs are being fuzzified
Return-Path: <maz [...] mlx.net>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Search-QueryParser-SQL [...] rt.cpan.org
Date: Fri, 26 Jun 2009 11:25:19 +0800
X-Spam-Level: *
To: bug-Search-QueryParser-SQL [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: John Maslanik <maz [...] mlx.net>
RT-Message-ID: <rt-3.6.HEAD-22552-1245986746-1853.46881-0-0 [...] rt.cpan.org>
Content-Length: 1108
They don't pass the svn trunk because of a difference in the defaulting of the int operators '<=' vs '>='. If you change the default to what the test expects, it will work. As soon as I find some spare time, I'll write tests for the other new features. John On Jun 26, 2009, at 11:21 AM, peter@peknet.com via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=46881 > > > Joe Slagel via RT wrote on 6/23/09 1:02 AM:
>> Queue: Search-QueryParser-SQL >> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=46881 > >> >> Thanks Peter for creating this module and John for your efforts to >> enhance it. I'm stuck with the same new features you need. I >> downloaded and tried your patches, and found that all of the tests >> worked.
> > yes, John's patches will pass against the tests in the released CPAN > version > 0.007. But they do not pass the tests in svn trunk here: > > https://svn.msi.umn.edu/sw/perl/Search-QueryParser-SQL/trunk > > > -- > Peter Karman . http://peknet.com/ . peter@peknet.com > gpg key: 37D2 DAA6 3A13 D415 4295 3A69 448F E556 374A 34D9 >
MIME-Version: 1.0
X-Spam-Status: No, hits=0.0 required=8.0 tests=
In-Reply-To: <rt-3.6.HEAD-22552-1245986746-1853.46881-5-0 [...] rt.cpan.org>
References: <RT-Ticket-46881 [...] rt.cpan.org> <DACEED66-F05D-4459-821F-C1D105734A6F [...] mlx.net> <rt-3.6.HEAD-13950-1244798458-1013.46881-4-0 [...] rt.cpan.org> <4A326517.70104 [...] peknet.com> <4A399EEB.6060409 [...] peknet.com> <rt-3.6.HEAD-13950-1245290239-1365.46881-5-0 [...] rt.cpan.org> <rt-3.6.HEAD-13950-1245736963-1171.46881-5-0 [...] rt.cpan.org> <4A443E90.6010902 [...] peknet.com> <rt-3.6.HEAD-22552-1245986468-996.46881-6-0 [...] rt.cpan.org> <1806E5D6-273C-4CA7-8EAB-E99DD5B9625D [...] mlx.net> <rt-3.6.HEAD-22552-1245986746-1853.46881-5-0 [...] rt.cpan.org>
Message-ID: <4A4441B9.307 [...] peknet.com>
Content-Type: text/plain; charset=UTF-8
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id CB2E44D801B for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Thu, 25 Jun 2009 23:34:26 -0400 (EDT)
Received: (qmail 494 invoked by uid 103); 26 Jun 2009 03:34:26 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 26 Jun 2009 03:34:26 -0000
Received: from cenn.mc.mpls.visi.com (HELO cenn-smtp.mc.mpls.visi.com) (208.42.156.9) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Thu, 25 Jun 2009 20:34:20 -0700
Received: from pekmac.local (karman.dsl.visi.com [209.98.116.241]) by cenn-smtp.mc.mpls.visi.com (Postfix) with ESMTP id A58E91E6840 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Thu, 25 Jun 2009 22:34:17 -0500 (CDT)
Received: from pekmac.local (localhost [127.0.0.1]) by pekmac.local (Postfix) with ESMTP id 44D37104101 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Thu, 25 Jun 2009 22:34:17 -0500 (CDT)
Delivered-To: cpan-bug+Search-QueryParser-SQL [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #46881] INTs are being fuzzified
User-Agent: Thunderbird 2.0.0.22 (Macintosh/20090605)
Return-Path: <peter [...] peknet.com>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Search-QueryParser-SQL [...] rt.cpan.org
Date: Thu, 25 Jun 2009 22:34:17 -0500
X-Spam-Level: *
To: bug-Search-QueryParser-SQL [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Peter Karman <peter [...] peknet.com>
RT-Message-ID: <rt-3.6.HEAD-22552-1245987276-1624.46881-0-0 [...] rt.cpan.org>
Content-Length: 1151
Download (untitled) / with headers
text/plain 1.1k
John Maslanik via RT wrote on 6/25/09 10:25 PM: Show quoted text
> Queue: Search-QueryParser-SQL > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=46881 > > > They don't pass the svn trunk because of a difference in the > defaulting of the int operators '<=' vs '>='. If you change the > default to what the test expects, it will work. As soon as I find > some spare time, I'll write tests for the other new features. >
ah, ok. I see that change with the int operator. Which brings up a good point. My assumption was that a query like: 1* means: match 1 or 10 or 1nnnnnn i.e., >= 1 but your change means it will render as: <= 1 which doesn't seem right to me. I.e., match 1 or 0 or -6534. I guess the wildcard in a numerical context is open to interpretation. Same thing with dates. I assume that: 2009-* means: match any date in 2009 so should probably be expanded to: Show quoted text
>= 2009-01-01 AND <= 2009-12-31
So what should the behavior be? I'm not saying that >= is correct, but <= seems less correct. -- Peter Karman . http://peknet.com/ . peter@peknet.com gpg key: 37D2 DAA6 3A13 D415 4295 3A69 448F E556 374A 34D9
MIME-Version: 1.0 (Apple Message framework v929.2)
X-Spam-Status: No, hits=-0.0 required=8.0 tests=SPF_PASS
In-Reply-To: <rt-3.6.HEAD-22552-1245987276-1624.46881-6-0 [...] rt.cpan.org>
X-Mailer: Apple Mail (2.929.2)
References: <RT-Ticket-46881 [...] rt.cpan.org> <DACEED66-F05D-4459-821F-C1D105734A6F [...] mlx.net> <rt-3.6.HEAD-13950-1244798458-1013.46881-4-0 [...] rt.cpan.org> <4A326517.70104 [...] peknet.com> <rt-3.6.HEAD-13950-1245736963-1171.46881-5-0 [...] rt.cpan.org> <4A443E90.6010902 [...] peknet.com> <rt-3.6.HEAD-22552-1245986468-996.46881-6-0 [...] rt.cpan.org> <1806E5D6-273C-4CA7-8EAB-E99DD5B9625D [...] mlx.net> <rt-3.6.HEAD-22552-1245986746-1853.46881-5-0 [...] rt.cpan.org> <4A4441B9.307 [...] peknet.com> <rt-3.6.HEAD-22552-1245987276-1624.46881-6-0 [...] rt.cpan.org>
X-Virus-Scanned: amavisd-new at squirtle.mlx.net
Message-ID: <12BC9398-F22D-4C85-8325-37940442A80C [...] mlx.net>
Content-Type: text/plain; charset="utf-8"; delsp="yes"; format="flowed"
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id 0408019B81E0 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Fri, 26 Jun 2009 02:31:05 -0400 (EDT)
Received: (qmail 7365 invoked by uid 103); 26 Jun 2009 06:31:05 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 26 Jun 2009 06:31:05 -0000
Received: from squirtle.mlx.net (HELO squirtle.mlx.net) (206.71.172.5) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Thu, 25 Jun 2009 23:30:59 -0700
Received: from localhost (localhost [127.0.0.1]) by squirtle.mlx.net (Postfix) with ESMTP id 0B848C10023 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Thu, 25 Jun 2009 23:30:56 -0700 (PDT)
Received: from squirtle.mlx.net ([127.0.0.1]) by localhost (squirtle.mlx.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G8rU1dcHNXxn for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Thu, 25 Jun 2009 23:30:52 -0700 (PDT)
Received: from [192.168.1.7] (unknown [203.213.220.150]) by squirtle.mlx.net (Postfix) with ESMTP id EE17AC10022 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Thu, 25 Jun 2009 23:30:50 -0700 (PDT)
Delivered-To: cpan-bug+Search-QueryParser-SQL [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #46881] INTs are being fuzzified
Return-Path: <maz [...] mlx.net>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Search-QueryParser-SQL [...] rt.cpan.org
Date: Fri, 26 Jun 2009 14:30:46 +0800
X-Spam-Level: *
To: bug-Search-QueryParser-SQL [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: John Maslanik <maz [...] mlx.net>
RT-Message-ID: <rt-3.6.HEAD-22552-1245997875-286.46881-0-0 [...] rt.cpan.org>
Content-Length: 1826
Download (untitled) / with headers
text/plain 1.7k
Peter, LOL. My assumptions were based on thing like year_issued and price, with a default sort of ascending. So if someone entered $100, the first in the list would be 100. I figured everyone would have a difference of opinion as to what the default int operator should be, which is why I added the 'int_op' option to the constructor. Could also depend on the application. I could imagine a status field rendered by a select box being '=' and not < or >. John On Jun 26, 2009, at 11:34 AM, peter@peknet.com via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=46881 > > > John Maslanik via RT wrote on 6/25/09 10:25 PM:
>> Queue: Search-QueryParser-SQL >> Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=46881 > >> >> They don't pass the svn trunk because of a difference in the >> defaulting of the int operators '<=' vs '>='. If you change the >> default to what the test expects, it will work. As soon as I find >> some spare time, I'll write tests for the other new features. >>
> > ah, ok. I see that change with the int operator. Which brings up a > good point. > My assumption was that a query like: > > 1* > > means: > > match 1 or 10 or 1nnnnnn > > i.e., >= 1 > > but your change means it will render as: > > <= 1 > > which doesn't seem right to me. I.e., > > match 1 or 0 or -6534. > > I guess the wildcard in a numerical context is open to > interpretation. Same > thing with dates. I assume that: > > 2009-* > > means: > > match any date in 2009 > > so should probably be expanded to: >
>> = 2009-01-01 AND <= 2009-12-31
> > > So what should the behavior be? I'm not saying that >= is correct, > but <= seems > less correct. > > -- > Peter Karman . http://peknet.com/ . peter@peknet.com > gpg key: 37D2 DAA6 3A13 D415 4295 3A69 448F E556 374A 34D9 >
X-Asg-Orig-Subj: Re: [rt.cpan.org #46881] INTs are being fuzzified
X-Originalarrivaltime: 26 Jun 2009 15:44:39.0629 (UTC) FILETIME=[040C47D0:01C9F675]
X-Barracuda-Connect: hqesnode02.mpr.org[10.2.2.101]
MIME-Version: 1.0
X-Spam-Status: No, hits=0.0 required=8.0 tests=
In-Reply-To: <rt-3.6.HEAD-22552-1245997875-286.46881-5-0 [...] rt.cpan.org>
X-Asg-Whitelist: Client
X-Barracuda-Virus-Scanned: by Barracuda Spam & Virus Firewall at mpr.org
X-Barracuda-Envelope-From: peter [...] peknet.com
References: <RT-Ticket-46881 [...] rt.cpan.org> <DACEED66-F05D-4459-821F-C1D105734A6F [...] mlx.net> <rt-3.6.HEAD-13950-1244798458-1013.46881-4-0 [...] rt.cpan.org> <4A326517.70104 [...] peknet.com> <rt-3.6.HEAD-22552-1245986468-996.46881-6-0 [...] rt.cpan.org> <1806E5D6-273C-4CA7-8EAB-E99DD5B9625D [...] mlx.net> <rt-3.6.HEAD-22552-1245986746-1853.46881-5-0 [...] rt.cpan.org> <4A4441B9.307 [...] peknet.com> <rt-3.6.HEAD-22552-1245987276-1624.46881-6-0 [...] rt.cpan.org> <12BC9398-F22D-4C85-8325-37940442A80C [...] mlx.net> <rt-3.6.HEAD-22552-1245997875-286.46881-5-0 [...] rt.cpan.org>
Message-ID: <4A44ECE6.7020708 [...] peknet.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
X-Barracuda-Start-Time: 1246031079
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id 909B719B8235 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Fri, 26 Jun 2009 11:44:49 -0400 (EDT)
Received: (qmail 4127 invoked by uid 103); 26 Jun 2009 15:44:48 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 26 Jun 2009 15:44:48 -0000
Received: from barracuda.mpr.org (HELO barracuda01.mpr.org) (192.203.201.122) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Fri, 26 Jun 2009 08:44:43 -0700
Received: from HQMAIL08.mpr.org (localhost [127.0.0.1]) by barracuda01.mpr.org (Spam & Virus Firewall) with ESMTP id B324799C2F6 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Fri, 26 Jun 2009 10:44:39 -0500 (CDT)
Received: from HQMAIL08.mpr.org (hqesnode02.mpr.org [10.2.2.101]) by barracuda01.mpr.org with ESMTP id Ga7sncmcbHrRkx7a for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Fri, 26 Jun 2009 10:44:39 -0500 (CDT)
Received: from mail.mpr.org ([10.2.2.87]) by HQMAIL08.mpr.org with Microsoft SMTPSVC(6.0.3790.3959); Fri, 26 Jun 2009 10:44:39 -0500
Received: from [10.0.2.15] ([10.2.9.204]) by mail.mpr.org with Microsoft SMTPSVC(6.0.3790.3959); Fri, 26 Jun 2009 10:44:39 -0500
Delivered-To: cpan-bug+Search-QueryParser-SQL [...] diesel.bestpractical.com
User-Agent: Thunderbird 2.0.0.21 (X11/20090409)
X-Asg-Debug-ID: 1246031079-1a5001030000-ahCBLc
Subject: Re: [rt.cpan.org #46881] INTs are being fuzzified
Return-Path: <peter [...] peknet.com>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Search-QueryParser-SQL [...] rt.cpan.org
Date: Fri, 26 Jun 2009 10:44:38 -0500
X-Spam-Level: *
X-Barracuda-Url: http://barracuda.mpr.org:8000/cgi-bin/mark.cgi
To: bug-Search-QueryParser-SQL [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Peter Karman <peter [...] peknet.com>
RT-Message-ID: <rt-3.6.HEAD-25318-1246031105-287.46881-0-0 [...] rt.cpan.org>
Content-Length: 1037
John Maslanik via RT wrote: Show quoted text
> Queue: Search-QueryParser-SQL > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=46881 > > > Peter, > > LOL. My assumptions were based on thing like year_issued and price, > with a default sort of ascending. So if someone entered $100, the > first in the list would be 100. I figured everyone would have a > difference of opinion as to what the default int operator should be, > which is why I added the 'int_op' option to the constructor. Could > also depend on the application. I could imagine a status field > rendered by a select box being '=' and not < or >. > >
Ah, ok. I see now where you're coming from. Seems like each column should have a optional hashref of config, including: fuzzy_op fuzzy_not_op type where if type is set and others are not, there are some sane defaults. I'll try and refactor that direction this weekend. -- Peter Karman . http://peknet.com/ . peter@peknet.com gpg key: 37D2 DAA6 3A13 D415 4295 3A69 448F E556 374A 34D9
MIME-Version: 1.0
X-Spam-Status: No, hits=0.9 required=8.0 tests=URIBL_RHS_DOB
In-Reply-To: <rt-3.6.HEAD-13950-1245070348-245.46881-5-0 [...] rt.cpan.org>
References: <RT-Ticket-46881 [...] rt.cpan.org> <DACEED66-F05D-4459-821F-C1D105734A6F [...] mlx.net> <rt-3.6.HEAD-13950-1244798458-1013.46881-4-0 [...] rt.cpan.org> <4A326517.70104 [...] peknet.com> <rt-3.6.HEAD-13950-1244816683-1395.46881-6-0 [...] rt.cpan.org> <0AF14BE5-7AB4-4A8C-BF16-1104D98810F3 [...] mlx.net> <rt-3.6.HEAD-13950-1245070348-245.46881-5-0 [...] rt.cpan.org>
Message-ID: <4A467E29.2050204 [...] peknet.com>
Content-Type: text/plain; charset=UTF-8
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id C01B419B8184 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Sat, 27 Jun 2009 16:16:51 -0400 (EDT)
Received: (qmail 23327 invoked by uid 103); 27 Jun 2009 20:16:51 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 27 Jun 2009 20:16:51 -0000
Received: from conn.mc.mpls.visi.com (HELO conn-smtp.mc.mpls.visi.com) (208.42.156.2) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Sat, 27 Jun 2009 13:16:45 -0700
Received: from pekmac.local (karman.dsl.visi.com [209.98.116.241]) by conn-smtp.mc.mpls.visi.com (Postfix) with ESMTP id 586741207D8 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Sat, 27 Jun 2009 15:16:42 -0500 (CDT)
Received: from pekmac.local (localhost [127.0.0.1]) by pekmac.local (Postfix) with ESMTP id F05C910458B for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Sat, 27 Jun 2009 15:16:41 -0500 (CDT)
Delivered-To: cpan-bug+Search-QueryParser-SQL [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #46881] INTs are being fuzzified
User-Agent: Thunderbird 2.0.0.22 (Macintosh/20090605)
Return-Path: <peter [...] peknet.com>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Search-QueryParser-SQL [...] rt.cpan.org
Date: Sat, 27 Jun 2009 15:16:41 -0500
X-Spam-Level: *
To: bug-Search-QueryParser-SQL [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Peter Karman <peter [...] peknet.com>
RT-Message-ID: <rt-3.6.HEAD-25318-1246133821-1435.46881-0-0 [...] rt.cpan.org>
Content-Length: 804
Download (untitled) / with headers
text/plain 804b
John Maslanik via RT wrote on 6/15/09 7:52 AM: Show quoted text
> I would love to change columns to be something like: > > $columns = { > 'column_name' => { > 'type' => 'int|char|etc", > 'alias' => 'name to use for sql query', > 'op' => 'name of op to force', > 'callback' => 'call to function that takes $column, $op, and $value > and returns what's pushed on to buf' > } > }
I just checked in an implementation very similar to this. Please try svn trunk and see if it works for you: https://svn.msi.umn.edu/sw/perl/Search-QueryParser-SQL/trunk/ Trac changeset: https://trac.msi.umn.edu/trac/sw/changeset/539 If the new API works for you, I'll upload to CPAN as 0.008. Thanks. -- Peter Karman . http://peknet.com/ . peter@peknet.com gpg key: 37D2 DAA6 3A13 D415 4295 3A69 448F E556 374A 34D9
X-Asg-Orig-Subj: Re: [rt.cpan.org #46881] INTs are being fuzzified
X-Originalarrivaltime: 13 Jul 2009 17:24:36.0897 (UTC) FILETIME=[CBB88110:01CA03DE]
X-Barracuda-Connect: hqesnode02.mpr.org[10.2.2.101]
MIME-Version: 1.0
X-Spam-Status: No, hits=0.0 required=8.0 tests=
In-Reply-To: <rt-3.6.HEAD-25318-1246133821-1435.46881-5-0 [...] rt.cpan.org>
X-Asg-Whitelist: Client
X-Barracuda-Virus-Scanned: by Barracuda Spam & Virus Firewall at mpr.org
X-Barracuda-Envelope-From: peter [...] peknet.com
References: <RT-Ticket-46881 [...] rt.cpan.org> <DACEED66-F05D-4459-821F-C1D105734A6F [...] mlx.net> <rt-3.6.HEAD-13950-1244798458-1013.46881-4-0 [...] rt.cpan.org> <4A326517.70104 [...] peknet.com> <rt-3.6.HEAD-13950-1244816683-1395.46881-6-0 [...] rt.cpan.org> <0AF14BE5-7AB4-4A8C-BF16-1104D98810F3 [...] mlx.net> <rt-3.6.HEAD-13950-1245070348-245.46881-5-0 [...] rt.cpan.org> <4A467E29.2050204 [...] peknet.com> <rt-3.6.HEAD-25318-1246133821-1435.46881-5-0 [...] rt.cpan.org>
Message-ID: <4A5B6DE6.8010309 [...] peknet.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
X-Barracuda-Start-Time: 1247505877
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id 4865A19B8274 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Mon, 13 Jul 2009 13:24:46 -0400 (EDT)
Received: (qmail 24847 invoked by uid 103); 13 Jul 2009 17:24:45 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 13 Jul 2009 17:24:45 -0000
Received: from barracuda.mpr.org (HELO barracuda01.mpr.org) (192.203.201.122) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Mon, 13 Jul 2009 10:24:41 -0700
Received: from HQMAIL08.mpr.org (localhost [127.0.0.1]) by barracuda01.mpr.org (Spam & Virus Firewall) with ESMTP id 14E8E414358 for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Mon, 13 Jul 2009 12:24:37 -0500 (CDT)
Received: from HQMAIL08.mpr.org (hqesnode02.mpr.org [10.2.2.101]) by barracuda01.mpr.org with ESMTP id yad5JnzYdaUndFVZ for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Mon, 13 Jul 2009 12:24:37 -0500 (CDT)
Received: from mail.mpr.org ([10.2.2.87]) by HQMAIL08.mpr.org with Microsoft SMTPSVC(6.0.3790.3959); Mon, 13 Jul 2009 12:24:37 -0500
Received: from pkarmanpc ([10.2.6.17]) by mail.mpr.org with Microsoft SMTPSVC(6.0.3790.3959); Mon, 13 Jul 2009 12:24:36 -0500
Received: from [127.0.0.1] (localhost [127.0.0.1]) by pkarmanpc (Postfix) with ESMTP id 95FA521A47E for <bug-Search-QueryParser-SQL [...] rt.cpan.org>; Mon, 13 Jul 2009 12:24:54 -0500 (CDT)
Delivered-To: cpan-bug+Search-QueryParser-SQL [...] diesel.bestpractical.com
User-Agent: Thunderbird 2.0.0.22 (X11/20090608)
X-Asg-Debug-ID: 1247505877-5dc000480000-ahCBLc
Subject: Re: [rt.cpan.org #46881] INTs are being fuzzified
Return-Path: <peter [...] peknet.com>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Search-QueryParser-SQL [...] rt.cpan.org
Date: Mon, 13 Jul 2009 12:24:54 -0500
X-Spam-Level: *
X-Barracuda-Url: http://barracuda.mpr.org:8000/cgi-bin/mark.cgi
To: bug-Search-QueryParser-SQL [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Peter Karman <peter [...] peknet.com>
RT-Message-ID: <rt-3.6.HEAD-25318-1247505930-574.46881-0-0 [...] rt.cpan.org>
Content-Length: 370
Download (untitled) / with headers
text/plain 370b
peter@peknet.com via RT wrote on 06/27/2009 03:17 PM: Show quoted text
> Please try svn trunk and see if it works for you: > > https://svn.msi.umn.edu/sw/perl/Search-QueryParser-SQL/trunk/
Just tickling this rt ticket to see if you've had a chance to test svn. -- Peter Karman . http://peknet.com/ . peter@peknet.com gpg key: 37D2 DAA6 3A13 D415 4295 3A69 448F E556 374A 34D9
MIME-Version: 1.0
In-Reply-To: <DACEED66-F05D-4459-821F-C1D105734A6F [...] mlx.net>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Charset: utf8
References: <DACEED66-F05D-4459-821F-C1D105734A6F [...] mlx.net>
Content-Type: text/plain
Message-ID: <rt-3.6.HEAD-1109-1250654598-266.46881-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 78
no response. uploaded 0.008 to pause just now to let the cpantesters smoke it.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.