summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2005-05-26 18:36:18 +0000
committerMarcus Boerger <helly@php.net>2005-05-26 18:36:18 +0000
commit9b3929a7e9d07ca63e702a6ea0ad1ac6f9f8a36e (patch)
treedd15c8574f52e67e03115ea6f7934ef0c071e44a
parentd2018ef2c035fc61dc0b5c0e13cd823f4fd3a6dd (diff)
downloadphp-git-9b3929a7e9d07ca63e702a6ea0ad1ac6f9f8a36e.tar.gz
- Need to make PDO::__construct() final to prevent SEGV it isn't called 1st
-rwxr-xr-xext/pdo/pdo_dbh.c1
-rwxr-xr-xext/pdo/tests/pdo_023_def.inc6
-rwxr-xr-xext/pdo/tests/pdo_026.inc6
-rwxr-xr-xext/pdo_mysql/tests/pdo_023.phpt1
-rwxr-xr-xext/pdo_mysql/tests/pdo_026.phpt1
-rwxr-xr-xext/pdo_pgsql/tests/pdo_023.phpt1
-rwxr-xr-xext/pdo_pgsql/tests/pdo_026.phpt1
-rwxr-xr-xext/pdo_sqlite/tests/pdo_023.phpt1
-rwxr-xr-xext/pdo_sqlite/tests/pdo_026.phpt1
-rwxr-xr-xext/sqlite/tests/pdo/pdo_023.phpt1
-rwxr-xr-xext/sqlite/tests/pdo/pdo_026.phpt1
11 files changed, 1 insertions, 20 deletions
diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c
index 29b0a716cd..20579a1000 100755
--- a/ext/pdo/pdo_dbh.c
+++ b/ext/pdo/pdo_dbh.c
@@ -1075,6 +1075,7 @@ void pdo_dbh_init(TSRMLS_D)
INIT_CLASS_ENTRY(ce, "PDO", pdo_dbh_functions);
pdo_dbh_ce = zend_register_internal_class(&ce TSRMLS_CC);
pdo_dbh_ce->create_object = pdo_dbh_new;
+ pdo_dbh_ce->constructor->common.fn_flags |= ZEND_ACC_FINAL;
memcpy(&pdo_dbh_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
pdo_dbh_object_handlers.get_method = dbh_method_get;
diff --git a/ext/pdo/tests/pdo_023_def.inc b/ext/pdo/tests/pdo_023_def.inc
index 62a5d21313..1fb1980995 100755
--- a/ext/pdo/tests/pdo_023_def.inc
+++ b/ext/pdo/tests/pdo_023_def.inc
@@ -21,12 +21,6 @@ class PDODatabaseX extends PDO
{
public $test1 = 1;
- function __construct($connect)
- {
- echo __METHOD__ . "()\n";
- parent::__construct($connect);
- }
-
function __destruct()
{
echo __METHOD__ . "()\n";
diff --git a/ext/pdo/tests/pdo_026.inc b/ext/pdo/tests/pdo_026.inc
index c5f2ce565b..b94ea17c3a 100755
--- a/ext/pdo/tests/pdo_026.inc
+++ b/ext/pdo/tests/pdo_026.inc
@@ -30,12 +30,6 @@ class PDOStatementX extends PDOStatement
class PDODatabase extends PDO
{
- function __construct($connect)
- {
- echo __METHOD__ . "()\n";
- parent::__construct($connect);
- }
-
function __destruct()
{
echo __METHOD__ . "()\n";
diff --git a/ext/pdo_mysql/tests/pdo_023.phpt b/ext/pdo_mysql/tests/pdo_023.phpt
index 50db082a3b..ba43758a3e 100755
--- a/ext/pdo_mysql/tests/pdo_023.phpt
+++ b/ext/pdo_mysql/tests/pdo_023.phpt
@@ -22,7 +22,6 @@ require_once($PDO_TESTS . 'pdo_023.inc');
===DONE===
<?php exit(0); ?>
--EXPECTF--
-PDODatabaseX::__construct()
int(1)
int(2)
object(PDODatabaseX)#%d (2) {
diff --git a/ext/pdo_mysql/tests/pdo_026.phpt b/ext/pdo_mysql/tests/pdo_026.phpt
index e55b4578f9..7e061d8671 100755
--- a/ext/pdo_mysql/tests/pdo_026.phpt
+++ b/ext/pdo_mysql/tests/pdo_026.phpt
@@ -15,7 +15,6 @@ require_once($PDO_TESTS . 'pdo_026.inc');
===DONE===
<?php exit(0); ?>
--EXPECT--
-PDODatabase::__construct()
string(11) "PDODatabase"
string(12) "PDOStatement"
PDODatabase::query()
diff --git a/ext/pdo_pgsql/tests/pdo_023.phpt b/ext/pdo_pgsql/tests/pdo_023.phpt
index df6d8ed988..5aa86aa41a 100755
--- a/ext/pdo_pgsql/tests/pdo_023.phpt
+++ b/ext/pdo_pgsql/tests/pdo_023.phpt
@@ -22,7 +22,6 @@ require_once($PDO_TESTS . 'pdo_023.inc');
===DONE===
<?php exit(0); ?>
--EXPECTF--
-PDODatabaseX::__construct()
int(1)
int(2)
object(PDODatabaseX)#%d (2) {
diff --git a/ext/pdo_pgsql/tests/pdo_026.phpt b/ext/pdo_pgsql/tests/pdo_026.phpt
index 68aa14cf7d..12ac290c52 100755
--- a/ext/pdo_pgsql/tests/pdo_026.phpt
+++ b/ext/pdo_pgsql/tests/pdo_026.phpt
@@ -15,7 +15,6 @@ require_once($PDO_TESTS . 'pdo_026.inc');
===DONE===
<?php exit(0); ?>
--EXPECT--
-PDODatabase::__construct()
string(11) "PDODatabase"
string(12) "PDOStatement"
PDODatabase::query()
diff --git a/ext/pdo_sqlite/tests/pdo_023.phpt b/ext/pdo_sqlite/tests/pdo_023.phpt
index 2db35289cf..6baffe8065 100755
--- a/ext/pdo_sqlite/tests/pdo_023.phpt
+++ b/ext/pdo_sqlite/tests/pdo_023.phpt
@@ -22,7 +22,6 @@ require_once($PDO_TESTS . 'pdo_023.inc');
===DONE===
<?php exit(0); ?>
--EXPECTF--
-PDODatabaseX::__construct()
int(1)
int(2)
object(PDODatabaseX)#%d (2) {
diff --git a/ext/pdo_sqlite/tests/pdo_026.phpt b/ext/pdo_sqlite/tests/pdo_026.phpt
index 066648f453..cfeb0c26af 100755
--- a/ext/pdo_sqlite/tests/pdo_026.phpt
+++ b/ext/pdo_sqlite/tests/pdo_026.phpt
@@ -15,7 +15,6 @@ require_once($PDO_TESTS . 'pdo_026.inc');
===DONE===
<?php exit(0); ?>
--EXPECT--
-PDODatabase::__construct()
string(11) "PDODatabase"
string(12) "PDOStatement"
PDODatabase::query()
diff --git a/ext/sqlite/tests/pdo/pdo_023.phpt b/ext/sqlite/tests/pdo/pdo_023.phpt
index 1bdc853e8f..a987c6bd03 100755
--- a/ext/sqlite/tests/pdo/pdo_023.phpt
+++ b/ext/sqlite/tests/pdo/pdo_023.phpt
@@ -22,7 +22,6 @@ require_once($PDO_TESTS . 'pdo_023.inc');
===DONE===
<?php exit(0); ?>
--EXPECTF--
-PDODatabaseX::__construct()
int(1)
int(2)
object(PDODatabaseX)#%d (2) {
diff --git a/ext/sqlite/tests/pdo/pdo_026.phpt b/ext/sqlite/tests/pdo/pdo_026.phpt
index d9bc504c57..28d21bab2a 100755
--- a/ext/sqlite/tests/pdo/pdo_026.phpt
+++ b/ext/sqlite/tests/pdo/pdo_026.phpt
@@ -15,7 +15,6 @@ require_once($PDO_TESTS . 'pdo_026.inc');
===DONE===
<?php exit(0); ?>
--EXPECT--
-PDODatabase::__construct()
string(11) "PDODatabase"
string(12) "PDOStatement"
PDODatabase::query()