Annotation of embedaddon/php/ext/pgsql/tests/28large_object_import_oid.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: PostgreSQL import large object with given oid
! 3: --SKIPIF--
! 4: <?php
! 5: include("skipif.inc");
! 6: $v = pg_version($conn);
! 7: if (version_compare("8.4devel", $v["client"]) > 0) die("skip - requires pg client >= 8.4\n");
! 8: if (version_compare("8.4devel", $v["server"]) > 0) die("skip - requires pg server >= 8.4\n");
! 9: ?>
! 10: --FILE--
! 11: <?php
! 12:
! 13: include('config.inc');
! 14:
! 15: $db = pg_connect($conn_str);
! 16:
! 17: echo "import LO from int\n";
! 18: pg_exec($db, 'begin');
! 19: $oid = pg_lo_import($db, __FILE__, 21003);
! 20: if (!$oid) echo ("pg_lo_import() error\n");
! 21: if ($oid != 21003) echo ("pg_lo_import() wrong id\n");
! 22: pg_lo_unlink ($db, $oid);
! 23: pg_exec($db, 'commit');
! 24:
! 25: echo "import LO from string\n";
! 26: pg_exec($db, 'begin');
! 27: $oid = pg_lo_import($db, __FILE__, "21004");
! 28: if (!$oid) echo ("pg_lo_import() error\n");
! 29: if ($oid != 21004) echo ("pg_lo_import() wrong id\n");
! 30: pg_lo_unlink ($db, $oid);
! 31: pg_exec($db, 'commit');
! 32:
! 33: echo "import LO using default connection\n";
! 34: pg_exec('begin');
! 35: $oid = pg_lo_import($db, __FILE__, 21005);
! 36: if (!$oid) echo ("pg_lo_import() error\n");
! 37: if ($oid != 21005) echo ("pg_lo_import() wrong id\n");
! 38: pg_lo_unlink ($oid);
! 39: pg_exec('commit');
! 40:
! 41:
! 42: echo "OK";
! 43: ?>
! 44: --EXPECT--
! 45: import LO from int
! 46: import LO from string
! 47: import LO using default connection
! 48: OK
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>