[interchange-cvs] interchange - heins modified 3 files

interchange-core@interchange.redhat.com interchange-core@interchange.redhat.com
Mon Feb 4 03:26:01 2002


User:      heins
Date:      2002-02-04 08:25:54 GMT
Modified:  dist/lib/UI/pages/admin direct_sql.html
Modified:  lib/Vend/Table Common.pm DBI.pm
Log:
	* Fix a couple of little bugs in DB modules found during direct_sql
	  testing:

	  	-- Vend/Table/DBI.pm had bogus message about "tables must be
		   updated natively" when in fact the query worked fine.

		-- Vend/Table/Common.pm was by default limiting to 50 and
		   never honoring $opt->{ml}. Changed to 1000 and allow
		   $opt->{ml}.

	* Not supposed to let non-superuser update tables, and we
	  needed a check.

Revision  Changes    Path
1.2       +3 -5      interchange/dist/lib/UI/pages/admin/direct_sql.html


rev 1.2, prev_rev 1.1
Index: direct_sql.html
===================================================================
RCS file: /anon_cvs/repository/interchange/dist/lib/UI/pages/admin/direct_sql.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- direct_sql.html	4 Feb 2002 07:44:49 -0000	1.1
+++ direct_sql.html	4 Feb 2002 08:25:54 -0000	1.2
@@ -8,7 +8,7 @@
 
 @_UI_STD_HEAD_@
 <!-- ----- BEGIN REAL STUFF ----- -->
-
+[tmp is_super][if-mm super]1[/if-mm][/tmp]
 [calc]
 	delete $CGI->{list};
 	delete $CGI->{html};
@@ -137,8 +137,7 @@
 		table="[cgi mv_data_table]"
 		st=db
 		row-count="[cgi row-count]"
-		html="[cgi html]" 
-		list="[cgi list]" 
+		html=1
 		sql=`$sql`
 		ml="[cgi limit]"
 	]
@@ -148,8 +147,7 @@
 		table="[cgi mv_data_table]"
 		row-count="[cgi row-count]"
 		st=db
-		html="[cgi html]" 
-		list="[cgi list]" 
+		list=1
 		ml="[cgi limit]"
 		sql=`$sql`
 	]



2.12      +3 -2      interchange/lib/Vend/Table/Common.pm


rev 2.12, prev_rev 2.11
Index: Common.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/lib/Vend/Table/Common.pm,v
retrieving revision 2.11
retrieving revision 2.12
diff -u -r2.11 -r2.12
--- Common.pm	4 Feb 2002 01:31:17 -0000	2.11
+++ Common.pm	4 Feb 2002 08:25:54 -0000	2.12
@@ -1,6 +1,6 @@
 # Vend::Table::Common - Common access methods for Interchange databases
 #
-# $Id: Common.pm,v 2.11 2002/02/04 01:31:17 mheins Exp $
+# $Id: Common.pm,v 2.12 2002/02/04 08:25:54 mheins Exp $
 #
 # Copyright (C) 1996-2001 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -22,7 +22,7 @@
 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA  02111-1307  USA.
 
-$VERSION = substr(q$Revision: 2.11 $, 10);
+$VERSION = substr(q$Revision: 2.12 $, 10);
 use strict;
 
 package Vend::Table::Common;
@@ -715,6 +715,7 @@
 	
 	@na = @{$spec->{rf}}     if $spec->{rf};
 
+	$spec->{ml} = $opt->{ml} || '1000';
 	$spec->{fn} = [$s->columns];
 
 	my $sub;



2.13      +3 -6      interchange/lib/Vend/Table/DBI.pm


rev 2.13, prev_rev 2.12
Index: DBI.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/lib/Vend/Table/DBI.pm,v
retrieving revision 2.12
retrieving revision 2.13
diff -u -r2.12 -r2.13
--- DBI.pm	4 Feb 2002 01:31:17 -0000	2.12
+++ DBI.pm	4 Feb 2002 08:25:54 -0000	2.13
@@ -1,6 +1,6 @@
 # Vend::Table::DBI - Access a table stored in an DBI/DBD database
 #
-# $Id: DBI.pm,v 2.12 2002/02/04 01:31:17 mheins Exp $
+# $Id: DBI.pm,v 2.13 2002/02/04 08:25:54 mheins 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.12 $, 10);
+$VERSION = substr(q$Revision: 2.13 $, 10);
 
 use strict;
 
@@ -1738,10 +1738,7 @@
 		map { $_ = $fh{$_} } @{$spec->{$_}};
 	}
 
-	if($update) {
-		die "DBI tables must be updated natively.\n";
-	}
-	elsif ($opt->{hashref}) {
+	if ($opt->{hashref}) {
 		$ref = $Vend::Interpolate::Tmp->{$opt->{hashref}} = $search->hash($spec);
 	}
 	else {