in reply to Re: CDBI segfaults on me->has_a(me)
in thread CDBI segfaults on me->has_a(me)

There was no indication in the sample code that "employee" was a primary key in this table. I assumed it was some sort of tree structure, which should work just fine with has_a().
  • Comment on Re: Re: CDBI segfaults on me->has_a(me)

Replies are listed 'Best First'.
Re: Re: Re: CDBI segfaults on me->has_a(me)
by cees (Curate) on May 10, 2004 at 19:58 UTC

    That is not how I read it...

    Foo::Employee->has_a(employee => q{Foo::Employee});

    That code shows that a recursive has_a is happening here linking Foo::Employee to itself. That on it's own should work, and I have used it successfully myself. But what about the following statement?

    The idea was that if someone grabs the primary key of a row, return the object, not the integer PK.

    That line implies to me that they are doing this with the primary key of the table. At least that's how I read it.

    I'll admit that the fact that they are linking this to 'employee' makes it look suspect, but they specifically state they are dealing with a primary key... I guess a clarification by water would solve this confusion.

    I do agree with your other comment that the segfault is not in Class::DBI. It could be an obscure perl bug, but more than likely it is the DBD driver for the database (either improperly installed, or buggy).

    - Cees