List Info

Thread: DO NOT REPLY New: - ant sql task tries to execute commented lines with keepformat="tr




DO NOT REPLY New: - ant sql task tries to execute commented lines with keepformat="tr
country flaguser name
United States
2007-09-18 02:26:20
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=43
413>.
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=43413

           Summary: ant sql task tries to execute commented
lines with
                    keepformat="true" and fails
           Product: Ant
           Version: 1.7.0
          Platform: Other
        OS/Version: Windows NT
            Status: NEW
          Severity: major
          Priority: P2
         Component: Core tasks
        AssignedTo: devant.apache.org
        ReportedBy: barahlohot.ee


SQL task manual (http:
//ant.apache.org/manual/CoreTasks/sql.html) states, 
that "...Multiple statements can be provided, separated
by semicolons (or the 
defined delimiter). Individual lines within the statements
can be commented 
using either --, // or REM at the start of the
line..."

Having keepformat="true", ant sql task attempts to
execute commented lines and 
fails.

<target name="sql.test">
    <sql driver="${database.driver}" 
        url="${database.url}" 
        userid="${database.user_name}" 
        password="${database.user_pwd}"
        classpathref="classpath-database"
        keepformat="true"
    >
        <transaction>
            REM test
        </transaction>
    </sql>
</target>

Results in:
java.sql.SQLException: ORA-00900: invalid SQL statement

With other types of comments
<transaction>--test</transaction>
and
<transaction>//test</transaction>
execution results in:
java.sql.SQLException: Invalid SQL type

Having keepformat="false" all calls succeed.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=ema
il
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the
assignee.

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeant.apache.org
For additional commands, e-mail: dev-helpant.apache.org


DO NOT REPLY - ant sql task tries to execute commented lines with keepformat="true" a
country flaguser name
United States
2007-09-18 04:06:17
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=43
413>.
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=43413





------- Additional Comments From barahlohot.ee 
2007-09-18 02:06 -------
Attaching error stacktrace:

C:myprojectbuild.xml:23: java.sql.SQLException: Invalid
SQL type
        at
org.apache.tools.ant.taskdefs.SQLExec.execute(SQLExec.java:4
54)
        at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.j
ava:288)
        at
sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.tools.ant.dispatch.DispatchUtils.execute
(DispatchUtils.java:105)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at
org.apache.tools.ant.Target.execute(Target.java:357)
        at
org.apache.tools.ant.Target.performTasks(Target.java:385)
        at
org.apache.tools.ant.Project.executeSortedTargets(Project.ja
va:1329)
        at
org.apache.tools.ant.Project.executeTarget(Project.java:1298
)
        at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets
(DefaultExecutor.java:41)
        at
org.apache.tools.ant.Project.executeTargets(Project.java:118
1)
        at
org.apache.tools.ant.Main.runBuild(Main.java:698)
        at
org.apache.tools.ant.Main.startAnt(Main.java:199)
        at
org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
        at
org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

Caused by: java.sql.SQLException: Invalid SQL type
        at
oracle.jdbc.driver.DatabaseError.throwSqlException
(DatabaseError.java:112)
        at
oracle.jdbc.driver.DatabaseError.throwSqlException
(DatabaseError.java:146)
        at
oracle.jdbc.driver.DatabaseError.throwSqlException
(DatabaseError.java:208)
        at
oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:67
)
        at
oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.
java:946)
        at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout
(OracleStatement.java:1168)
        at
oracle.jdbc.driver.OracleStatement.executeInternal
(OracleStatement.java:1687)
        at
oracle.jdbc.driver.OracleStatement.execute(OracleStatement.j
ava:1653)
        at
org.apache.tools.ant.taskdefs.SQLExec.execSQL(SQLExec.java:5
64)
        at
org.apache.tools.ant.taskdefs.SQLExec.runStatements(SQLExec.
java:532)
        at
org.apache.tools.ant.taskdefs.SQLExec$Transaction.runTransac
tion
(SQLExec.java:768)
        at
org.apache.tools.ant.taskdefs.SQLExec$Transaction.access$000

(SQLExec.java:707)
        at
