<file role="test" name="exceptions002.phpt" />
<file role="test" name="fetch001.phpt" />
<file role="test" name="info001.phpt" />
+ <file role="test" name="info002.phpt" />
<file role="test" name="lob001.phpt" />
<file role="test" name="lob002.phpt" />
<file role="test" name="lob003.phpt" />
<file role="test" name="map001.phpt" />
<file role="test" name="notify001.phpt" />
<file role="test" name="persistent001.phpt" />
+ <file role="test" name="res001.phpt" />
<file role="test" name="reset001.phpt" />
<file role="test" name="savepoint001.phpt" />
<file role="test" name="stm_desc001.phpt" />
if (*zparam != *((zval **) p)) {
zval_ptr_dtor(zparam);
}
+ efree(tmp);
break;
}
}
$c->setConverter(new IntVectorConverter($t));
$c->setConverter(new JSONConverter($t));
-$r = $c->execParams("SELECT \$1 as hs, \$2 as iv, \$3 as oids, \$4 as js",
+$r = $c->execParams("SELECT \$1 as hs, \$2 as iv, \$3 as oids, \$4 as js, \$5 as ia, \$6 as ta, \$7 as ba, \$8 as da",
array(
// hstore
array(
"c" => 3,
),
"str" => "äüö"
- )
+ ),
+ // arrays
+ array(array(array(1,2,3))),
+ array(array("a\"","b}",null)),
+ array(true,false),
+ array(1.1,2.2)
),
array(
$t["hstore"]->oid,
$t["int2vector"]->oid,
$t["oidvector"]->oid,
- $t["json"]->oid
+ $t["json"]->oid,
+ $t["_int4"]->oid,
+ $t["_text"]->oid,
+ $t["_bool"]->oid,
+ $t["_float8"]->oid
)
);
Test
array(1) {
[0]=>
- array(4) {
+ array(%d) {
[0]=>
array(3) {
["k1"]=>
["str"]=>
string(6) "äüö"
}
+ [4]=>
+ array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(3) {
+ [0]=>
+ int(1)
+ [1]=>
+ int(2)
+ [2]=>
+ int(3)
+ }
+ }
+ }
+ [5]=>
+ array(1) {
+ [0]=>
+ array(3) {
+ [0]=>
+ string(2) "a""
+ [1]=>
+ string(2) "b}"
+ [2]=>
+ NULL
+ }
+ }
+ [6]=>
+ array(2) {
+ [0]=>
+ bool(true)
+ [1]=>
+ bool(false)
+ }
+ [7]=>
+ array(2) {
+ [0]=>
+ float(1.1)
+ [1]=>
+ float(2.2)
+ }
}
}
Done
--- /dev/null
+--TEST--
+ext info
+--SKIPIF--
+<?php
+include "_skipif.inc";
+?>
+--FILE--
+<?php
+echo "Test\n";
+$e = new ReflectionExtension("pq");
+$e->info();
+?>
+Done
+--EXPECTF--
+Test
+
+pq
+
+PQ Support => enabled
+Extension Version => %s
+
+Used Library => Version
+libpq => %s
+Done
$t = $c->startTransaction();
$lob = $t->createLOB();
+
+var_dump($lob->transaction === $t);
+
$lob->write(file_get_contents(__FILE__));
var_dump($lob->tell());
DONE
--EXPECTF--
Test
-int(451)
+bool(true)
+int(489)
bool(true)
string(5) "%c?php"
DONE
--- /dev/null
+--TEST--
+empty result
+--SKIPIF--
+<?php
+include "_skipif.inc";
+?>
+--FILE--
+<?php
+echo "Test\n";
+
+include "_setup.inc";
+
+class r extends pq\Result {
+ public $dummy = 2;
+}
+
+var_dump(new pq\Result, get_object_vars(new r));
+?>
+Done
+--EXPECTF--
+Test
+
+Warning: pq\Result not initialized in %s on line %d
+
+Warning: pq\Result not initialized in %s on line %d
+
+Warning: pq\Result not initialized in %s on line %d
+
+Warning: pq\Result not initialized in %s on line %d
+
+Warning: pq\Result not initialized in %s on line %d
+
+Warning: pq\Result not initialized in %s on line %d
+
+Warning: pq\Result not initialized in %s on line %d
+
+Warning: pq\Result not initialized in %s on line %d
+
+Warning: pq\Result not initialized in %s on line %d
+
+Warning: pq\Result not initialized in %s on line %d
+
+Warning: pq\Result not initialized in %s on line %d
+
+Warning: pq\Result not initialized in %s on line %d
+
+Warning: pq\Result not initialized in %s on line %d
+
+Warning: pq\Result not initialized in %s on line %d
+
+Warning: pq\Result not initialized in %s on line %d
+object(pq\Result)#%d (7) {
+ ["status"]=>
+ NULL
+ ["statusMessage"]=>
+ NULL
+ ["errorMessage"]=>
+ NULL
+ ["numRows"]=>
+ int(0)
+ ["numCols"]=>
+ int(0)
+ ["affectedRows"]=>
+ int(0)
+ ["fetchType"]=>
+ int(0)
+}
+array(8) {
+ ["dummy"]=>
+ int(2)
+ ["status"]=>
+ NULL
+ ["statusMessage"]=>
+ NULL
+ ["errorMessage"]=>
+ NULL
+ ["numRows"]=>
+ int(0)
+ ["numCols"]=>
+ int(0)
+ ["affectedRows"]=>
+ int(0)
+ ["fetchType"]=>
+ int(0)
+}
+Done