From 1cc536af5a9790288ef6638e3b167858d3b0cca1 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 9 May 2016 17:15:40 +0200 Subject: Revert "Backport patch for bug #71820" This reverts commit 1b632cfe834bfd87d182566d7d960df7d10ded72. This fixed bug #72151, and reverts the fix for bug #71820. See also bug #50636 and #49521 for the history. --- ext/pgsql/tests/bug71820.phpt | 93 ------------------------------------------- 1 file changed, 93 deletions(-) delete mode 100644 ext/pgsql/tests/bug71820.phpt (limited to 'ext/pgsql/tests') diff --git a/ext/pgsql/tests/bug71820.phpt b/ext/pgsql/tests/bug71820.phpt deleted file mode 100644 index 4d99e3468e..0000000000 --- a/ext/pgsql/tests/bug71820.phpt +++ /dev/null @@ -1,93 +0,0 @@ ---TEST-- -Bug #71820 pg_fetch_object bind parameters before call constructor ---SKIPIF-- - ---FILE-- -set_from_constructor = $set_from_constructor; - } - - public function __set($name, $value) - { - if (!isset($this->data[$name])) { - /* $this->set_from_constructor has an expected value */ - $this->data[$name] = 42 == $this->set_from_constructor ? $value : -1; - return; - } - throw new \Exception('Duplicity column name.'); - } - -} - -$connection = pg_connect($conn_str); - -if (!$connection) { - die('Connection faild.'); -} - -$table = << 'Doe', '$2' => 'Joe']); - -$result = pg_query('SELECT * FROM ' . $tableName . ' LIMIT 10;'); - -while ($row = pg_fetch_object($result, NULL, 'TestRow', [42])) { - var_dump($row); -} - -pg_query($connection, "DROP TABLE $tableName"); - -pg_close($connection); - -?> -==DONE== ---EXPECTF-- -object(TestRow)#%d (3) { - ["set_from_constructor":"TestRow":private]=> - int(42) - ["data":"TestRow":private]=> - array(2) { - ["id"]=> - string(1) "1" - ["name"]=> - string(3) "Doe" - } - ["hello":"TestRow":private]=> - int(42) -} -object(TestRow)#%d (3) { - ["set_from_constructor":"TestRow":private]=> - int(42) - ["data":"TestRow":private]=> - array(2) { - ["id"]=> - string(1) "2" - ["name"]=> - string(3) "Joe" - } - ["hello":"TestRow":private]=> - int(42) -} -==DONE== -- cgit v1.2.1 From fc2a45b70a6675cad627cfe6341dc77d61952ba4 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 9 May 2016 17:25:53 +0200 Subject: Revert "Fixed bug #71820 pg_fetch_object bind parameters before call constructor" This reverts commit b4eedd128ba9f61be08a50c94afd72837d7cf70b. This fixed bug #72151, and reverts the fix for bug #71820. See also bug #50636 and #49521 for the history. --- ext/pgsql/tests/bug71820.phpt | 93 ------------------------------------------- 1 file changed, 93 deletions(-) delete mode 100644 ext/pgsql/tests/bug71820.phpt (limited to 'ext/pgsql/tests') diff --git a/ext/pgsql/tests/bug71820.phpt b/ext/pgsql/tests/bug71820.phpt deleted file mode 100644 index 4d99e3468e..0000000000 --- a/ext/pgsql/tests/bug71820.phpt +++ /dev/null @@ -1,93 +0,0 @@ ---TEST-- -Bug #71820 pg_fetch_object bind parameters before call constructor ---SKIPIF-- - ---FILE-- -set_from_constructor = $set_from_constructor; - } - - public function __set($name, $value) - { - if (!isset($this->data[$name])) { - /* $this->set_from_constructor has an expected value */ - $this->data[$name] = 42 == $this->set_from_constructor ? $value : -1; - return; - } - throw new \Exception('Duplicity column name.'); - } - -} - -$connection = pg_connect($conn_str); - -if (!$connection) { - die('Connection faild.'); -} - -$table = << 'Doe', '$2' => 'Joe']); - -$result = pg_query('SELECT * FROM ' . $tableName . ' LIMIT 10;'); - -while ($row = pg_fetch_object($result, NULL, 'TestRow', [42])) { - var_dump($row); -} - -pg_query($connection, "DROP TABLE $tableName"); - -pg_close($connection); - -?> -==DONE== ---EXPECTF-- -object(TestRow)#%d (3) { - ["set_from_constructor":"TestRow":private]=> - int(42) - ["data":"TestRow":private]=> - array(2) { - ["id"]=> - string(1) "1" - ["name"]=> - string(3) "Doe" - } - ["hello":"TestRow":private]=> - int(42) -} -object(TestRow)#%d (3) { - ["set_from_constructor":"TestRow":private]=> - int(42) - ["data":"TestRow":private]=> - array(2) { - ["id"]=> - string(1) "2" - ["name"]=> - string(3) "Joe" - } - ["hello":"TestRow":private]=> - int(42) -} -==DONE== -- cgit v1.2.1