<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 6.00.2800.1555" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=ltr 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
  size=2>-----Original Message-----<BR><B>From:</B> 
  dbix-class-bounces@lists.rawmode.org 
  [mailto:dbix-class-bounces@lists.rawmode.org]<B>On Behalf Of </B>Brandon 
  Black<BR><B>Sent:</B> 24 August 2006 23:21<BR><B>To:</B> 
  dbix-class@lists.rawmode.org<BR><B>Subject:</B> Re: [Dbix-class] Problem with 
  DBIx::Class::Schema::Loader or<BR><BR></FONT></DIV><BR><BR>
  <DIV><SPAN class=gmail_quote>On 8/24/06, <B class=gmail_sendername>James 
  Masters</B> &lt;<A 
  href="mailto:james@masters.me.uk">james@masters.me.uk</A>&gt; wrote:</SPAN>
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
    <DIV>
    <DIV>
    <DIV><FONT face=Arial color=#800000 size=2><SPAN>Thanks for the 
    advice.&nbsp; I have been re-reading the documentation and have made some 
    progress by using the Loader Debugger.</SPAN></FONT></DIV>
    <DIV><FONT face=Arial color=#800000 size=2><SPAN></SPAN></FONT>&nbsp;</DIV>
    <DIV><FONT size=+0><SPAN><FONT face=Arial><FONT color=#800000 
    size=2>Firstly, let me reply to your 2 points.&nbsp; Of course, I did first 
    try to use -&gt;load_classes.&nbsp; This didn't work - the error said I was 
    missing a module; I can't remember the name of it now but I couldn't find a 
    win32 version of it so gave 
  up</FONT></FONT></SPAN></FONT></DIV></DIV></DIV></BLOCKQUOTE><FONT face=Arial 
  color=#0000ff size=2></FONT>
  <DIV><BR>First, you should stop right there and work on that problem.&nbsp; 
  What is this missing module, why is it missing, and can it be fixed?&nbsp; 
  This doesn't sound sane/normal.&nbsp; I've haven't heard about people who 
  cannot use load_classes.&nbsp; And no, "use MG::Schema::Foo" is *not* an 
  adequate substitute.&nbsp;<SPAN class=255291709-25082006><FONT face=Arial 
  color=#0000ff size=2>&nbsp;</FONT></SPAN><SPAN 
  class=255291709-25082006>&nbsp;</SPAN><BR><SPAN class=255291709-25082006><FONT 
  face=Arial color=#0000ff size=2>&nbsp;</FONT></SPAN><SPAN 
  class=255291709-25082006>&nbsp;</SPAN></DIV><BR>
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
    <DIV>
    <DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN><FONT color=#000000>Anyway, 
    with the debugger, I have learnt that the Loader was working fine. I can see 
    all the tables, columns and PKs being loaded.&nbsp; Also I got 
    the&nbsp;resultsets to work - the problem was that I was specifying 
    CountryCode (which is indeed the correct name of my column)&nbsp;but to get 
    it to work I have to use lower case&nbsp;"countrycode".&nbsp;&nbsp;Someone 
    has told me that this is because&nbsp;MySQL columns are not case-sensitive 
    and all columns are stored in lower case.&nbsp; [ Still, I don't think this 
    is ideal behaviour personally as I like my "cased" column names.&nbsp; 
    Wouldn't a better behaviour be for the methods to accept any case?&nbsp; Not 
    sure if possible as might mess up other database interfaces - just 
    wondering. ]</FONT></SPAN></FONT></DIV></DIV></DIV></BLOCKQUOTE>
  <DIV><BR>The Loader currently does force all column names to lower case.&nbsp; 
  Normal DBIx::Class lets you specify them however you like, and honors that 
  specification.&nbsp; The decision to lowercase them all in Schema::Loader just 
  makes the code *much* simpler than dealing with all of the cross-vendor case 
  issues that exist for what Loader is doing.&nbsp; At least for the time being, 
  if you want CamelCase column names in DBIx::Class, you have to do it for 
  yourself. <BR></DIV><BR>
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
    <DIV>
    <DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN>However, I am left with a 
    problem.&nbsp; The following error:</SPAN></FONT></DIV></DIV>
    <DIV><SPAN class=q>
    <DIV><FONT face=Arial color=#0000ff size=2><SPAN></SPAN></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial color=#0000ff size=2><STRONG>Attempt to free 
    unreferenced scalar: SV 0x1fa7a5c, Perl interpreter: 0x224234 at 
    C:/Perl/site/lib/SQL/Abstract/Limit.pm line 
    325.<BR></STRONG></FONT></DIV></SPAN></DIV>
    <DIV>
    <DIV><SPAN></SPAN><FONT face=Arial color=#0000ff size=2>o<SPAN>ccurs every 
    time I attempt to use a resultset.&nbsp; Tinkering has established that it 
    occurs with each of the following lines.</SPAN><BR></FONT></DIV>
    <DIV><FONT face=Arial color=#0000ff size=2>my @livecountries = 
    $schema-&gt;resultset('Country')-&gt;search(live =&gt; 'Y');<BR>my $m = 
    $schema-&gt;resultset('Country')-&gt;next-&gt;countryname;<BR>my 
    @allcountries = $schema-&gt;resultset('Country')-&gt;all;<BR>my 
    $country&nbsp; = 
    $schema-&gt;resultset('Country')-&gt;find(1)-&gt;countryname;<BR>my $r = 
    $schema-&gt;resultset('Region')-&gt;find(1)-&gt;regionname;<BR>my $p = 
    $schema-&gt;resultset('Product')-&gt;find(1)-&gt;description;<BR></FONT></DIV>
    <DIV><FONT size=+0><FONT face=Arial><FONT color=#0000ff><FONT 
    size=2><SPAN>If I put all 6 lines, it occurs 6 times.&nbsp; It happens if 
    this is the last thing in the 
    script.</SPAN></FONT></FONT></FONT></FONT></DIV>
    <DIV><FONT size=+0><FONT face=Arial><FONT color=#0000ff><FONT 
    size=2></FONT></FONT></FONT></FONT>&nbsp;</DIV>
    <DIV><FONT size=+0><FONT size=+0><FONT size=+0><FONT face=Arial><FONT 
    color=#0000ff><FONT size=2><SPAN>This&nbsp;</SPAN>only happens when the 
    schema is loaded via Loader - it d<SPAN>id </SPAN>not appear when the 
    schema&nbsp;<SPAN>was</SPAN> loaded via my manually created module. The 
    Loader debugger does not give any clues.<SPAN>&nbsp; If anyone can point me 
    in the right direction for further reading/investigation, I'd be very 
    grateful.</SPAN></FONT></FONT></FONT></FONT></FONT></FONT></DIV></DIV></DIV></BLOCKQUOTE>
  <DIV><BR>The error itself is pointing you somewhere.&nbsp; What's on line 325 
  of S::A::L? (and what version do you have installed from where?). <BR><BR>-- 
  Brandon<BR></DIV><BR></DIV></BLOCKQUOTE></BODY></HTML>