diff options
| author | Georg Richter <georg@php.net> | 2004-07-23 12:47:36 +0000 |
|---|---|---|
| committer | Georg Richter <georg@php.net> | 2004-07-23 12:47:36 +0000 |
| commit | 8c6ab178e48b74760c1b22ebdafd3c0fe7bda43a (patch) | |
| tree | 0c6aa5f3145127f9d14014c4fbd66283d57835fd | |
| parent | 5ff2111a5970829de6a47183ad44aef8197345d6 (diff) | |
| download | php-git-8c6ab178e48b74760c1b22ebdafd3c0fe7bda43a.tar.gz | |
fixed bug #29311
added support for Cursors (MySQL 5.0.x)
| -rw-r--r-- | NEWS | 4 | ||||
| -rw-r--r-- | ext/mysqli/mysqli.c | 10 | ||||
| -rw-r--r-- | ext/mysqli/mysqli_fe.c | 1 | ||||
| -rw-r--r-- | ext/mysqli/tests/bug29311.phpt | 44 |
4 files changed, 57 insertions, 2 deletions
@@ -1,10 +1,11 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2004, PHP 5.1.0 -- Fixed bug #28985 (__getTypes() returning nothing on complex WSDL). (Dmitry) +- Fixed bug #29311 (calling parent constructor in mysqli). (Georg) - Fixed bug #29236 (memory error when wsdl-cache is enabled). (Dmitry) - Fixed bug #29109 (SoapFault exception: [WSDL] Out of memory). (Dmitry) - Fixed bug #29061 (soap extension segfaults). (Dmitry) +- Fixed bug #28985 (__getTypes() returning nothing on complex WSDL). (Dmitry) - Added new functions : . array_diff_key() (Andrey) . array_diff_ukey() (Andrey) @@ -13,6 +14,7 @@ PHP NEWS . stream_context_get_default() (Wez) . stream_socket_enable_crypto() (Wez) - PHP will now respect extension dependencies when initializing. (Wez) +- Added Cursor support for MySQL 5.0.x in mysqli (Georg) - Added MDTM support to ftp_url_stat. (Sara) - Added zlib stream filter suport. (Sara) - Added bz2 stream filter support. (Sara) diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index 684e622ae8..b02effb7f9 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -273,7 +273,7 @@ static union _zend_function *php_mysqli_constructor_get(zval *object TSRMLS_DC) { mysqli_object *obj = (mysqli_object *)zend_objects_get_address(object TSRMLS_CC); - if (obj->zo.ce != mysqli_link_class_entry && obj->zo.ce->constructor) { + if (obj->zo.ce != mysqli_link_class_entry) { return obj->zo.ce->constructor; } else { static zend_internal_function f; @@ -443,6 +443,14 @@ PHP_MINIT_FUNCTION(mysqli) /* for mysqli_stmt_set_attr */ REGISTER_LONG_CONSTANT("MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH", STMT_ATTR_UPDATE_MAX_LENGTH, CONST_CS | CONST_PERSISTENT); + +#ifdef STMT_ATTR_CURSOR_TYPE + REGISTER_LONG_CONSTANT("MYSQLI_STMT_ATTR_CURSOR_TYPE", STMT_ATTR_CURSOR_TYPE, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("MYSQLI_CURSOR_TYPE_NO_CURSOR", CURSOR_TYPE_NO_CURSOR, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("MYSQLI_CURSOR_TYPE_READ_ONLY", CURSOR_TYPE_READ_ONLY, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("MYSQLI_CURSOR_TYPE_FOR_UPDATE", CURSOR_TYPE_FOR_UPDATE, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("MYSQLI_CURSOR_TYPE_SCROLLABLE", CURSOR_TYPE_SCROLLABLE, CONST_CS | CONST_PERSISTENT); +#endif /* column information */ REGISTER_LONG_CONSTANT("MYSQLI_NOT_NULL_FLAG", NOT_NULL_FLAG, CONST_CS | CONST_PERSISTENT); diff --git a/ext/mysqli/mysqli_fe.c b/ext/mysqli/mysqli_fe.c index 2510e86432..35c43e6c4e 100644 --- a/ext/mysqli/mysqli_fe.c +++ b/ext/mysqli/mysqli_fe.c @@ -202,6 +202,7 @@ function_entry mysqli_link_methods[] = { PHP_FALIAS(set_local_infile_handler,mysqli_set_local_infile_handler,NULL) PHP_FALIAS(master_query,mysqli_master_query,NULL) PHP_FALIAS(multi_query,mysqli_multi_query,NULL) + PHP_FALIAS(mysqli,mysqli_connect,NULL) PHP_FALIAS(more_results,mysqli_more_results, NULL) PHP_FALIAS(next_result, mysqli_next_result, NULL) PHP_FALIAS(options,mysqli_options,NULL) diff --git a/ext/mysqli/tests/bug29311.phpt b/ext/mysqli/tests/bug29311.phpt new file mode 100644 index 0000000000..82845e16d6 --- /dev/null +++ b/ext/mysqli/tests/bug29311.phpt @@ -0,0 +1,44 @@ +--TEST-- +constructor test +--FILE-- +<?php + include "connect.inc"; + + /* class 1 calls parent constructor */ + class mysql1 extends mysqli { + function __construct() { + parent::__construct("localhost", "root", "", "test"); + } + } + + /* class 2 has an own constructor */ + class mysql2 extends mysqli { + + function __construct() { + $this->connect("localhost", "root", "", "test"); + } + } + + /* class 3 has no constructor */ + class mysql3 extends mysqli { + + } + + $foo[0] = new mysql1(); + $foo[1] = new mysql2(); + $foo[2] = new mysql3("localhost", "root", "", "test"); + + + for ($i=0; $i < 3; $i++) { + if (($result = $foo[$i]->query("SELECT DATABASE()"))) { + $row = $result->fetch_row(); + printf("%d: %s\n", $i, $row[0]); + $result->close(); + } + $foo[$i]->close(); + } +?> +--EXPECTF-- +0: test +1: test +2: test |
