This is an Ant bug: https://issues.apache.org/bugzilla/show_bug.cgi?id=43413
You need to include the attribute keepformat="true"
in your sql task:
<sql driver="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin....."
userid="scott"
password="tiger"
keepformat="true">
comment on table foo is 'Commenttest -- Testingtable';
</sql>