PHP  
 PHP_5_3
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/pdo_mysql/tests/bug_61207.phpt ('PDO MySQL Bug #61207 (PDO::nextRowset() after a multi-statement query doesn't always work)')

Script

1: <?php
2:
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
3:
4:
$link PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
5:
6:
$link->query('create table `bug61207`( `id` int )');
7:
8:
$handle1 $link->prepare('insert into bug61207(id) values(1);
9:                           select * from bug61207 where id = ?;
10:                           update bug61207 set id = 2 where id = ?;'
);
11:                              
12:
$handle1->bindValue('1''1');
13:
$handle1->bindValue('2''1');
14:                       
15:
$handle1->execute();   
16:
$i 1;
17: print(
"Handle 1:\n");
18: do {
19:     print(
'Rowset ' $i++ . "\n");
20:     if (
$handle1->columnCount() > 0)
21:         print(
"Results detected\n");
22: } while(
$handle1->nextRowset());
23:
24:
$handle2 $link->prepare('select * from bug61207 where id = ?;
25:                            update bug61207 set id = 1 where id = ?;'
);
26:                             
27:
$handle2->bindValue('1''2');
28:
$handle2->bindValue('2''2');
29:
30:
$handle2->execute();
31:
32:
$i 1;
33: print(
"Handle 2:\n");
34: do {
35:     print(
'Rowset ' $i++ . "\n");
36:     if (
$handle2->columnCount() > 0)
37:         print(
"Results detected\n");
38: } while(
$handle2->nextRowset());
39:
40:
$handle3 $link->prepare('update bug61207 set id = 2 where id = ?;
41:                            select * from bug61207 where id = ?;'
);
42:  
43:
$handle3->bindValue('1''1');
44:
$handle3->bindValue('2''2');
45:
46:
$handle3->execute();
47:
48:
$i 1;
49: print(
"Handle 3:\n");
50: do {
51:     print(
'Rowset ' $i++ . "\n");
52:     if (
$handle3->columnCount() > 0)
53:         print(
"Results detected\n");
54: } while(
$handle3->nextRowset());
55:
56:
$handle4 $link->prepare('insert into bug61207(id) values(3);
57:                            update bug61207 set id = 2 where id = ?;
58:                            select * from bug61207 where id = ?;'
);
59:                                                                   
60:
$handle4->bindValue('1''3');
61:
$handle4->bindValue('2''2');
62:                                            
63:
$handle4->execute();
64:       
65:
$i 1;
66: print(
"Handle 4:\n");
67: do {
68:     print(
'Rowset ' $i++ . "\n");
69:     if (
$handle1->columnCount() > 0)
70:         print(
"Results detected\n");
71: } while(
$handle1->nextRowset());
72:
73:
$link->query("DROP TABLE bug61207");
74:
?>
75:

Expected

Handle 1:
Rowset 1
Rowset 2
Results detected
Rowset 3
Handle 2:
Rowset 1
Results detected
Rowset 2
Handle 3:
Rowset 1
Rowset 2
Results detected
Handle 4:
Rowset 1
Rowset 2
Rowset 3
Results detected

Output

Warning: PDO::query(): SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'bug61207' already exists in /var/php_gcov/PHP_5_3/ext/pdo_mysql/tests/bug_61207.php on line 6
Handle 1:
Rowset 1
Rowset 2
Results detected
Handle 2:
Rowset 1
Results detected
Handle 3:
Rowset 1

Warning: PDOStatement::execute(): SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active.  Consider using PDOStatement::fetchAll().  Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. in /var/php_gcov/PHP_5_3/ext/pdo_mysql/tests/bug_61207.php on line 63
Handle 4:
Rowset 1

Warning: PDOStatement::nextRowset(): SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active.  Consider using PDOStatement::fetchAll().  Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. in /var/php_gcov/PHP_5_3/ext/pdo_mysql/tests/bug_61207.php on line 71

Warning: PDO::query(): SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active.  Consider using PDOStatement::fetchAll().  Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. in /var/php_gcov/PHP_5_3/ext/pdo_mysql/tests/bug_61207.php on line 73

Diff

001+ Warning: PDO::query(): SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'bug61207' already exists in /var/php_gcov/PHP_5_3/ext/pdo_mysql/tests/bug_61207.php on line 6
005- Rowset 3
009- Rowset 2
011+ 
012+ Warning: PDOStatement::execute(): SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active.  Consider using PDOStatement::fetchAll().  Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. in /var/php_gcov/PHP_5_3/ext/pdo_mysql/tests/bug_61207.php on line 63
012- Rowset 2
013- Results detected
015+ 
016+ Warning: PDOStatement::nextRowset(): SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active.  Consider using PDOStatement::fetchAll().  Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. in /var/php_gcov/PHP_5_3/ext/pdo_mysql/tests/bug_61207.php on line 71
017+ 
016- Rowset 2
017- Rowset 3
018- Results detected
018+ Warning: PDO::query(): SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active.  Consider using PDOStatement::fetchAll().  Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. in /var/php_gcov/PHP_5_3/ext/pdo_mysql/tests/bug_61207.php on line 73

 

Generated at Fri, 18 Apr 2014 07:01:42 +0000 (7 days ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.