Files
Ilija Tovilo d3f361c3b7 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Add NEWS entries
  Fix GHSA-vc5h-9ppw-p5f3: phar circular symlink crash
  Fix SQL injection in ext-pgsql via E'...' backslash breakout
  libgd patch for CVE-2026-9672
2026-07-28 11:50:34 +02:00

35 lines
652 B
PHP

--TEST--
Bug #64609 (pg_convert enum type support)
--EXTENSIONS--
pgsql
--SKIPIF--
<?php
include("inc/skipif.inc");
skip_server_version('8.3', '<');
?>
--FILE--
<?php
error_reporting(E_ALL);
include 'inc/config.inc';
$table_name = 'table_bug64609';
$type_name = 'type_bug64609';
$db = pg_connect($conn_str);
pg_query($db, "BEGIN");
pg_query($db, "CREATE TYPE {$type_name} AS ENUM ('ok', 'ko')");
pg_query($db, "CREATE TABLE {$table_name} (a {$type_name})");
$fields = array('a' => 'ok');
$converted = pg_convert($db, $table_name, $fields);
pg_query($db, "ROLLBACK");
var_dump($converted);
?>
--EXPECT--
array(1) {
[""a""]=>
string(4) "'ok'"
}