1--TEST-- 2PDO_DBLIB: driver supports a batch of queries containing SELECT, INSERT, UPDATE, EXEC statements 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// creating a proc need to be a statement in it's own batch, so we need to do a little setup first 16$db->query("create table #php_pdo(id int); "); 17$db->query( 18"create proc php_pdo_exec_select_proc as " . 19"begin " . 20" insert into #php_pdo values(2), (3), (4); " . 21" select * from #php_pdo; " . 22"end; " 23); 24 25// now lets get some results 26$stmt = $db->query( 27"insert into #php_pdo values(1); " . 28"exec php_pdo_exec_select_proc; " . 29"drop table #php_pdo; " . 30"drop procedure php_pdo_exec_select_proc; "); 31 32// check results from the insert 33var_dump($stmt->rowCount()); 34var_dump($stmt->nextRowset()); 35 36// check results from the exec 37var_dump($stmt->rowCount()); 38var_dump($stmt->nextRowset()); 39 40// check results from the drop table 41var_dump($stmt->rowCount()); 42var_dump($stmt->nextRowset()); 43 44// check results from the drop procedure 45var_dump($stmt->rowCount()); 46var_dump($stmt->nextRowset()); 47 48// check that there are no more results 49var_dump($stmt->rowCount()); 50var_dump($stmt->nextRowset()); 51 52?> 53--EXPECT-- 54int(1) 55bool(true) 56int(-1) 57bool(true) 58int(-1) 59bool(true) 60int(-1) 61bool(false) 62int(-1) 63bool(false) 64