summaryrefslogtreecommitdiff
path: root/ext/pgsql/tests/bug72197.phpt
blob: 2ce15bdaf4b726835de704ab65ec2261470c3e1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--TEST--
Bug #72197 pg_lo_create arbitrary read 
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
<?php
/* This shouldn't crash. */
$var1=-32768;
$var2="12";
pg_lo_create($var1, $var2);

/* This should work correctly. */
include('config.inc');

/* Check with explicit link. */
$conn = pg_connect($conn_str);
pg_query($conn, "BEGIN");
$oid = pg_lo_create($conn);
var_dump($oid);

/* Check with default link */
$oid = pg_lo_create();
var_dump($oid);

/* don't commit */
pg_query($conn, "ROLLBACK");
pg_close($conn);
?>
==DONE==
--EXPECTF--
Warning: pg_lo_create(): supplied resource is not a valid PostgreSQL link resource in %sbug72197.php on line %d%w
int(%d)
int(%d)
==DONE==