I am running a server on Ubuntu 16.04 LTS with PHP 7.0 and MySQL 5.7.25. When running code snippet A MySQL logs "[Note] Aborted connection 23345 to db" upon trying to close the connection. This only happens when calling the stored procedure as seen in snippet A but not when directly executing the query as shown in snippet B.
Snippet A
<?php
$database = new mysqli( 'localhost' , 'user' , 'test' , 'database' );
$result = $database->query("CALL any_call();"); // returns true
$result->close();
$database->close();
?>
Snippet B
<?php
$database = new mysqli( 'localhost' , 'user' , 'test' , 'database' );
$result = $database->query("SELECT true;");
$result->close();
$database->close();
?>
Through trial and error I have found out that adding a $database->next_result();
solves the issue. But of course this can only be a workaround and not a solution to the actual problem.
Does anybody have an idea why this behavior occurs?
Thanks