Ticket #9 (closed defect: fixed)
CreoleSQLExecTask fails with Oracle
| Reported by: | vsa@… | Owned by: | mrook |
|---|---|---|---|
| Priority: | major | Milestone: | 2.2.0 |
| Component: | Version: | 2.2.0RC1 | |
| Keywords: | Cc: |
Description
I want to execute SQL code on a Oracle 10gR2 base but the Oracle driver throws an exception:
ORA-00911: invalid character
So I looked to the code and found that the trailing delimiter is not removed. Mysql doesn't care about it but Oracle does. This is the patch I use to fix it:
Index: classes/phing/tasks/ext/CreoleSQLExecTask.php
===================================================================
--- classes/phing/tasks/ext/CreoleSQLExecTask.php (revision 31)
+++ classes/phing/tasks/ext/CreoleSQLExecTask.php (copie de travail)
@@ -390,7 +390,7 @@
|| $this->delimiterType == self::DELIM_ROW
&& $line == $this->delimiter) {
$this->log("SQL: " . $sql, PROJECT_MSG_VERBOSE);
- $this->execSQL(StringHelper::substring($sql, 0, strlen($sql) - strlen($this->delimiter)), $out);
+ $this->execSQL(StringHelper::substring($sql, 0, strlen($sql) - strlen($this->delimiter)) - 1, $out);
$sql = "";
}
}
I don't think many of you use this task but it would be cool to fix that for us in the next release.
Thanks
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
