Skip to content

Commit 74788bd

Browse files
committed
pdo statement execute fix
- closing pending reader if there are two or more prepared statements executed - fixes #1069
1 parent 472fb71 commit 74788bd

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/PDO/Peachpie.Library.PDO/PDOStatement.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,9 @@ public virtual bool closeCursor()
321321
/// <returns>Returns TRUE on success or FALSE on failure</returns>
322322
public virtual bool execute(PhpArray input_parameters = null)
323323
{
324-
if (Result != null)
325-
{
326-
// reusing command
327-
Connection.ClosePendingReader();
328-
}
324+
// close previous pending reader
325+
// https://github.com/peachpiecompiler/peachpie/issues/1069
326+
Connection.ClosePendingReader();
329327

330328
// parameters
331329
BindParameters(_cmd.Parameters, input_parameters);

0 commit comments

Comments
 (0)