git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@491347 13f79535-47bb-0310-9956-ffa450edef68master
@@ -20,6 +20,9 @@ Fixed bugs: | |||||
* Target from imported file listed twice in projecthelp. | * Target from imported file listed twice in projecthelp. | ||||
Bugzilla report 41226. | Bugzilla report 41226. | ||||
* <sql> task double-expands properties if expandproperties is true, | |||||
and expands properties if expandproperties is false. | |||||
Bugzilla report 41204. | |||||
Other changes: | Other changes: | ||||
-------------- | -------------- | ||||
@@ -185,7 +185,7 @@ and <b>abort</b> execution and transaction and fail task.</p> | |||||
<td width="12%" valign="top">expandproperties</td> | <td width="12%" valign="top">expandproperties</td> | ||||
<td width="78%" valign="top">Set to true to turn on property expansion in | <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>. | 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> | </tr> | ||||
</table> | </table> | ||||
@@ -190,7 +190,7 @@ public class SQLExec extends JDBCTask { | |||||
* | * | ||||
* @since Ant 1.7 | * @since Ant 1.7 | ||||
*/ | */ | ||||
private boolean expandProperties = false; | |||||
private boolean expandProperties = true; | |||||
/** | /** | ||||
* Set the name of the SQL file to be run. | * Set the name of the SQL file to be run. | ||||
@@ -491,7 +491,9 @@ public class SQLExec extends JDBCTask { | |||||
if (!keepformat) { | if (!keepformat) { | ||||
line = line.trim(); | line = line.trim(); | ||||
} | } | ||||
line = getProject().replaceProperties(line); | |||||
if (expandProperties) { | |||||
line = getProject().replaceProperties(line); | |||||
} | |||||
if (!keepformat) { | if (!keepformat) { | ||||
if (line.startsWith("//")) { | if (line.startsWith("//")) { | ||||
continue; | continue; | ||||
@@ -738,9 +740,6 @@ public class SQLExec extends JDBCTask { | |||||
*/ | */ | ||||
public void addText(String sql) { | public void addText(String sql) { | ||||
if (sql != null) { | if (sql != null) { | ||||
if (getExpandProperties()) { | |||||
sql = getProject().replaceProperties(sql); | |||||
} | |||||
this.tSqlCommand += sql; | this.tSqlCommand += sql; | ||||
} | } | ||||
} | } | ||||