Skip Menu |
 

This queue is for tickets about the DBIx-Class CPAN distribution.

Report information
The Basics
Id: 126958
Status: open
Priority: 0/
Queue: DBIx-Class

People
Owner: Nobody in particular
Requestors: KES [...] cpan.org
Cc:
AdminCc:

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



Subject: Unclear error
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
Message-ID: <rt-4.0.18-7849-1535288717-1512.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 1175
Download (untitled) / with headers
text/plain 1.1k
DBIx::Class::ResultSet::_resolved_attrs(): Unable to prefetch, resultset contains an unnamed selector {exists => \["(SELECT 1 FROM \"service_package_set\" \"partial\" WHERE ( ( \"service_type_id_covered\" = \"ServiceTree\".\"id\" OR \"service_type_id_surplus\" = \"ServiceTree\".\"id\" ) ))"]} at (eval 2343)[/home/kes/perl5/perlbrew/perls/perl-5.24.1/lib/site_perl/5.24.1/DB/Commands.pm:971] line 3 After this error I have tried to add an 'alias': my $partial = $c->model( 'ServicePackageSet' )->search([ { service_type_id_covered => { -ident => 'ServiceTree.id' } }, { service_type_id_surplus => { -ident => 'ServiceTree.id' } }, ],{ select => \1, alias => 'partial' }); This change nothing. After googling a bit I have found: https://www.perlmonks.org/?node_id=882510 and change my resulting query as: my $pricelist = $c->model( 'ServiceTree' )->search({ },{ prefetch => [qw/ Price Package /], '+select' => { exists => $partial->as_query }, '+as' => [ 'abc' ], ## <<<<<<<< HERE order_by => [qw/ Package.short_name name /], }); The error message should be improved to be meaningful. It should explicitly say: maybe you should use `+as`....
MIME-Version: 1.0
X-Spam-Status: No, score=-5.9 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, FROM_OUR_RT=-4] autolearn=ham
In-Reply-To: <rt-4.0.18-7849-1535288717-414.126958-4-0 [...] rt.cpan.org>
X-Cpan.org: This message routed through the cpan.org mail forwarding service. Please use PAUSE pause.perl.org to configure your delivery settings.
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-126958 [...] rt.cpan.org> <rt-4.0.18-7849-1535288717-414.126958-4-0 [...] rt.cpan.org>
Content-Language: en-US
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <d8180b66-96df-de22-5a09-df15277d8f40 [...] leporine.io>
content-type: text/plain; charset="utf-8"; format="flowed"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -5.9
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id E8ACB2401D7 for <cpan-bug+DBIx-Class [...] hipster.bestpractical.com>; Sun, 26 Aug 2018 09:21:04 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id S4oH2BrNQkvw for <cpan-bug+DBIx-Class [...] hipster.bestpractical.com>; Sun, 26 Aug 2018 09:20:43 -0400 (EDT)
Received: from xx1.develooper.com (xx1.develooper.com [207.171.7.115]) by hipster.bestpractical.com (Postfix) with ESMTPS id 06B092400EC for <bug-DBIx-Class [...] rt.cpan.org>; Sun, 26 Aug 2018 09:20:42 -0400 (EDT)
Received: from localhost (xx1.develooper.com [127.0.0.1]) by localhost (Postfix) with ESMTP id AD53411F3E6 for <bug-DBIx-Class [...] rt.cpan.org>; Sun, 26 Aug 2018 06:20:40 -0700 (PDT)
Received: from xx1.develooper.com (xx1.develooper.com [127.0.0.1]) by localhost (Postfix) with SMTP id 3A75E11F397 for <bug-DBIx-Class [...] rt.cpan.org>; Sun, 26 Aug 2018 06:20:36 -0700 (PDT)
Received: from mujunyku.leporine.io (mujunyku.leporine.io [113.212.96.195]) by xx1.develooper.com (Postfix) with ESMTP id 7F33511F41E for <bug-DBIx-Class [...] rt.cpan.org>; Sun, 26 Aug 2018 06:20:34 -0700 (PDT)
Received: from [10.0.13.10] (unknown [10.0.13.10]) by mujunyku.leporine.io (Postfix) with ESMTP id 88907F45E1 for <bug-DBIx-Class [...] rt.cpan.org>; Sun, 26 Aug 2018 13:20:30 +0000 (UTC)
Delivered-To: cpan-bug+DBIx-Class [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #126958] Unclear error
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0
Return-Path: <ribasushi [...] leporine.io>
X-Original-To: cpan-bug+DBIx-Class [...] hipster.bestpractical.com
X-RT-Mail-Extension: dbix-class
Date: Sun, 26 Aug 2018 15:20:28 +0200
X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, SUPERLONG_LINE 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1000_LESS 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, BODY_SIZE_800_899 0, IN_REP_TO 0, LEGITIMATE_SIGNS 0, MSG_THREAD 0, NO_URI_HTTPS 0, REFERENCES 0, SPF_NONE 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CP_NOT_1 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __DQ_NEG_HEUR 0, __DQ_NEG_IP 0, __FORWARDED_MSG 0, __HAS_FROM 0, __HAS_MSGID 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MIME_VERSION 0, __MOZILLA_USER_AGENT 0, __NO_HTML_TAG_RAW 0, __PHISH_SPEAR_SUBJ_ALERT 0, __REFERENCES 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __SUBJ_ALPHA_NEGATE 0, __SUBJ_REPLY 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_MAILTO 0, __URI_NO_WWW 0, __URI_NS , __USER_AGENT 0, __zen.spamhaus.org_ERROR '
X-Spam-Level:
X-Greylist: delayed 79 seconds by postgrey-1.34 at xx1.develooper.com; Sun, 26 Aug 2018 06:20:35 PDT
X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2018.8.26.130917
To: bug-DBIx-Class [...] rt.cpan.org
Content-Transfer-Encoding: 7bit
From: Peter Rabbitson <ribasushi [...] leporine.io>
RT-Message-ID: <rt-4.0.18-14814-1535289665-1437.126958-0-0 [...] rt.cpan.org>
Content-Length: 834
Download (untitled) / with headers
text/plain 834b
On 08/26/2018 03:05 PM, Eugen Konkov via RT wrote: Show quoted text
> > DBIx::Class::ResultSet::_resolved_attrs(): Unable to prefetch, resultset contains an unnamed selector {exists => \["(SELECT 1 FROM \"service_package_set\" \"partial\" WHERE ( ( \"service_type_id_covered\" = \"ServiceTree\".\"id\" OR \"service_type_id_surplus\" = \"ServiceTree\".\"id\" ) ))"]} at (eval 2343)[/home/kes/perl5/perlbrew/perls/perl-5.24.1/lib/site_perl/5.24.1/DB/Commands.pm:971] line 3 > > ... > > The error message should be improved to be meaningful. It should explicitly say: maybe you should use `+as`.... >
Could you propose a complete sentence that would read correctly to you? I am aware you are not a native english speaker: this is ok. I need to see where you would add the proposed bit, as it is not clear to me where it would be most effective.
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-14814-1535289665-1437.126958-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <RT-Ticket-126958 [...] rt.cpan.org> <rt-4.0.18-7849-1535288717-414.126958-4-0 [...] rt.cpan.org> <d8180b66-96df-de22-5a09-df15277d8f40 [...] leporine.io> <rt-4.0.18-14814-1535289665-1437.126958-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-30626-1535359805-785.126958-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 309
Download (untitled) / with headers
text/plain 309b
The error message above point the problem pretty sharp. It was not clear how to resolve the issue. I try to suggest postgresql way. It report the problem and a hint how to resolve/fix this problem. So we can extend error message with next hint: <error message> HINT: Name your selector by using '+as' keyword


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.