mirror of
https://github.com/danog/ext-pq.git
synced 2024-12-02 09:18:02 +01:00
39 lines
583 B
Plaintext
39 lines
583 B
Plaintext
|
--TEST--
|
||
|
Deallocated and prepare statement
|
||
|
--SKIPIF--
|
||
|
<?php include "_skipif.inc"; ?>
|
||
|
--FILE--
|
||
|
<?php
|
||
|
echo "Test\n";
|
||
|
include "_setup.inc";
|
||
|
|
||
|
$c = new pq\Connection(PQ_DSN);
|
||
|
$s = $c->prepare("test1", "SELECT 'test' || \$1");
|
||
|
|
||
|
$r = $s->exec(array("ing"));
|
||
|
$r->fetchCol($d);
|
||
|
var_dump($d);
|
||
|
|
||
|
$s->deallocate();
|
||
|
|
||
|
try {
|
||
|
$s->exec(array("ing"));
|
||
|
} catch (pq\Exception\BadMethodCallException $e) {
|
||
|
echo "Caught exception\n";
|
||
|
}
|
||
|
|
||
|
$s->prepare();
|
||
|
|
||
|
$r = $s->exec(array("ing"));
|
||
|
$r->fetchCol($d);
|
||
|
var_dump($d);
|
||
|
|
||
|
?>
|
||
|
DONE
|
||
|
--EXPECT--
|
||
|
Test
|
||
|
string(7) "testing"
|
||
|
Caught exception
|
||
|
string(7) "testing"
|
||
|
DONE
|