[interchange-cvs] interchange - heins modified lib/Vend/Table/DBI.pm
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Tue Jul 15 18:59:00 EDT 2003
User: heins
Date: 2003-07-15 21:59:30 GMT
Modified: lib/Vend/Table DBI.pm
Log:
* Fix endless requery loop reported by Stefan.
Revision Changes Path
2.52 +9 -3 interchange/lib/Vend/Table/DBI.pm
rev 2.52, prev_rev 2.51
Index: DBI.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Table/DBI.pm,v
retrieving revision 2.51
retrieving revision 2.52
diff -u -r2.51 -r2.52
--- DBI.pm 14 Jul 2003 02:35:55 -0000 2.51
+++ DBI.pm 15 Jul 2003 21:59:30 -0000 2.52
@@ -1,6 +1,6 @@
# Vend::Table::DBI - Access a table stored in an DBI/DBD database
#
-# $Id: DBI.pm,v 2.51 2003/07/14 02:35:55 mheins Exp $
+# $Id: DBI.pm,v 2.52 2003/07/15 21:59:30 mheins Exp $
#
# Copyright (C) 2002-2003 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -21,7 +21,7 @@
# MA 02111-1307 USA.
package Vend::Table::DBI;
-$VERSION = substr(q$Revision: 2.51 $, 10);
+$VERSION = substr(q$Revision: 2.52 $, 10);
use strict;
@@ -1959,6 +1959,9 @@
if(! $sth or ! defined $rc) {
# query failed, probably because no table
+ ## Save the original message
+ my $origmsg = $@;
+
# Allow failed query by design, maybe to use multiple key inserts
return undef if $opt->{no_requery};
@@ -1968,10 +1971,13 @@
eval {
$trytab = Vend::Scan::sql_statement($query, { table_only => 1 } );
$newdb = Vend::Data::database_exists_ref($trytab);
+ if($newdb->config('name') eq $s->config('name')) {
+ die $origmsg;
+ }
};
if($@) {
my $msg = ::errmsg(
- qq{Query rerouted from table %s failed: %s\nQuery was: %s},
+ qq{Query on table %s failed: %s\nQuery was: %s},
$trytab,
$@,
$query,
More information about the interchange-cvs
mailing list