Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2865A200C79 for ; Fri, 5 May 2017 05:51:19 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 27054160BC4; Fri, 5 May 2017 03:51:19 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6E576160BB0 for ; Fri, 5 May 2017 05:51:18 +0200 (CEST) Received: (qmail 18926 invoked by uid 500); 5 May 2017 03:51:17 -0000 Mailing-List: contact commits-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list commits@groovy.apache.org Received: (qmail 18917 invoked by uid 99); 5 May 2017 03:51:17 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 May 2017 03:51:17 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 413C5DFBC7; Fri, 5 May 2017 03:51:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: paulk@apache.org To: commits@groovy.apache.org Message-Id: <86635dd34deb4cebac19259575398e98@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: groovy git commit: GROOVY-8174: Groovy.Sql+Oracle parameter substitution problem (closes #534) Date: Fri, 5 May 2017 03:51:17 +0000 (UTC) archived-at: Fri, 05 May 2017 03:51:19 -0000 Repository: groovy Updated Branches: refs/heads/master 942cf4eb3 -> 01df7b53c GROOVY-8174: Groovy.Sql+Oracle parameter substitution problem (closes #534) Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/01df7b53 Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/01df7b53 Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/01df7b53 Branch: refs/heads/master Commit: 01df7b53c2361693cb0efbcf3636b55e89b5da82 Parents: 942cf4e Author: paulk Authored: Thu May 4 10:53:41 2017 +1000 Committer: paulk Committed: Fri May 5 13:49:27 2017 +1000 ---------------------------------------------------------------------- subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/01df7b53/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java ---------------------------------------------------------------------- diff --git a/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java b/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java index 26d52df..fd0ff13 100644 --- a/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java +++ b/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java @@ -4114,8 +4114,10 @@ public class Sql { Map paramsMap = (Map) params.get(0); if (paramsMap.isEmpty()) return; } - if (metaData.getParameterCount() != params.size()) { + if (metaData.getParameterCount() < params.size()) { throw new IllegalArgumentException("Found " + metaData.getParameterCount() + " parameter placeholders but supplied with " + params.size() + " parameters"); + } else if (metaData.getParameterCount() != params.size()) { + LOG.warning("Found " + metaData.getParameterCount() + " parameter placeholders but supplied with " + params.size() + " parameters"); } } for (Object value : params) {