File tree Expand file tree Collapse file tree 2 files changed +18
-16
lines changed Expand file tree Collapse file tree 2 files changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -349,6 +349,15 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt) /* {{{ */
349
349
PDO_DBG_ENTER ("pdo_mysql_stmt_next_rowset" );
350
350
PDO_DBG_INF_FMT ("stmt=%p" , S -> stmt );
351
351
352
+ /* ensure that we free any previous unfetched results */
353
+ if (S -> stmt ) {
354
+ mysql_stmt_free_result (S -> stmt );
355
+ }
356
+ if (S -> result ) {
357
+ mysql_free_result (S -> result );
358
+ S -> result = NULL ;
359
+ }
360
+
352
361
#ifdef PDO_USE_MYSQLND
353
362
if (!H -> emulate_prepare ) {
354
363
if (!mysqlnd_stmt_more_results (S -> stmt )) {
@@ -359,11 +368,6 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt) /* {{{ */
359
368
PDO_DBG_RETURN (0 );
360
369
}
361
370
362
- /* TODO - this code is stolen from execute() - see above */
363
- if (S -> result ) {
364
- mysql_free_result (S -> result );
365
- S -> result = NULL ;
366
- }
367
371
{
368
372
/* for SHOW/DESCRIBE and others the column/field count is not available before execute */
369
373
int i ;
@@ -394,17 +398,6 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt) /* {{{ */
394
398
}
395
399
#endif
396
400
397
- /* ensure that we free any previous unfetched results */
398
- #ifndef PDO_USE_MYSQLND
399
- if (S -> stmt ) {
400
- mysql_stmt_free_result (S -> stmt );
401
- }
402
- #endif
403
- if (S -> result ) {
404
- mysql_free_result (S -> result );
405
- S -> result = NULL ;
406
- }
407
-
408
401
if (!mysql_more_results (H -> server )) {
409
402
/* No more results */
410
403
PDO_DBG_RETURN (0 );
Original file line number Diff line number Diff line change @@ -57,6 +57,11 @@ if (!MySQLPDOTest::isPDOMySQLnd())
57
57
} while ($ stmt ->nextRowSet ());
58
58
var_dump ($ stmt ->nextRowSet ());
59
59
60
+ echo "Skip fetchAll(): " ;
61
+ unset($ stmt );
62
+ $ stmt = $ db ->query ('CALL p() ' );
63
+ var_dump ($ stmt ->nextRowSet ());
64
+ $ stmt ->closeCursor ();
60
65
}
61
66
62
67
try {
@@ -160,6 +165,7 @@ array(3) {
160
165
array(0) {
161
166
}
162
167
bool(false)
168
+ Skip fetchAll(): bool(true)
163
169
array(1) {
164
170
[0]=>
165
171
array(1) {
@@ -211,6 +217,7 @@ array(3) {
211
217
array(0) {
212
218
}
213
219
bool(false)
220
+ Skip fetchAll(): bool(true)
214
221
Native PS...
215
222
array(1) {
216
223
[0]=>
@@ -263,6 +270,7 @@ array(3) {
263
270
array(0) {
264
271
}
265
272
bool(false)
273
+ Skip fetchAll(): bool(true)
266
274
array(1) {
267
275
[0]=>
268
276
array(1) {
@@ -314,4 +322,5 @@ array(3) {
314
322
array(0) {
315
323
}
316
324
bool(false)
325
+ Skip fetchAll(): bool(true)
317
326
done!
You can’t perform that action at this time.
0 commit comments