Skip Menu |

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

Report information
The Basics
Id: 127084
Status: new
Priority: 0/
Queue: DBIx-Class

Owner: Nobody in particular
Requestors: steve [...]

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

Subject: prefectch and MSSQL db
Date: Mon, 10 Sep 2018 14:01:56 +0100
To: bug-DBIx-Class [...]
From: Steve Rogerson <steve [...]>
Download (untitled) / with headers
text/plain 1.1k
I have to interface to an MSSQL db via ODBC and it works ok.  There is a problem with prefetch though. The MSSQL uses spaces in it's column names (not in my gift to change). I have a statement: my $rslt = $main_egb_schema->resultset('EventDetail')->search( {'edets date' => {'>=' => '2018-09-10'}}, {prefetch => {'event_classes' => 'event_entries' }) my $f = $rslt->first [slightly re-arranged for conciseness, so I may have slightly munged the syntax] And I get..... Odd number of elements in anonymous hash at /usr/local/share/perl/5.22.1/DBIx/Class/ line 1535 ... # all this does is removes the foreign/self prefix from a condition sub __strip_relcond { +{ map *{ map { /^ (?:foreign|self) \. (\w+) $/x } ($_, $_[1]{$_}) }* keys %{$_[1]} } } ... The first time it's called with $_[1]   :  "'foreign.ecl edets key' => 'self.edets key'" .Which 'works' but produces an empty hash and is later called with " 'foreign.EclKey' => 'self.ecl key'" which gives the odd elements warning - though still continues. As we are looking at the native column names here and not accessors we should probably change  (\w+) to  (\.+) to include the space.  Steve

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

Please report any issues with to