From 1343a3bf175a39a899d350cdaf916dbfe8801301 Mon Sep 17 00:00:00 2001 From: timriker Date: Thu, 21 Nov 2002 21:09:19 +0000 Subject: [PATCH] handle missing table git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@667 c11ca15a-4712-0410-83d8-924469b57eb5 --- src/dbi.pl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/dbi.pl b/src/dbi.pl index 2d12f56..aefd393 100644 --- a/src/dbi.pl +++ b/src/dbi.pl @@ -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 $_..."); -- 2.39.2