Bug #65929 [Opn->Csd]: RSET_HEADER pack size err PDO out/inout parameter

From: Date: Tue, 13 Jul 2021 13:16:02 +0000
Subject: Bug #65929 [Opn->Csd]: RSET_HEADER pack size err PDO out/inout parameter
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235000@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65929&edit=1 ID: 65929 Updated by: cmb@php.net Reported by: johanafm at gmail dot com Summary: RSET_HEADER pack size err PDO out/inout parameter -Status: Open +Status: Closed Type: Bug Package: PDO MySQL Operating System: OSX 10.8.5 PHP Version: 5.5.5 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: I can confirm @nikic's findings, i.e. the warnings have been resolved, but $out is not modified. It seems to me we would have to do something on PDO_PARAM_EVT_EXEC_POST instead of doing nothing[1]. However, the PHP manual already states[2]: | Some drivers support the invocation of stored procedures that | return data as output parameters, and some also as input/output | parameters that both send in data and are updated to receive it. I have clarified this for the MySQL driver[3]. There is already request #79893 regarding proper inout/out parameter support, so this ticket can be closed. [1] <https://github.com/php/php-src/blob/PHP-7.4.21/ext/pdo_mysql/mysql_statement.c#L606-L612> [2] <https://www.php.net/manual/en/pdostatement.bindparam.php#refsect1-pdostatement.bindparam-description> [3] <https://github.com/php/doc-en/commit/14667574fb52348d6fb15471f53d244e9ca3f68e> Previous Comments: ------------------------------------------------------------------------ [2020-11-26 14:20:56] nikic@php.net I can't reproduce the "premature end of data" etc warnings, but I don't get a result either ($out stays zero). I had to disable emulated prepares to make it work at all. ------------------------------------------------------------------------ [2013-10-18 14:15:29] johanafm at gmail dot com Description: ------------ As reported by phpinfo pdo_mysql: mysqlnd 5.0.11-dev - 20120503 - $Id: 40933630edef551dfaca71298a83fad8d03d62d4 $ Test script: --------------- # The php code below makes use of this stored proc DELIMITER ## CREATE PROCEDURE out_bug(OUT param INT UNSIGNED) BEGIN SET param := 3; END## DELIMITER ; # php - prepard statement of above stored proc $out = 0; $s = $db->prepare('CALL out_bug(:out)'); $s->bindParam('out', $out, PDO::PARAM_INT | PDO::PARAM_INPUT_OUTPUT, 4); $s->execute(); echo 'out is: ' . $out; Expected result: ---------------- I would have expected the php code to execute without errors and $out to contain the value '3' as set in the stored procedure. Actual result: -------------- Warning: PDOStatement::execute(): Premature end of data (mysqlnd_wireprotocol.c:1113) Warning: PDOStatement::execute(): RSET_HEADER packet 1 bytes shorter than expected Warning: PDOStatement::execute(): Error reading result set's header Warning: PDOStatement::execute(): Premature end of data (mysqlnd_wireprotocol.c:1076) Warning: PDOStatement::execute(): RSET_HEADER packet 4 bytes shorter than expected Warning: PDOStatement::execute(): Error reading result set's header out is: 0 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=65929&edit=1

« previous php.bugs (#235000) next »