From: Ian Jackson Date: Thu, 14 Jul 2016 12:13:24 +0000 (+0100) Subject: Database locking: Tcl: Use db-update-1 in jobdb::become-task X-Git-Tag: openstack-v11~322^2~21 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=d80a9e8294822c4b490472fe9ea9351faee0b586;p=people%2Faperard%2Fosstest.git Database locking: Tcl: Use db-update-1 in jobdb::become-task db-update-1 contains the same error check found here. Isn't clear from the history why db-update-1 wasn't used right from the start. Signed-off-by: Ian Jackson --- v3: New patch --- diff --git a/tcl/JobDB-Executive.tcl b/tcl/JobDB-Executive.tcl index 239f22c2..237e07b7 100644 --- a/tcl/JobDB-Executive.tcl +++ b/tcl/JobDB-Executive.tcl @@ -275,17 +275,14 @@ proc become-task {comment} { set username "[id user]@$hostname" transaction resources { - set nrows [db-execute " + db-update-1 " UPDATE tasks SET username = [pg_quote $username], comment = [pg_quote $comment] WHERE taskid = $taskid AND type = [pg_quote [lindex $refinfo 0]] AND refkey = [pg_quote [lindex $refinfo 1]] - "] - } - if {$nrows != 1} { - error "$nrows $taskid $refinfo ?" + " } }