Skip to content

Commit a9ab01f

Browse files
committed
pgsql ext: pg_query_params/pg_send_query_params false constant handling proposal.
1 parent 2181129 commit a9ab01f

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
--TEST--
2+
PostgreSQL prepared queries with bool constants
3+
--SKIPIF--
4+
<?php
5+
include("skipif.inc");
6+
if (!function_exists('pg_prepare')) die('skip function pg_prepare() does not exist');
7+
?>
8+
--FILE--
9+
<?php
10+
11+
include('config.inc');
12+
13+
$db = pg_connect($conn_str);
14+
15+
$version = pg_version($db);
16+
if ($version['protocol'] >= 3) {
17+
$result = pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num >= $1;", array(true));
18+
// bug occurs with false as it turns out as empty.
19+
$result = pg_query_params($db, "SELECT * FROM ".$table_name." WHERE num <> $1;", array(false));
20+
pg_free_result($result);
21+
}
22+
pg_close($db);
23+
24+
echo "OK";
25+
?>
26+
--EXPECT--
27+
OK
28+

0 commit comments

Comments
 (0)