Bug #41997 [Com]: SP call yields additional empty result set

From: Date: Tue, 01 Oct 2019 13:31:23 +0000
Subject: Bug #41997 [Com]: SP call yields additional empty result set
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-222976@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=41997&edit=1

 ID:                 41997
 Comment by:         attila at szeremi dot org
 Reported by:        nitel_defect at yahoo dot com
 Summary:            SP call yields additional empty result set
 Status:             Closed
 Type:               Bug
 Package:            PDO MySQL
 Operating System:   *
 PHP Version:        5.2.3
 Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Could the fix to this issue have caused breakage with empty rowset iteration loops?

I had been using the workaround mentioned in the below ticket to be able to trigger exceptions in
multi-statement PDO MySQL queries:
https://bugs.php.net/bug.php?id=61613

But I can pretty much confirm that my test code that does while
($statement->nextRowset()); after a multi-statement query that in Bitbucket pipelines
using the PHP 7.3.10 image the query doesn't seem to run at all (or maybe just the first one?),
but in PHP 7.3.9 the multi-line statement is run correctly.

I would test in 3v4l, but I don't know how to test DB stuff there.


Previous Comments:
------------------------------------------------------------------------
[2019-09-03 11:34:28] cmb@php.net

Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=41a4379cb45419a376043ca5f8c5a2bca82cea7c
Log: Fix #41997: SP call yields additional empty result set

------------------------------------------------------------------------
[2019-08-06 12:58:24] cmb@php.net

The following pull request has been associated:

Patch Name: Fix #41997: SP call yields additional empty result set
On GitHub:  https://github.com/php/php-src/pull/4496
Patch:      https://github.com/php/php-src/pull/4496.patch

------------------------------------------------------------------------
[2019-08-06 12:57:58] cmb@php.net

> not sure about libmysqlclient yet

Behaves the same.

------------------------------------------------------------------------
[2019-08-05 07:58:19] cmb@php.net

The originally reported issue has been basically resolved, but the
fix for bug #40935 broke the test case as reported by stas@ above.
The relevant behavior of calling stored procedures is described in
the documentation[1]:

| The final result from the procedure is a status result that
| includes no result set. The status indicates whether the procedure
| succeeded or an error occurred.

This is not properly handled by mysqlnd, though (not sure about
libmysqlclient yet), which simply proceeds to this status result
when ::nextRowset() is called, but then errors because the actual
result set is missing.

[1] <https://dev.mysql.com/doc/refman/8.0/en/c-api-multiple-queries.html>

------------------------------------------------------------------------
[2019-08-05 07:40:05] cmb@php.net

Related To: Bug #39858

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=41997


--
Edit this bug report at https://bugs.php.net/bug.php?id=41997&edit=1


Thread (21 messages)

« previous php.bugs (#222976) next »