Browse Source

Bugzilla 41264: douple expansion in <sql>

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@491347 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 18 years ago
parent
commit
5c06c0c506
3 changed files with 8 additions and 6 deletions
  1. +3
    -0
      WHATSNEW
  2. +1
    -1
      docs/manual/CoreTasks/sql.html
  3. +4
    -5
      src/main/org/apache/tools/ant/taskdefs/SQLExec.java

+ 3
- 0
WHATSNEW View File

@@ -20,6 +20,9 @@ Fixed bugs:
* 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:
--------------


+ 1
- 1
docs/manual/CoreTasks/sql.html View File

@@ -185,7 +185,7 @@ and <b>abort</b> execution and transaction and fail task.</p>
<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>


+ 4
- 5
src/main/org/apache/tools/ant/taskdefs/SQLExec.java View File

@@ -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;
}
}


Loading…
Cancel
Save