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$db = getDbConnection();
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$db = getDbConnection();
16$stmt = $db->query(
17"create table #test_batch_stmt_ins_up(id int);" .
18"insert into #test_batch_stmt_ins_up values(1), (2), (3);" .
19"update #test_batch_stmt_ins_up set id = 1;" .
20"insert into #test_batch_stmt_ins_up values(2);" .
21"drop table #test_batch_stmt_ins_up;"
22);
23
24// check results from the create table
25var_dump($stmt->rowCount());
26var_dump($stmt->nextRowset());
27
28// check results from the first insert
29var_dump($stmt->rowCount());
30var_dump($stmt->nextRowset());
31
32// check results from the update
33var_dump($stmt->rowCount());
34var_dump($stmt->nextRowset());
35
36// check results from the second insert
37var_dump($stmt->rowCount());
38var_dump($stmt->nextRowset());
39
40// check results from the drop
41var_dump($stmt->rowCount());
42var_dump($stmt->nextRowset());
43
44// check that there are no more results
45var_dump($stmt->rowCount());
46var_dump($stmt->nextRowset());
47
48?>
49--EXPECT--
50int(-1)
51bool(true)
52int(3)
53bool(true)
54int(3)
55bool(true)
56int(1)
57bool(true)
58int(-1)
59bool(false)
60int(-1)
61bool(false)
62