Skip to content

Commit

Permalink
pdo statement execute fix
Browse files Browse the repository at this point in the history
- closing pending reader if there are two or more prepared statements executed
- fixes #1069
  • Loading branch information
jakubmisek committed Oct 8, 2022
1 parent 472fb71 commit 74788bd
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/PDO/Peachpie.Library.PDO/PDOStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,9 @@ public virtual bool closeCursor()
/// <returns>Returns TRUE on success or FALSE on failure</returns>
public virtual bool execute(PhpArray input_parameters = null)
{
if (Result != null)
{
// reusing command
Connection.ClosePendingReader();
}
// close previous pending reader
// https://github.com/peachpiecompiler/peachpie/issues/1069
Connection.ClosePendingReader();

// parameters
BindParameters(_cmd.Parameters, input_parameters);
Expand Down

0 comments on commit 74788bd

Please # to comment.