1--TEST--
2PDO_DBLIB: driver supports multiple queries in a single \PDO::query() call that doesn't return any rowsets
3--EXTENSIONS--
4pdo_dblib
5--SKIPIF--
6<?php
7require __DIR__ . '/config.inc';
8
9if (!driver_supports_batch_statements_without_select($db)) die('xfail test will fail with this version of FreeTDS');
10?>
11--FILE--
12<?php
13require __DIR__ . '/config.inc';
14
15$stmt = $db->query(
16"create table #php_pdo(id int);" .
17"insert into #php_pdo values(1), (2), (3);" .
18"update #php_pdo set id = 1;" .
19"insert into #php_pdo values(2);" .
20"drop table #php_pdo;"
21);
22
23// check results from the create table
24var_dump($stmt->rowCount());
25var_dump($stmt->nextRowset());
26
27// check results from the first insert
28var_dump($stmt->rowCount());
29var_dump($stmt->nextRowset());
30
31// check results from the update
32var_dump($stmt->rowCount());
33var_dump($stmt->nextRowset());
34
35// check results from the second insert
36var_dump($stmt->rowCount());
37var_dump($stmt->nextRowset());
38
39// check results from the drop
40var_dump($stmt->rowCount());
41var_dump($stmt->nextRowset());
42
43// check that there are no more results
44var_dump($stmt->rowCount());
45var_dump($stmt->nextRowset());
46
47?>
48--EXPECT--
49int(-1)
50bool(true)
51int(3)
52bool(true)
53int(3)
54bool(true)
55int(1)
56bool(true)
57int(-1)
58bool(false)
59int(-1)
60bool(false)
61