From 5c06c0c50677348d560d860a939a73880654ffcd Mon Sep 17 00:00:00 2001 From: Peter Reilly Date: Sat, 30 Dec 2006 23:51:05 +0000 Subject: [PATCH] Bugzilla 41264: douple expansion in git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@491347 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 3 +++ docs/manual/CoreTasks/sql.html | 2 +- src/main/org/apache/tools/ant/taskdefs/SQLExec.java | 9 ++++----- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/WHATSNEW b/WHATSNEW index 4555b1dd3..67bf04a45 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -20,6 +20,9 @@ Fixed bugs: * Target from imported file listed twice in projecthelp. Bugzilla report 41226. +* task double-expands properties if expandproperties is true, + and expands properties if expandproperties is false. + Bugzilla report 41204. Other changes: -------------- diff --git a/docs/manual/CoreTasks/sql.html b/docs/manual/CoreTasks/sql.html index b550b750b..81c0e8ec1 100644 --- a/docs/manual/CoreTasks/sql.html +++ b/docs/manual/CoreTasks/sql.html @@ -185,7 +185,7 @@ and abort execution and transaction and fail task.

expandproperties Set to true to turn on property expansion in nested SQL, inline in the task or nested transactions. Since Ant 1.7. - No (default=false) + No (default=true) diff --git a/src/main/org/apache/tools/ant/taskdefs/SQLExec.java b/src/main/org/apache/tools/ant/taskdefs/SQLExec.java index 9fbd0b1b7..aadcf84bb 100644 --- a/src/main/org/apache/tools/ant/taskdefs/SQLExec.java +++ b/src/main/org/apache/tools/ant/taskdefs/SQLExec.java @@ -190,7 +190,7 @@ public class SQLExec extends JDBCTask { * * @since Ant 1.7 */ - private boolean expandProperties = false; + private boolean expandProperties = true; /** * Set the name of the SQL file to be run. @@ -491,7 +491,9 @@ public class SQLExec extends JDBCTask { if (!keepformat) { line = line.trim(); } - line = getProject().replaceProperties(line); + if (expandProperties) { + line = getProject().replaceProperties(line); + } if (!keepformat) { if (line.startsWith("//")) { continue; @@ -738,9 +740,6 @@ public class SQLExec extends JDBCTask { */ public void addText(String sql) { if (sql != null) { - if (getExpandProperties()) { - sql = getProject().replaceProperties(sql); - } this.tSqlCommand += sql; } }