Skip to content

Support stored procedures (multiple result sets) #171

@drucifer

Description

@drucifer

Calling a stored procedure results in an error:

React\MySQL\Exception: PROCEDURE test.simple can't return a result set in the given context in [path to my project]/react/mysql/src/Io/Parser.php on line 231

To reproduce, define a simple MySQL stored procedure:

mysql> delimiter //
USE test
CREATE PROCEDURE simple()
BEGIN
 SELECT CURRENT_DATE;
END;
//

call test.simple()//
+--------------+
| CURRENT_DATE |
+--------------+
| 2023-02-17   |
+--------------+

In PHP:

$dbh->query('CALL test.simple()', [])
  ->then(function (QueryResult $res) {
      var_dump([$res]);
    }, function ($ex) {
      var_dump($ex);
    });

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions