From: rettenbe Date: Tue, 30 Sep 2008 09:16:57 +0000 (+0000) Subject: debug modus for DBmysql.pm X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f64d03a847306387574cefcb73745ebf20f10b02;p=gosa.git debug modus for DBmysql.pm git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12560 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/modules/DBmysql.pm b/gosa-si/modules/DBmysql.pm index 54e877dba..7a7f67f7e 100644 --- a/gosa-si/modules/DBmysql.pm +++ b/gosa-si/modules/DBmysql.pm @@ -253,26 +253,26 @@ sub exec_statement { my @db_answer; # print STDERR Dumper($sql_statement); - eval { +# eval { if($sql_statement =~ /^SELECT/i) { - $sth = $self->{dbh}->prepare($sql_statement) or &main::daemon_log("ERROR: Preparation of statement '$sql_statement' failed!", 1); - $sth->execute or &main::daemon_log("ERROR: Execution of statement '$sql_statement' failed!", 1); + $sth = $self->{dbh}->prepare($sql_statement) or &main::daemon_log("0 ERROR: Preparation of statement '$sql_statement' failed!", 1); + $sth->execute or &main::daemon_log("0 ERROR: Execution of statement '$sql_statement' failed!", 1); if($sth->rows > 0) { - @db_answer = @{ $sth->fetchall_arrayref() } or &main::daemon_log("ERROR: Fetch() failed!", 1); + @db_answer = @{ $sth->fetchall_arrayref() } or &main::daemon_log("0 ERROR: Fetch() failed!", 1); # print STDERR Dumper(@db_answer); } - $sth->finish or &main::daemon_log("ERROR: Finishing the statement handle failed!", 1); + $sth->finish or &main::daemon_log("0 ERROR: Finishing the statement handle failed!", 1); } else { $self->{dbh}->do($sql_statement); } - }; - if($@) { - &main::daemon_log("ERROR: $sql_statement failed with '$@'", 1); - } +# }; +# if($@) { +# &main::daemon_log("0 ERROR: '$sql_statement' failed with '$@'", 1); +# } # TODO : maybe an error handling and an erro feedback to invoking function my $error = $self->{dbh}->err; if ($error) { - &main::daemon_log("ERROR: ".@$self->{dbh}->errstr, 1); + &main::daemon_log("0 ERROR: ".@$self->{dbh}->errstr, 1); } return \@db_answer;