From patchwork Fri Jul 8 18:26:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 9221663 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9829960467 for ; Fri, 8 Jul 2016 18:28:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C81C2836F for ; Fri, 8 Jul 2016 18:28:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8190028375; Fri, 8 Jul 2016 18:28:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 400AA28387 for ; Fri, 8 Jul 2016 18:28:53 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLaUC-0003sS-L5; Fri, 08 Jul 2016 18:26:48 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bLaUA-0003pc-7w for xen-devel@lists.xenproject.org; Fri, 08 Jul 2016 18:26:46 +0000 Received: from [193.109.254.147] by server-14.bemta-14.messagelabs.com id DD/63-27600-560FF775; Fri, 08 Jul 2016 18:26:45 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphkeJIrShJLcpLzFFi42JxWrohUjf1Q32 4wd/TTBbft0xmcmD0OPzhCksAYxRrZl5SfkUCa0ZL+0v2giucFTu39TM3MB5g72Lk5JAQ8Jf4 1DCdCcRmE9CVaNryl62LkYNDREBF4vZeAxCTWSBUYscLS5AKYYEYiTeXOllBbBagikWv/7KA2 LwCnhJzz99lg5goJ3H++E9mEJsTKL5ryU2wTUICHhLNv5oYQUYKCahJzF0fD9EqKHFy5hOwMc wCEhIHX7xgBimREOCW+NttP4GRbxaSqllIqhYwMq1iVC9OLSpLLdI11EsqykzPKMlNzMzRNTQ 00ctNLS5OTE/NSUwq1kvOz93ECAwlBiDYwXi00/kQoyQHk5Io775n9eFCfEn5KZUZicUZ8UWl OanFhxhlODiUJHiZ3wPlBItS01Mr0jJzgEENk5bg4FES4WUESfMWFyTmFmemQ6ROMSpKifO+e QeUEABJZJTmwbXBIukSo6yUMC8j0CFCPAWpRbmZJajyrxjFORiVhHnPgkzhycwrgZv+CmgxE9 BigwCwxSWJCCmpBsa9thqxjqeTJjrJNHE9ieGPeeXBY15svO99tbDb8RX6z85WLU/tl+l7Lv/ tTug2/YLCxOsrOVv2r1g/Q1x8jWV9677mW2l2R20kSm4EVvpo2PyvOmIkqiha0Hb9WpqErd7K qZI+c46wnH5k6vLtTkzV8b4VT/QNJtU1aYkzduZsduqSUtufrMRSnJFoqMVcVJwIABmbLbyfA gAA X-Env-Sender: prvs=9904f56b2=Ian.Jackson@citrix.com X-Msg-Ref: server-9.tower-27.messagelabs.com!1468002402!52679415!2 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.77; banners=-,-,- X-VirusChecked: Checked Received: (qmail 10530 invoked from network); 8 Jul 2016 18:26:44 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-9.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 8 Jul 2016 18:26:44 -0000 X-IronPort-AV: E=Sophos;i="5.28,331,1464652800"; d="scan'208";a="365150949" From: Ian Jackson To: Date: Fri, 8 Jul 2016 19:26:06 +0100 Message-ID: <1468002385-4407-15-git-send-email-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1468002385-4407-1-git-send-email-ian.jackson@eu.citrix.com> References: <1468002385-4407-1-git-send-email-ian.jackson@eu.citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Ian Jackson Subject: [Xen-devel] [OSSTEST PATCH 14/33] Database locking: Tcl: Always use db-execute-array for SELECT X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Ian Campbell --- 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 27fc04c..14c8cda 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]