Author: pebender
Date: Mon Nov 17 22:05:22 2008
New Revision: 3980

Modified:
    trunk/gar-minimyth/script/perl/perl-MiniMyth/checksums
    trunk/gar-minimyth/script/perl/perl-MiniMyth/files/MiniMyth.pm

Log:
- Fixed the problem fixed by the previous commit in a more correct and  
robust manner.



Modified: trunk/gar-minimyth/script/perl/perl-MiniMyth/checksums
==============================================================================
--- trunk/gar-minimyth/script/perl/perl-MiniMyth/checksums      (original)
+++ trunk/gar-minimyth/script/perl/perl-MiniMyth/checksums      Mon Nov 17  
22:05:22 2008
@@ -1 +1 @@
-1492bbb206c9c225f70e02925c1f326e  download/MiniMyth.pm
+db49b87acce519ae619b1c76f7c281f1  download/MiniMyth.pm

Modified: trunk/gar-minimyth/script/perl/perl-MiniMyth/files/MiniMyth.pm
==============================================================================
--- trunk/gar-minimyth/script/perl/perl-MiniMyth/files/MiniMyth.pm       
(original)
+++ trunk/gar-minimyth/script/perl/perl-MiniMyth/files/MiniMyth.pm      Mon Nov 
 
17 22:05:22 2008
@@ -729,11 +729,13 @@
      my $query = qq(SELECT * FROM $table) .  
$self->_mythdb_condition('WHERE', 'AND', $condition, $flag);

      my $sth = $self->mythdb_handle->prepare($query);
-    $sth->execute;
      my $result = undef;
-    if ($sth->fetchrow_hashref())
+    if ($sth->execute)
      {
-        $result = $sth->fetchrow_hashref()->{$field};
+        if (my $row = $sth->fetchrow_hashref())
+        {
+            $result = $row->{$field};
+        }
      }
      $sth->finish();

@@ -750,12 +752,15 @@
      my $query = qq(SELECT * FROM $table) .  
$self->_mythdb_condition('WHERE', 'AND', $condition, $flag);

      my $sth = $self->mythdb_handle->prepare($query);
-    $sth->execute;
      my @rows = ();
-    while (my $row = $sth->fetchrow_hashref())
+    if ($sth->execute)
      {
-        push(@rows, $row);
+        while (my $row = $sth->fetchrow_hashref())
+        {
+            push(@rows, $row);
+        }
      }
+    $sth->finish();
      my @fields = ();
      foreach my $field (keys %{$rows[0]})
      {
@@ -801,7 +806,6 @@
          foreach my $field (@fields) { field_print($row->{$field}, ' ',  
$lengths{$field}); } print "|" . "\n";
      }
      foreach my $field (@fields) { field_print('-'   , '-',  
$lengths{$field}); } print "|" . "\n";
-    $sth->finish();
  }

  sub mythdb_x_set

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"minimyth-commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/minimyth-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to