Permalink
Browse files

#1108 fix for pdosqlexec doesn't throw exception

Fix for pdosqlexec doesn't throw exception for the non-first SQL instruction.

http://www.phing.info/trac/ticket/1108

When pdosqlexec task process a dbdeploy file and we have a wrong SQL instruction but not the first instruction, PDO doesn't throw exception as explained in this bug ​https://bugs.php.net/bug.php?id=61613

To skip this bug, we can split the SQL file for a instruction for each delimiter.

Adding this control in DummyPDOQuerySplitter it works like a charm, the MySQL errors are showed.
  • Loading branch information...
1 parent 7ab91f9 commit 0671a325d069f317528b42db624cc725f90e1052 @corretge corretge committed Jun 11, 2014
Showing with 11 additions and 1 deletion.
  1. +11 −1 classes/phing/tasks/ext/pdo/DummyPDOQuerySplitter.php
@@ -57,8 +57,18 @@ public function nextQuery()
}
$sql .= " " . $line . "\n";
+
+ /**
+ * fix issue with PDO and wrong formated multistatements
+ * @issue 1108
+ */
+ if (StringHelper::endsWith($delimiter, $line))
+ {
+ break;
+ }
+
}
return $sql;
}
-}
+}

0 comments on commit 0671a32

Please sign in to comment.