From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: [OSSTEST PATCH 4/7] Database locking: Tcl: Always use db-execute-array for SELECT Date: Thu, 7 Jan 2016 19:38:13 +0000 Message-ID: <1452195496-16016-5-git-send-email-ian.jackson@eu.citrix.com> References: <1452195496-16016-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aHGOI-0003UK-OJ for xen-devel@lists.xenproject.org; Thu, 07 Jan 2016 19:38:34 +0000 In-Reply-To: <1452195496-16016-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org We are going to make it wrong to use db-execute for SELECT statements. Convert the two existing violation sites (providing a dummy arrayvar). Signed-off-by: Ian Jackson --- sg-execute-flight | 2 +- tcl/JobDB-Executive.tcl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sg-execute-flight b/sg-execute-flight index 4e3fcf2..008e661 100755 --- a/sg-execute-flight +++ b/sg-execute-flight @@ -30,7 +30,7 @@ proc check {} { jobdb::db-open - set nqueued [jobdb::db-execute " + set nqueued [jobdb::db-execute-array dummy " SELECT job FROM jobs j WHERE j.flight = $flight AND j.status = 'queued' diff --git a/tcl/JobDB-Executive.tcl b/tcl/JobDB-Executive.tcl index 239f22c..bbce6fc 100644 --- a/tcl/JobDB-Executive.tcl +++ b/tcl/JobDB-Executive.tcl @@ -275,7 +275,7 @@ proc become-task {comment} { set username "[id user]@$hostname" transaction resources { - set nrows [db-execute " + set nrows [db-execute-array dummy " UPDATE tasks SET username = [pg_quote $username], comment = [pg_quote $comment] -- 1.7.10.4