diff --git a/codepot/etc/post-commit.in b/codepot/etc/post-commit.in index 3093911a..8f65b6c1 100644 --- a/codepot/etc/post-commit.in +++ b/codepot/etc/post-commit.in @@ -69,15 +69,20 @@ sub write_commit_log my $message = "svn,$projectid,$revision"; my $createdon = strftime ('%Y-%m-%d %H:%M:%S', localtime()); - my $query = $dbh->prepare ("INSERT INTO ${prefix}log(type,projectid,message,createdon,action,userid) VALUES(?,?,?,?,?,?)"); + $dbh->begin_work (); + + my $query = $dbh->prepare ("INSERT INTO ${prefix}log (type,projectid,message,createdon,action,userid) VALUES (?,?,?,?,?,?)"); if (!$query || !$query->execute ('code', $projectid, $message, $createdon, 'commit', $userid)) { + my $errstr = $dbh->errstr(); + $query->finish (); $dbh->rollback (); - return (-1, $dbh->errstr()); + return (-1, $errstr); } + $query->finish (); $dbh->commit (); - return 0; + return (0, undef); } #------------------------------------------------------------ diff --git a/codepot/etc/post-revprop-change.in b/codepot/etc/post-revprop-change.in index c76045ed..fb96b073 100644 --- a/codepot/etc/post-revprop-change.in +++ b/codepot/etc/post-revprop-change.in @@ -83,15 +83,20 @@ sub write_revprop_change_log my $message = "svn,$projectid,$revision,$propname,$action"; my $createdon = strftime ('%Y-%m-%d %H:%M:%S', localtime()); - my $query = $dbh->prepare ("INSERT INTO ${prefix}log(type,projectid,message,createdon,action,userid) VALUES(?,?,?,?,?,?)"); + $dbh->begin_word (); + + my $query = $dbh->prepare ("INSERT INTO ${prefix}log (type,projectid,message,createdon,action,userid) VALUES (?,?,?,?,?,?)"); if (!$query || !$query->execute ('code', $projectid, $message, $createdon, 'revpropchange', $userid)) { - $dbh->rollback (); - return (-1, $dbh->errstr()); - } + my $errstr = $dbh->errstr(); + $query->finish (); + $dbh->rollback (); + return (-1, $errstr); + } + $query->finish (); $dbh->commit (); - return 0; + return (0, undef); } #------------------------------------------------------------ diff --git a/codepot/etc/pre-revprop-change.in b/codepot/etc/pre-revprop-change.in index f5a857c0..2cc35909 100644 --- a/codepot/etc/pre-revprop-change.in +++ b/codepot/etc/pre-revprop-change.in @@ -69,6 +69,7 @@ sub is_project_member } my @row = $query->fetchrow_array; + $query->finish (); return (((scalar(@row) > 0)? 1: 0), undef); } diff --git a/codepot/etc/start-commit.in b/codepot/etc/start-commit.in index aef90252..5b1fba32 100644 --- a/codepot/etc/start-commit.in +++ b/codepot/etc/start-commit.in @@ -66,6 +66,7 @@ sub is_project_member } my @row = $query->fetchrow_array; + $query->finish (); return (((scalar(@row) > 0)? 1: 0), undef); } @@ -80,6 +81,7 @@ sub is_project_commitable } my @row = $query->fetchrow_array; + $query->finish (); return (((scalar(@row) > 0 && $row[0] eq 'Y')? 1: 0), undef); }