]> git.donarmstrong.com Git - infobot.git/commitdiff
handle missing table
authortimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Thu, 21 Nov 2002 21:09:19 +0000 (21:09 +0000)
committertimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Thu, 21 Nov 2002 21:09:19 +0000 (21:09 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@667 c11ca15a-4712-0410-83d8-924469b57eb5

src/dbi.pl

index 2d12f56cd769cf49fa1f3253a7f57e4e20d667f7..aefd3932af0de9354106059068eac74948ec8ce5 100644 (file)
@@ -166,7 +166,11 @@ sub dbGetColNiceHash {
     $query     .= " WHERE ".$where if ($where);
     my %retval;
 
-    my $sth = $dbh->prepare($query);
+    my $sth;
+    if (!($sth = $dbh->prepare($query))) {
+       &ERROR("GetColNiceHash: prepare: $DBI::errstr");
+       return;
+    }
     &SQLDebug($query);
     if (!$sth->execute) {
        &ERROR("GetColNiceHash: execute: '$query'");
@@ -175,7 +179,7 @@ sub dbGetColNiceHash {
        return;
     }
 
-    %retval = %{ $sth->fetchrow_hashref() };
+    %retval = %{ $sth->fetchrow_hashref() } if $sth->fetchrow_hashref();
 
     $sth->finish;
 
@@ -608,7 +612,7 @@ sub checkTables {
        }
     }
 
-    foreach ( qw(factoids freshmeat rootwarn seen stats) ) {
+    foreach ( qw(factoids freshmeat rootwarn seen stats botmail) ) {
        next if (exists $db{$_});
        &status("checkTables: creating new table $_...");