Skip Menu |
 

This queue is for tickets about the Tangram CPAN distribution.

Report information
The Basics
Id: 24324
Status: open
Priority: 0/
Queue: Tangram

People
Owner: Nobody in particular
Requestors: pt [...] tchorbadjiev.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 2.04
  • 2.05
  • 2.06
  • 2.07
  • 2.07_03
  • 2.07_04
  • 2.07_05
  • 2.07_06
  • 2.07_07
  • 2.08
Fixed in:
  • 2.09
  • 2.10



MIME-Version: 1.0
X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00
Received-SPF: neutral (x1.develooper.com: local policy)
Content-Type: multipart/mixed; boundary="------------000508080809030600030606"
Reply-To: pt [...] tchorbadjiev.com
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 15F2D4D80A7 for <bug-Tangram [...] rt.cpan.org>; Thu, 11 Jan 2007 12:06:23 -0500 (EST)
Received: (qmail 19869 invoked by alias); 11 Jan 2007 17:06:23 -0000
Received: from pro34.abac.com (HELO pro34.abac.com) (66.226.64.35) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Thu, 11 Jan 2007 09:06:16 -0800
Received: from [192.168.10.5] ([89.25.12.4]) (authenticated bits=0) by pro34.abac.com (8.13.8/8.13.8) with ESMTP id l0BH5rci042538 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for <bug-Tangram [...] rt.cpan.org>; Thu, 11 Jan 2007 09:06:08 -0800 (PST) (envelope-from pt [...] tchorbadjiev.com)
Delivered-To: cpan-bug+tangram [...] diesel.bestpractical.com
User-Agent: Thunderbird 1.5.0.9 (X11/20061219)
Subject: Tangram::Storage::count (2.07_07) patch
Return-Path: <pt [...] tchorbadjiev.com>
X-Original-To: bug-Tangram [...] rt.cpan.org
X-Spam-Check-BY: la.mx.develooper.com
Date: Thu, 11 Jan 2007 19:18:26 +0200
Message-Id: <45A67162.9070008 [...] tchorbadjiev.com>
To: bug-Tangram [...] rt.cpan.org
From: Assen Tchorbadjiev <pt [...] tchorbadjiev.com>
Content-Length: 0
content-type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
X-RT-Original-Encoding: ISO-8859-1
Content-Length: 742
Download (untitled) / with headers
text/plain 742b
Hello, attached is a [minor] patch for the Tangram::Storage module (from 2.07_07). Inside the count() sub is a call like: Show quoted text
> $objects->insert($expr->objects);
Since $expr usually end up being Tangram::QueryObject(s), they don't have the objectS() method, but only object(). I've looked against the stable version, but the count() sub is implemented in a different way, w/o using such a call on the $expr argument. The patch effectively calls object(), instead of objectS(). It works for me at least (and it gives the correct counts). The code I'm using is basically like: Show quoted text
> $r1 = $remote-data-type-as-per-schema->new(); > $r2 = $remote-data-type-as-per-schema->{field}->eq(xxx); > Tangram::Storage->count( $r1, $r2 );
Regards, Assen
content-type: text/x-patch; name="Storage.pm.patch"
content-disposition: inline; filename="Storage.pm.patch"
Content-Transfer-Encoding: 7bit
X-RT-Original-Encoding: ascii
Content-Length: 260
Download Storage.pm.patch
text/x-diff 260b
--- Storage.pm.orig Thu Jan 11 18:49:41 2007 +++ Storage.pm Thu Jan 11 18:49:44 2007 @@ -1110,7 +1110,7 @@ { my $expr = shift; $target = $expr->{expr}; - $objects->insert($expr->objects); + $objects->insert($expr->object); $filter = shift; }
MIME-Version: 1.0
In-Reply-To: <45A67162.9070008 [...] tchorbadjiev.com>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
References: <45A67162.9070008 [...] tchorbadjiev.com>
Message-Id: <rt-3.6.HEAD-18041-1168551361-1975.24324-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
From: SAMV [...] cpan.org
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 1035
On Thu Jan 11 12:06:34 2007, pt@tchorbadjiev.com wrote: Show quoted text
> > The patch effectively calls object(), instead of objectS(). > > It works for me at least (and it gives the correct counts). > The code I'm using is basically like: >
> > $r1 = $remote-data-type-as-per-schema->new(); > > $r2 = $remote-data-type-as-per-schema->{field}->eq(xxx); > > Tangram::Storage->count( $r1, $r2 );
That doesn't look quite right, $r1 should be a remote object you got with Tangram::Storage->remote("ClassName"). While the change might be the right thing to do (I'm not positive right now, but quite possibly), proving what we're doing using the regression test suite would be better. Can you please work your use case into a test script which fails against 2.07_07 and succeeds with your patch - or feel free to modify an existing test script and send a patch on that. Currently, ->count() is only tested in t/springfield/82-aggregate.t and t/musicstore/01-simple.t. As things stand, I can't apply your patch against the head Tangram release. Sam.
MIME-Version: 1.0
X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00
In-Reply-To: <rt-3.6.HEAD-18041-1168551361-1975.24324-6-0 [...] rt.cpan.org>
Received-SPF: neutral (x1.develooper.com: local policy)
References: <RT-Ticket-24324 [...] rt.cpan.org> <45A67162.9070008 [...] tchorbadjiev.com> <rt-3.6.HEAD-18041-1168551361-1975.24324-6-0 [...] rt.cpan.org>
Reply-To: pt [...] tchorbadjiev.com
Content-Type: multipart/mixed; boundary="------------090904090404090505080001"
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 018BB4D8098 for <bug-Tangram [...] rt.cpan.org>; Thu, 11 Jan 2007 17:05:20 -0500 (EST)
Received: (qmail 22268 invoked by alias); 11 Jan 2007 22:05:20 -0000
Received: from pro34.abac.com (HELO pro34.abac.com) (66.226.64.35) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Thu, 11 Jan 2007 14:05:16 -0800
Received: from [172.16.72.6] ([85.187.160.6]) (authenticated bits=0) by pro34.abac.com (8.13.8/8.13.8) with ESMTP id l0BM57sK050058 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for <bug-Tangram [...] rt.cpan.org>; Thu, 11 Jan 2007 14:05:09 -0800 (PST) (envelope-from pt [...] tchorbadjiev.com)
Delivered-To: cpan-bug+tangram [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #24324] Tangram::Storage::count (2.07_07) patch
User-Agent: Thunderbird 1.5.0.9 (X11/20061219)
Return-Path: <pt [...] tchorbadjiev.com>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: bug-Tangram [...] rt.cpan.org
Date: Fri, 12 Jan 2007 00:03:41 +0200
Message-Id: <45A6B43D.3010902 [...] tchorbadjiev.com>
To: bug-Tangram [...] rt.cpan.org
From: Assen Tchorbadjiev <pt [...] tchorbadjiev.com>
RT-Message-ID: <rt-3.6.HEAD-18047-1168553132-994.24324-0-0 [...] rt.cpan.org>
Content-Length: 0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 1979
Download (untitled) / with headers
text/plain 1.9k
Show quoted text
>> That doesn't look quite right, $r1 should be a remote object you got..
Language error on my part, sorry. Yes, its a remote object retrieved via Storage->remote. Attached is a patch against: t/musicstore/01-simple, I've added an explicit $expr object // $storage->remote("CD") // as the first argument to the count() call , and the output is: Show quoted text
> # make test > [ .. ] > t/musicstore/01-simple........ok 2/24 > Can't locate object method "objects" via package "Tangram::QueryObject" > at /usr/home/mason/html/anet-cp/lib3/build/Tangram-2.07_07/blib/lib/Tangram/Storage.pm line 1113, <CONFIG> line 1 > [ .. ]
btw, the pod docs say that count() should be invoked as: Show quoted text
> count( $expr, [$filter] )
The $filter is marked as optional, but the test case above uses only the $filter when calling the method. Regards, Assen via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=24324 > > > On Thu Jan 11 12:06:34 2007, pt@tchorbadjiev.com wrote:
>> The patch effectively calls object(), instead of objectS(). >> >> It works for me at least (and it gives the correct counts). >> The code I'm using is basically like: >>
>>> $r1 = $remote-data-type-as-per-schema->new(); >>> $r2 = $remote-data-type-as-per-schema->{field}->eq(xxx); >>> Tangram::Storage->count( $r1, $r2 );
> > That doesn't look quite right, $r1 should be a remote object you got > with Tangram::Storage->remote("ClassName"). > > While the change might be the right thing to do (I'm not positive right > now, but quite possibly), proving what we're doing using the regression > test suite would be better. > > Can you please work your use case into a test script which fails against > 2.07_07 and succeeds with your patch - or feel free to modify an > existing test script and send a patch on that. Currently, ->count() is > only tested in t/springfield/82-aggregate.t and > t/musicstore/01-simple.t. As things stand, I can't apply your patch > against the head Tangram release. > > Sam. > > >
content-type: text/x-patch; name="01-simple.t.patch"
content-disposition: inline; filename="01-simple.t.patch"
Content-Transfer-Encoding: 7bit
X-RT-Original-Encoding: ascii
X-RT-Original-Encoding: ascii
Content-Length: 468
Download 01-simple.t.patch
text/x-diff 468b
--- t/musicstore/01-simple.t.orig Thu Jan 11 23:53:10 2007 +++ t/musicstore/01-simple.t Thu Jan 11 23:54:32 2007 @@ -134,7 +134,7 @@ is(@cds, 3, "Found three CDs by artists matching %beat%"); # if we just wanted the count: - my ($count) = $storage->count($filter); + my ($count) = $storage->count( $r_cd, $filter); # count with $expr as 1st arg is($count, 3, "Can do simple COUNT() queries"); # maybe some other aggregation type queries:
MIME-Version: 1.0
In-Reply-To: <rt-3.6.HEAD-18047-1168553132-994.24324-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.418 (Entity 5.418)
Content-Disposition: inline
References: <RT-Ticket-24324 [...] rt.cpan.org> <45A67162.9070008 [...] tchorbadjiev.com> <rt-3.6.HEAD-18041-1168551361-1975.24324-6-0 [...] rt.cpan.org> <45A6B43D.3010902 [...] tchorbadjiev.com> <rt-3.6.HEAD-18047-1168553132-994.24324-0-0 [...] rt.cpan.org>
Message-Id: <rt-3.6.HEAD-18047-1168555811-1832.24324-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf8"
Content-Transfer-Encoding: binary
From: SAMV [...] cpan.org
X-RT-Original-Encoding: utf-8
X-RT-Original-Encoding: utf-8
Content-Length: 714
Download (untitled) / with headers
text/plain 714b
On Thu Jan 11 17:05:32 2007, pt@tchorbadjiev.com wrote: Show quoted text
> > Attached is a patch against: t/musicstore/01-simple, I've added an > explicit $expr object // $storage->remote("CD") // as the first > argument > to the count() call , and the output is:
[...] Show quoted text
> btw, the pod docs say that count() should be invoked as:
> > count( $expr, [$filter] )
Well spotted. I have updated the test case (see http://utsl.gen.nz/gitweb/?p=Tangram;a=commitdiff;h=c06d12d1226c2a3c881194b88f3d5c32e5e6244f), but it seems that it passes on master already. Checking other versions, it seems that 2.09 and above pass this test. Are you able to try a newer version? I have updated the documentation to reflect this flexibility. Sam.
MIME-Version: 1.0
X-Spam-Status: No, hits=-1.1 required=8.0 tests=BAYES_00,RCVD_IN_SORBS_WEB
In-Reply-To: <rt-3.6.HEAD-18047-1168555811-1832.24324-6-0 [...] rt.cpan.org>
Received-SPF: neutral (x1.develooper.com: local policy)
References: <RT-Ticket-24324 [...] rt.cpan.org> <45A67162.9070008 [...] tchorbadjiev.com> <rt-3.6.HEAD-18041-1168551361-1975.24324-6-0 [...] rt.cpan.org> <45A6B43D.3010902 [...] tchorbadjiev.com> <rt-3.6.HEAD-18047-1168553132-994.24324-6-0 [...] rt.cpan.org> <rt-3.6.HEAD-18047-1168555811-1832.24324-6-0 [...] rt.cpan.org>
Reply-To: pt [...] tchorbadjiev.com
Content-Type: text/plain; charset=utf-8
X-RT-Original-Encoding: utf-8
Received: from la.mx.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 412984D801A for <bug-Tangram [...] rt.cpan.org>; Fri, 12 Jan 2007 05:26:33 -0500 (EST)
Received: (qmail 28254 invoked by alias); 12 Jan 2007 10:26:32 -0000
Received: from pro34.abac.com (HELO pro34.abac.com) (66.226.64.35) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Fri, 12 Jan 2007 02:26:29 -0800
Received: from [192.168.10.5] ([89.25.12.4]) (authenticated bits=0) by pro34.abac.com (8.13.8/8.13.8) with ESMTP id l0CAQIuc098560 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for <bug-Tangram [...] rt.cpan.org>; Fri, 12 Jan 2007 02:26:22 -0800 (PST) (envelope-from pt [...] tchorbadjiev.com)
Delivered-To: cpan-bug+tangram [...] diesel.bestpractical.com
Subject: Re: [rt.cpan.org #24324] Tangram::Storage::count (2.07_07) patch
User-Agent: Thunderbird 1.5.0.9 (X11/20061219)
Return-Path: <pt [...] tchorbadjiev.com>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: bug-Tangram [...] rt.cpan.org
Date: Fri, 12 Jan 2007 12:38:53 +0200
Message-Id: <45A7653D.80609 [...] tchorbadjiev.com>
To: bug-Tangram [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Assen Tchorbadjiev <pt [...] tchorbadjiev.com>
X-RT-Original-Encoding: utf-8
RT-Message-ID: <rt-3.6.HEAD-17981-1168597601-1952.24324-0-0 [...] rt.cpan.org>
Content-Length: 1007
Download (untitled) / with headers
text/plain 1007b
Show quoted text
>> [ .. ] >> it seems that 2.09 and above pass this test. Are you able to try a >> newer version?
Yes, 2.10 passes for sure (with your patch on the test case). Regards, Assen via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=24324 > > > On Thu Jan 11 17:05:32 2007, pt@tchorbadjiev.com wrote:
>> Attached is a patch against: t/musicstore/01-simple, I've added an >> explicit $expr object // $storage->remote("CD") // as the first >> argument >> to the count() call , and the output is:
> [...]
>> btw, the pod docs say that count() should be invoked as:
>>> count( $expr, [$filter] )
> > Well spotted. I have updated the test case (see > http://utsl.gen.nz/gitweb/?p=Tangram;a=commitdiff;h=c06d12d1226c2a3c881194b88f3d5c32e5e6244f), > but it seems that it passes on master already. Checking other versions, > it seems that 2.09 and above pass this test. Are you able to try a > newer version? > > I have updated the documentation to reflect this flexibility. > > Sam. > > >


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.