You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by pe...@apache.org on 2006/12/31 00:51:06 UTC

svn commit: r491347 - in /ant/core/trunk: WHATSNEW docs/manual/CoreTasks/sql.html src/main/org/apache/tools/ant/taskdefs/SQLExec.java

Author: peterreilly
Date: Sat Dec 30 15:51:05 2006
New Revision: 491347

URL: http://svn.apache.org/viewvc?view=rev&rev=491347
Log:
Bugzilla 41264: douple expansion in <sql>

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/docs/manual/CoreTasks/sql.html
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SQLExec.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=491347&r1=491346&r2=491347
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Sat Dec 30 15:51:05 2006
@@ -20,6 +20,9 @@
 * Target from imported file listed twice in projecthelp.
   Bugzilla report 41226.
 
+* <sql> task double-expands properties if expandproperties is true,
+  and expands properties if expandproperties is false.
+  Bugzilla report 41204.
 
 Other changes:
 --------------

Modified: ant/core/trunk/docs/manual/CoreTasks/sql.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTasks/sql.html?view=diff&rev=491347&r1=491346&r2=491347
==============================================================================
--- ant/core/trunk/docs/manual/CoreTasks/sql.html (original)
+++ ant/core/trunk/docs/manual/CoreTasks/sql.html Sat Dec 30 15:51:05 2006
@@ -185,7 +185,7 @@
   <td width="12%" valign="top">expandproperties</td>
   <td width="78%" valign="top">Set to true to turn on property expansion in
   nested SQL, inline in the task or nested transactions. <em>Since Ant 1.7</em>.
-  <td width="10%" valign="top">No (default=false)</td>
+  <td width="10%" valign="top">No (default=true)</td>
 </tr>
 
 </table>

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SQLExec.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SQLExec.java?view=diff&rev=491347&r1=491346&r2=491347
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SQLExec.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SQLExec.java Sat Dec 30 15:51:05 2006
@@ -190,7 +190,7 @@
      *
      * @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 @@
             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 void addText(String sql) {
             if (sql != null) {
-                if (getExpandProperties()) {
-                    sql = getProject().replaceProperties(sql);
-                }
                 this.tSqlCommand += sql;
             }
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org