johannes Wed Jan 7 16:32:09 2009 UTC Modified files: (Branch: PHP_5_3) /php-src NEWS /php-src/ext/mysqli mysqli.c /php-src/ext/mysqli/tests 066.phpt bug34810.phpt mysqli_class_mysqli_result_interface.phpt mysqli_class_mysqli_stmt_interface.phpt mysqli_mysqli_result_invalid_mode.phpt Log: MFH: Proper ctor usage (Fix #46044)
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.436&r2=1.2027.2.547.2.965.2.437&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.965.2.436 php-src/NEWS:1.2027.2.547.2.965.2.437 --- php-src/NEWS:1.2027.2.547.2.965.2.436 Tue Jan 6 01:31:33 2009 +++ php-src/NEWS Wed Jan 7 16:32:07 2009 @@ -40,6 +40,7 @@ Closure and SplFileInfo using exceptions). (Etienne) - Fixed bug #46268 (DateTime::modify() does not reset relative time values). (Derick) +- Fixed bug #46044 (Mysqli - wrong error message). (Johannes) - Fixed bug #45991 (Ini files with the UTF-8 BOM are treated as invalid). (Scott) - Fixed bug #45989 (json_decode() doesn't return NULL on certain invalid http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli.c?r1=1.72.2.16.2.17.2.35&r2=1.72.2.16.2.17.2.36&diff_format=u Index: php-src/ext/mysqli/mysqli.c diff -u php-src/ext/mysqli/mysqli.c:1.72.2.16.2.17.2.35 php-src/ext/mysqli/mysqli.c:1.72.2.16.2.17.2.36 --- php-src/ext/mysqli/mysqli.c:1.72.2.16.2.17.2.35 Wed Dec 31 11:15:39 2008 +++ php-src/ext/mysqli/mysqli.c Wed Jan 7 16:32:08 2009 @@ -17,7 +17,7 @@ | Ulf Wendel <u...@php.net> | +----------------------------------------------------------------------+ - $Id: mysqli.c,v 1.72.2.16.2.17.2.35 2008/12/31 11:15:39 sebastian Exp $ + $Id: mysqli.c,v 1.72.2.16.2.17.2.36 2009/01/07 16:32:08 johannes Exp $ */ #ifdef HAVE_CONFIG_H @@ -433,41 +433,6 @@ } /* }}} */ -static union _zend_function *php_mysqli_constructor_get(zval *object TSRMLS_DC) -{ - zend_class_entry * ce = Z_OBJCE_P(object); - - if (ce != mysqli_link_class_entry && ce != mysqli_stmt_class_entry && - ce != mysqli_result_class_entry && ce != mysqli_driver_class_entry && - ce != mysqli_warning_class_entry) { - return zend_std_get_constructor(object TSRMLS_CC); - } else { - static zend_internal_function f; - mysqli_object *obj = (mysqli_object *)zend_objects_get_address(object TSRMLS_CC); - - f.function_name = obj->zo.ce->name; - f.scope = obj->zo.ce; - f.arg_info = NULL; - f.num_args = 0; - f.fn_flags = 0; - - f.type = ZEND_INTERNAL_FUNCTION; - if (obj->zo.ce == mysqli_link_class_entry) { - f.handler = ZEND_FN(mysqli_link_construct); - } else if (obj->zo.ce == mysqli_stmt_class_entry) { - f.handler = ZEND_FN(mysqli_stmt_construct); - } else if (obj->zo.ce == mysqli_result_class_entry) { - f.handler = ZEND_FN(mysqli_result_construct); - } else if (obj->zo.ce == mysqli_driver_class_entry) { - f.handler = ZEND_FN(mysqli_driver_construct); - } else if (obj->zo.ce == mysqli_warning_class_entry) { - f.handler = ZEND_MN(mysqli_warning___construct); - } - - return (union _zend_function*)&f; - } -} - static int mysqli_object_has_property(zval *object, zval *member, int has_set_exists TSRMLS_DC) /* {{{ */ { mysqli_object *obj = (mysqli_object *)zend_objects_get_address(object TSRMLS_CC); @@ -707,7 +672,6 @@ mysqli_object_handlers.read_property = mysqli_read_property; mysqli_object_handlers.write_property = mysqli_write_property; mysqli_object_handlers.get_property_ptr_ptr = std_hnd->get_property_ptr_ptr; - mysqli_object_handlers.get_constructor = php_mysqli_constructor_get; mysqli_object_handlers.has_property = mysqli_object_has_property; #if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3 mysqli_object_handlers.get_debug_info = mysqli_object_get_debug_info; http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/066.phpt?r1=1.1.6.1&r2=1.1.6.2&diff_format=u Index: php-src/ext/mysqli/tests/066.phpt diff -u php-src/ext/mysqli/tests/066.phpt:1.1.6.1 php-src/ext/mysqli/tests/066.phpt:1.1.6.2 --- php-src/ext/mysqli/tests/066.phpt:1.1.6.1 Wed Oct 10 10:10:14 2007 +++ php-src/ext/mysqli/tests/066.phpt Wed Jan 7 16:32:08 2009 @@ -19,7 +19,7 @@ $mysql->query("INSERT INTO test_warnings VALUES (1),(2),(NULL)"); - if (($warning = new mysqli_warning($mysql))) { + if (($warning = $mysql->get_warnings())) { do { printf("Warning\n"); } while ($warning->next()); @@ -30,4 +30,4 @@ ?> --EXPECT-- Warning -done! \ No newline at end of file +done! http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/bug34810.phpt?r1=1.1.2.3.2.1.2.4&r2=1.1.2.3.2.1.2.5&diff_format=u Index: php-src/ext/mysqli/tests/bug34810.phpt diff -u php-src/ext/mysqli/tests/bug34810.phpt:1.1.2.3.2.1.2.4 php-src/ext/mysqli/tests/bug34810.phpt:1.1.2.3.2.1.2.5 --- php-src/ext/mysqli/tests/bug34810.phpt:1.1.2.3.2.1.2.4 Mon Oct 27 14:34:35 2008 +++ php-src/ext/mysqli/tests/bug34810.phpt Wed Jan 7 16:32:08 2009 @@ -24,7 +24,7 @@ $mysql->query("CREATE TABLE test_warnings (a int not null)"); $mysql->query("SET sql_mode=''"); $mysql->query("INSERT INTO test_warnings VALUES (1),(2),(NULL)"); - var_dump(new mysqli_warning($mysql)); + var_dump($mysql->get_warnings()); } } http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt?r1=1.2.2.3&r2=1.2.2.4&diff_format=u Index: php-src/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt diff -u php-src/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt:1.2.2.3 php-src/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt:1.2.2.4 --- php-src/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt:1.2.2.3 Tue Mar 18 16:57:31 2008 +++ php-src/ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt Wed Jan 7 16:32:08 2009 @@ -187,9 +187,9 @@ Constructor: -Warning: mysqli_result::mysqli_result() expects parameter 2 to be long, string given in %s on line %d +Warning: mysqli_result::__construct() expects parameter 2 to be long, string given in %s on line %d -Warning: mysqli_result::mysqli_result() expects parameter 1 to be mysqli, string given in %s on line %d +Warning: mysqli_result::__construct() expects parameter 1 to be mysqli, string given in %s on line %d done! --UEXPECTF-- Parent class: @@ -224,7 +224,7 @@ Constructor: -Warning: mysqli_result::mysqli_result() expects parameter 2 to be long, Unicode string given in %s on line %d +Warning: mysqli_result::__construct() expects parameter 2 to be long, Unicode string given in %s on line %d -Warning: mysqli_result::mysqli_result() expects parameter 1 to be mysqli, Unicode string given in %s on line %d +Warning: mysqli_result::__construct() expects parameter 1 to be mysqli, Unicode string given in %s on line %d done! http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt?r1=1.2.2.4&r2=1.2.2.5&diff_format=u Index: php-src/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt diff -u php-src/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt:1.2.2.4 php-src/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt:1.2.2.5 --- php-src/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt:1.2.2.4 Thu Apr 24 14:22:19 2008 +++ php-src/ext/mysqli/tests/mysqli_class_mysqli_stmt_interface.phpt Wed Jan 7 16:32:08 2009 @@ -187,7 +187,7 @@ Prepare using the constructor: -Warning: mysqli_stmt::mysqli_stmt() expects parameter 2 to be string, object given in %s on line %d +Warning: mysqli_stmt::__construct() expects parameter 2 to be string, object given in %s on line %d done! --UEXPECTF-- Parent class: @@ -243,5 +243,5 @@ Prepare using the constructor: -Warning: mysqli_stmt::mysqli_stmt() expects parameter 2 to be binary string, object given in %s on line %d +Warning: mysqli_stmt::__construct() expects parameter 2 to be binary string, object given in %s on line %d done! http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/mysqli_mysqli_result_invalid_mode.phpt?r1=1.2.2.2&r2=1.2.2.3&diff_format=u Index: php-src/ext/mysqli/tests/mysqli_mysqli_result_invalid_mode.phpt diff -u php-src/ext/mysqli/tests/mysqli_mysqli_result_invalid_mode.phpt:1.2.2.2 php-src/ext/mysqli/tests/mysqli_mysqli_result_invalid_mode.phpt:1.2.2.3 --- php-src/ext/mysqli/tests/mysqli_mysqli_result_invalid_mode.phpt:1.2.2.2 Wed Oct 10 10:17:38 2007 +++ php-src/ext/mysqli/tests/mysqli_mysqli_result_invalid_mode.phpt Wed Jan 7 16:32:08 2009 @@ -22,5 +22,5 @@ print "done!"; ?> --EXPECTF-- -Warning: mysqli_result::mysqli_result(): Invalid value for resultmode in %s on line %d +Warning: mysqli_result::__construct(): Invalid value for resultmode in %s on line %d done!
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php