Skip to content

Commit 5d4c691

Browse files
author
ULF WENDEL
committed
Merge branch 'PHP-5.4'
* PHP-5.4: This won't make the test pass but now its at least one that shows no unnecessary error messages...
2 parents db35ca4 + 056ecf3 commit 5d4c691

File tree

1 file changed

+31
-26
lines changed

1 file changed

+31
-26
lines changed

ext/pdo_mysql/tests/bug_61207.phpt

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22
PDO MySQL Bug #61207 (PDO::nextRowset() after a multi-statement query doesn't always work)
33
--SKIPIF--
44
<?php
5-
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
6-
require dirname(__FILE__) . '/config.inc';
7-
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
8-
PDOTest::skip();
5+
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
6+
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
7+
MySQLPDOTest::skip();
8+
99
?>
1010
--FILE--
1111
<?php
12-
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
12+
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
13+
$db = MySQLPDOTest::factory();
1314

14-
$link = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
15+
$db->query('DROP TABLE IF EXISTS test');
16+
$db->query('create table `test`( `id` int )');
1517

16-
$link->query('create table `bug61207`( `id` int )');
18+
$handle1 = $db->prepare('insert into test(id) values(1);
19+
select * from test where id = ?;
20+
update test set id = 2 where id = ?;');
1721

18-
$handle1 = $link->prepare('insert into bug61207(id) values(1);
19-
select * from bug61207 where id = ?;
20-
update bug61207 set id = 2 where id = ?;');
21-
2222
$handle1->bindValue('1', '1');
2323
$handle1->bindValue('2', '1');
24-
25-
$handle1->execute();
24+
25+
$handle1->execute();
2626
$i = 1;
2727
print("Handle 1:\n");
2828
do {
@@ -31,9 +31,9 @@ do {
3131
print("Results detected\n");
3232
} while($handle1->nextRowset());
3333

34-
$handle2 = $link->prepare('select * from bug61207 where id = ?;
35-
update bug61207 set id = 1 where id = ?;');
36-
34+
$handle2 = $db->prepare('select * from test where id = ?;
35+
update test set id = 1 where id = ?;');
36+
3737
$handle2->bindValue('1', '2');
3838
$handle2->bindValue('2', '2');
3939

@@ -47,9 +47,9 @@ do {
4747
print("Results detected\n");
4848
} while($handle2->nextRowset());
4949

50-
$handle3 = $link->prepare('update bug61207 set id = 2 where id = ?;
51-
select * from bug61207 where id = ?;');
52-
50+
$handle3 = $db->prepare('update test set id = 2 where id = ?;
51+
select * from test where id = ?;');
52+
5353
$handle3->bindValue('1', '1');
5454
$handle3->bindValue('2', '2');
5555

@@ -63,15 +63,15 @@ do {
6363
print("Results detected\n");
6464
} while($handle3->nextRowset());
6565

66-
$handle4 = $link->prepare('insert into bug61207(id) values(3);
67-
update bug61207 set id = 2 where id = ?;
68-
select * from bug61207 where id = ?;');
69-
66+
$handle4 = $db->prepare('insert into test(id) values(3);
67+
update test set id = 2 where id = ?;
68+
select * from test where id = ?;');
69+
7070
$handle4->bindValue('1', '3');
7171
$handle4->bindValue('2', '2');
72-
72+
7373
$handle4->execute();
74-
74+
7575
$i = 1;
7676
print("Handle 4:\n");
7777
do {
@@ -80,7 +80,12 @@ do {
8080
print("Results detected\n");
8181
} while($handle1->nextRowset());
8282

83-
$link->query("DROP TABLE bug61207");
83+
$db->query("DROP TABLE test");
84+
?>
85+
--CLEAN--
86+
<?php
87+
require dirname(__FILE__) . '/mysql_pdo_test.inc';
88+
MySQLPDOTest::dropTestTable();
8489
?>
8590
--EXPECT--
8691
Handle 1:

0 commit comments

Comments
 (0)