https://issues.apache.org/bugzilla/show_bug.cgi?id=30502





--- Comment #3 from Laurent Courtin <[EMAIL PROTECTED]>  2008-03-25 06:30:22 
PST ---
Same problems with :
insert into dm_prod_macro_family (id, descr) values ('***********', '---');


Proposed correction :
Remove all strings values before making the test of comment.

Something like this :
In src/main/org/apache/tools/ant/taskdefs/SQLExec.java, replace 

            // SQL defines "--" as a comment to EOL
            // and in Oracle it may contain a hint
            // so we cannot just remove it, instead we must end it
            if (!keepformat) {
                if (line.indexOf("--") >= 0) {
                    sql.append("\n");
                }
            }

by

            // SQL defines "--" as a comment to EOL
            // and in Oracle it may contain a hint
            // so we cannot just remove it, instead we must end it
            if (!keepformat) {
                if (line.replaceAll("'.*?'", "''").indexOf("--") >= 0) {
                    sql.append("\n");
                }
            }

Regards,


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Reply via email to