diff --git a/ext/pdo_pgsql/pdo_pgsql.c b/ext/pdo_pgsql/pdo_pgsql.c index 877b751a85044..49efa0b238484 100644 --- a/ext/pdo_pgsql/pdo_pgsql.c +++ b/ext/pdo_pgsql/pdo_pgsql.c @@ -184,9 +184,6 @@ PHP_MINIT_FUNCTION(pdo_pgsql) REGISTER_PDO_CLASS_CONST_LONG("PGSQL_TRANSACTION_INTRANS", (zend_long)PGSQL_TRANSACTION_INTRANS); REGISTER_PDO_CLASS_CONST_LONG("PGSQL_TRANSACTION_INERROR", (zend_long)PGSQL_TRANSACTION_INERROR); REGISTER_PDO_CLASS_CONST_LONG("PGSQL_TRANSACTION_UNKNOWN", (zend_long)PGSQL_TRANSACTION_UNKNOWN); -#ifdef HAVE_PG_RESULT_MEMORY_SIZE - REGISTER_PDO_CLASS_CONST_LONG("PGSQL_ATTR_RESULT_MEMORY_SIZE", (zend_long)PDO_PGSQL_ATTR_RESULT_MEMORY_SIZE); -#endif PdoPgsql_ce = register_class_Pdo_Pgsql(pdo_dbh_ce); PdoPgsql_ce->create_object = pdo_dbh_new; diff --git a/ext/pdo_pgsql/tests/result_memory_size.phpt b/ext/pdo_pgsql/tests/result_memory_size.phpt index ce73e4af32664..7b382ea63e8bd 100644 --- a/ext/pdo_pgsql/tests/result_memory_size.phpt +++ b/ext/pdo_pgsql/tests/result_memory_size.phpt @@ -1,5 +1,5 @@ --TEST-- -PDO PgSQL PDOStatement::getAttribute(PDO::PGSQL_ATTR_RESULT_MEMORY_SIZE) +PDO PgSQL PDOStatement::getAttribute(Pgsql::ATTR_RESULT_MEMORY_SIZE) --EXTENSIONS-- pdo_pgsql --SKIPIF-- @@ -7,7 +7,7 @@ pdo_pgsql require __DIR__ . '/config.inc'; require dirname(__DIR__, 2) . '/pdo/tests/pdo_test.inc'; PDOTest::skip(); -if (!defined('PDO::PGSQL_ATTR_RESULT_MEMORY_SIZE')) die('skip constant PDO::PGSQL_ATTR_RESULT_MEMORY_SIZE does not exist'); +if (!defined('Pgsql::ATTR_RESULT_MEMORY_SIZE')) die('skip constant Pgsql::ATTR_RESULT_MEMORY_SIZE does not exist'); --FILE-- query('select 1'); -$result_1 = $statement->getAttribute(PDO::PGSQL_ATTR_RESULT_MEMORY_SIZE); +$result_1 = $statement->getAttribute(Pgsql::ATTR_RESULT_MEMORY_SIZE); var_dump($result_1); echo 'Result set with many rows: '; $result = $db->query('select generate_series(1, 10000)'); -$result_2 = $result->getAttribute(PDO::PGSQL_ATTR_RESULT_MEMORY_SIZE); +$result_2 = $result->getAttribute(Pgsql::ATTR_RESULT_MEMORY_SIZE); var_dump($result_2); echo 'Large result sets should require more memory than small ones: '; @@ -31,7 +31,7 @@ var_dump($result_2 > $result_1); echo 'Statements that are not executed should not consume memory: '; $statement = $db->prepare('select 1'); -$result_3 = $statement->getAttribute(PDO::PGSQL_ATTR_RESULT_MEMORY_SIZE); +$result_3 = $statement->getAttribute(Pgsql::ATTR_RESULT_MEMORY_SIZE); var_dump($result_3); echo 'and should emit Error: ';