org.apache.tools.ant.taskdefs.SQLExec.execute(SQLExec.java:4
38)
        ... 16 more
--- Nested Exception ---
java.sql.SQLException: Invalid SQL type
        at
oracle.jdbc.driver.DatabaseError.throwSqlException
(DatabaseError.java:112)
        at
oracle.jdbc.driver.DatabaseError.throwSqlException
(DatabaseError.java:146)
        at
oracle.jdbc.driver.DatabaseError.throwSqlException
(DatabaseError.java:208)
        at
oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:67
)
        at
oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.
java:946)
        at
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout
(OracleStatement.java:1168)
        at
oracle.jdbc.driver.OracleStatement.executeInternal
(OracleStatement.java:1687)
        at
oracle.jdbc.driver.OracleStatement.execute(OracleStatement.j
ava:1653)
        at
org.apache.tools.ant.taskdefs.SQLExec.execSQL(SQLExec.java:5
64)
        at
org.apache.tools.ant.taskdefs.SQLExec.runStatements(SQLExec.
java:532)
        at
org.apache.tools.ant.taskdefs.SQLExec$Transaction.runTransac
tion
(SQLExec.java:768)
        at
org.apache.tools.ant.taskdefs.SQLExec$Transaction.access$000

(SQLExec.java:707)
        at
org.apache.tools.ant.taskdefs.SQLExec.execute(SQLExec.java:4
38)
        at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.j
ava:288)
        at
sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.tools.ant.dispatch.DispatchUtils.execute
(DispatchUtils.java:105)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at
org.apache.tools.ant.Target.execute(Target.java:357)
        at
org.apache.tools.ant.Target.performTasks(Target.java:385)
        at
org.apache.tools.ant.Project.executeSortedTargets(Project.ja
va:1329)
        at
org.apache.tools.ant.Project.executeTarget(Project.java:1298
)
        at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets
(DefaultExecutor.java:41)
        at
org.apache.tools.ant.Project.executeTargets(Project.java:118
1)
        at
org.apache.tools.ant.Main.runBuild(Main.java:698)
        at
org.apache.tools.ant.Main.startAnt(Main.java:199)
        at
org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
        at
org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=ema
il
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the
assignee.

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeant.apache.org
For additional commands, e-mail: dev-helpant.apache.org


DO NOT REPLY - ant sql task tries to execute commented lines with keepformat="true" a
country flaguser name
United States
2007-09-18 04:08:47
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=43
413>.
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=43413





------- Additional Comments From barahlohot.ee 
2007-09-18 02:08 -------
Note: when the commented line is surrounded by correct sql
clauses, script 
execution succeeds even with keepformat="true"

i.e. 

<transaction>
    select 1 from dual;
    -- test
    select 2 from dual;
</transaction>

is executed without errors

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=ema
il
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the
assignee.

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeant.apache.org
For additional commands, e-mail: dev-helpant.apache.org


DO NOT REPLY - ant sql task tries to execute commented lines with keepformat="true" a
country flaguser name
United States
2007-09-18 05:23:38
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=43
413>.
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=43413





------- Additional Comments From stevelapache.org  2007-09-18 03:23 -------
This doesnt surprise me; When I took the sql code for use in
my own project, I
took one look at the statement parsing code and decided to
leave it well alone.

Anyway, thanks for the tests; we should be able to replicate
this pretty easily.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=ema
il
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the
assignee.

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeant.apache.org
For additional commands, e-mail: dev-helpant.apache.org


DO NOT REPLY - ant sql task tries to execute commented lines with keepformat="true" a
country flaguser name
United States
2007-09-26 12:31:35
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=43
413>.
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=43413





------- Additional Comments From riznobhotmail.com  2007-09-26 10:31 -------
The keepformat attribute was created specifically for
loading sql packages, 
functions and procedures, in order to maintain the
formatting of the files 
being loaded, including comments. Unless you are loading
packages, functions or 
procedures, you probably want to leave
keepformat="false". 

-Rob Anderson

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=ema
il
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the
assignee.

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeant.apache.org
For additional commands, e-mail: dev-helpant.apache.org


[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )