Re: Not specifying 'Essential' columns means only Primary key is pulled on first select

[prev] [thread] [next] [Date index for 2004/11/17]

From: Cees Hek
Subject: Re: Not specifying 'Essential' columns means only Primary key is pulled on first select
Date: 11:32 on 17 Nov 2004
On Wed, 17 Nov 2004 11:08:00 +0000, Tony Bowden <tony-cdbitalk@xxxxx.xxx> wrote:
> On Wed, Nov 17, 2004 at 02:14:04PM +1100, Cees Hek wrote:
> > In the docs that it mentions that if you do not specifically name the
> > 'Essential' columns of the database, then the 'Essential' columns will
> > be set to 'All' columns.  This is what I expect to happen, but it is
> > not actually how it currently works in practice (in Class::DBI 0.96).
> 
> This is a doc bug rather than a code bug, and has been fixed in the
> latest version.

OK, fair enough.  However, the code seems to indicate that it is still
trying to set the Essential columns to All if they haven't been
actively set (despite the bug that stops this from happening).  Have
you removed that extraneous code in the new version of
Class::DBI::ColumnGrouper then?

sub add_group {
	my ($self, $group, @names) = @_;
	$self->add_group(Primary => $names[0])
		if ($group eq "All" or $group eq "Essential")
		and not $self->group_cols('Primary');
##############
# This code seems to indicate that you are still trying to set
# the Essential columns to All.  You should be able to remove
# these lines completely as the 'if' statement will always
# be false (the above line sets the Primary group, and
# $self->essential returns the 'Essential' columns or the
# Primary columns hence the if always fails)
	$self->add_group(Essential => @names)
		if $group eq "All"
		and !$self->essential;
##############
	@names = _unique($self->primary, @names) if $group eq "Essential";
	my @cols = map $self->add_column($_), @names;
	$_->add_group($group) foreach @cols;
	$self->{_groups}->{$group} = \@cols;
	return $self;
}

By the way, is there a readonly public repository for the development
version of Class::DBI?  There is a good chance that you have already
fixed the issue above, and I'm probably just wasting your time with
this...

Cheers,

        -- 
        Cees Hek

Re: Not specifying 'Essential' columns means only Primary key is pulled on first select
Cees Hek 11:32 on 17 Nov 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52