You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2005/10/19 22:12:28 UTC
DO NOT REPLY [Bug 37169] New: -
SQLExec.runStatements causes problems for JDK 1.5
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37169>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=37169
Summary: SQLExec.runStatements causes problems for JDK 1.5
Product: Ant
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Keywords: JDK1.5
Severity: normal
Priority: P2
Component: Core tasks
AssignedTo: dev@ant.apache.org
ReportedBy: david.messina@ieminc.com
We are using the <sql> task to read in a .sql file to populate a database. One
of the INSERT statements that is used to populate a variable unlimited length
column (declared as "TEXT" for Postgresql) is 1.5 million characters long.
Using Ant 1.6.5 with JDK 1.4, the task completes in a few seconds. However,
using the same version of Ant with JDK 1.5.0 (build 1.5.0_05-b05), it takes 36
minutes.
After debugging the SQLExec class, it appears that the runStatements method
contains an inefficient line of code. Line 483 contains this code:
if ((delimiterType.equals(DelimiterType.NORMAL)
&& sql.toString().endsWith(delimiter))
By using the buffer's toString(), the entire buffer is getting searched (in
addition to unneccessarily creating a new string) instead of using the last line
read to locate the delimiter.
If you change it to:
if ((delimiterType.equals(DelimiterType.NORMAL)
&& line.endsWith(delimiter))
the problem is fixed.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org