ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 11873] New: - SQLExec truncates any statement from the '--' pattern, when '--' is part of a string being inserted
Date Tue, 20 Aug 2002 20:24:09 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11873>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11873

SQLExec truncates any statement from the '--' pattern, when '--' is part of a string being
inserted

           Summary: SQLExec truncates any statement from the '--' pattern,
                    when '--' is part of a string being inserted
           Product: Ant
           Version: 1.5
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Major
          Priority: Other
         Component: Core tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: michael@michaelbrinkman.com


On line 457 of org.apache.tools.ant.taskdefs.SQLExec of the Ant v1.5 full 
release source code, a comment describes "--" as a SQL "comment to end of 
line" flag, which is correct.  The code then appends a newline character at 
the end of the "comment" and the next line in the SQL script is appended.  

I think that this is incorrect behavior in the case where the SQL statement 
contains a string being inserted which itself contains the "--" pattern.  For 
example, the following SQL statments would break because they would be 
appended together:

insert into PERSON values ("Michael -- not a SQL expert", "Brinkman");
insert into PERSON values ("John", "Doe");

I'm definitely not a SQL expert, so I may be incorrect in assuming the 
behavior to be wrong, but if it is incorrect behavior, let me say that it's 
hard to work around.

Fixing this behavior would be non-trivial because it would require parsing the 
statement to understand if the "--" string was part of a string being inserted 
in the database.

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


Mime
View raw message