prepare release 2.1.5
[m6w6/ext-pq] / tests / stm_deallocate_prepare001.phpt
1 --TEST--
2 Deallocated and prepare statement
3 --SKIPIF--
4 <?php include "_skipif.inc"; ?>
5 --FILE--
6 <?php
7 echo "Test\n";
8 include "_setup.inc";
9
10 $c = new pq\Connection(PQ_DSN);
11 $s = $c->prepare("test1", "SELECT 'test' || \$1");
12
13 $r = $s->exec(array("ing"));
14 $r->fetchCol($d);
15 var_dump($d);
16
17 $s->deallocate();
18
19 try {
20 $s->exec(array("ing"));
21 } catch (pq\Exception\BadMethodCallException $e) {
22 echo "Caught exception\n";
23 }
24
25 $s->prepare();
26
27 $r = $s->exec(array("ing"));
28 $r->fetchCol($d);
29 var_dump($d);
30
31 ?>
32 DONE
33 --EXPECT--
34 Test
35 string(7) "testing"
36 Caught exception
37 string(7) "testing"
38 DONE