[interchange-cvs] interchange - jon modified lib/Vend/Table/DBI.pm

interchange-core@interchange.redhat.com interchange-core@interchange.redhat.com
Mon Oct 29 15:48:00 2001


User:      jon
Date:      2001-10-29 20:47:40 GMT
Modified:  lib/Vend/Table DBI.pm
Log:
Allow for missing column names when using HANDLE_ONLY with DBI tables.

Revision  Changes    Path
2.3       +4 -3      interchange/lib/Vend/Table/DBI.pm


rev 2.3, prev_rev 2.2
Index: DBI.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Table/DBI.pm,v
retrieving revision 2.2
retrieving revision 2.3
diff -u -u -r2.2 -r2.3
--- DBI.pm	2001/10/18 05:27:41	2.2
+++ DBI.pm	2001/10/29 20:47:39	2.3
@@ -1,6 +1,6 @@
 # Vend::Table::DBI - Access a table stored in an DBI/DBD database
 #
-# $Id: DBI.pm,v 2.2 2001/10/18 05:27:41 mheins Exp $
+# $Id: DBI.pm,v 2.3 2001/10/29 20:47:39 jon Exp $
 #
 # Copyright (C) 1996-2001 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -20,7 +20,7 @@
 # MA  02111-1307  USA.
 
 package Vend::Table::DBI;
-$VERSION = substr(q$Revision: 2.2 $, 10);
+$VERSION = substr(q$Revision: 2.3 $, 10);
 
 use strict;
 
@@ -586,7 +586,8 @@
 sub columns {
 	my ($s) = shift;
 	$s = $s->import_db() if ! defined $s->[$DBI];
-    return @{$s->[$NAME]};
+	return unless ref $s->[$NAME] eq 'ARRAY';
+	return @{$s->[$NAME]};
 }
 
 sub test_column {