diff options
Diffstat (limited to 'ext/mysqli')
58 files changed, 275 insertions, 891 deletions
diff --git a/ext/mysqli/config.m4 b/ext/mysqli/config.m4 index 38a130f4cd..c78eb2bedc 100644 --- a/ext/mysqli/config.m4 +++ b/ext/mysqli/config.m4 @@ -1,5 +1,3 @@ -dnl config.m4 for extension mysqli - dnl ext/pdo_mysql/config.m4 also depends on this macro. AC_DEFUN([PHP_MYSQL_SOCKET_SEARCH], [ for i in \ @@ -27,21 +25,20 @@ AC_DEFUN([PHP_MYSQL_SOCKET_SEARCH], [ fi ]) -PHP_ARG_WITH(mysqli, for MySQLi support, -[ --with-mysqli[=FILE] Include MySQLi support. FILE is the path - to mysql_config. If no value or mysqlnd is passed - as FILE, the MySQL native driver will be used]) - -PHP_ARG_ENABLE(embedded_mysqli, whether to enable embedded MySQLi support, -[ --enable-embedded-mysqli - MYSQLi: Enable embedded support - Note: Does not work with MySQL native driver!], no, no) +PHP_ARG_WITH([mysqli], + [for MySQLi support], + [AS_HELP_STRING([[--with-mysqli[=FILE]]], + [Include MySQLi support. FILE is the path to mysql_config. If no value or + mysqlnd is passed as FILE, the MySQL native driver will be used])]) dnl ext/pdo_mysql/config.m4 also depends on this configure option. -PHP_ARG_WITH(mysql-sock, for specified location of the MySQL UNIX socket, -[ --with-mysql-sock[=SOCKPATH] - MySQLi/PDO_MYSQL: Location of the MySQL unix socket pointer. - If unspecified, the default locations are searched], no, no) +PHP_ARG_WITH([mysql-sock], + [for specified location of the MySQL UNIX socket], + [AS_HELP_STRING([[--with-mysql-sock[=SOCKPATH]]], + [MySQLi/PDO_MYSQL: Location of the MySQL unix socket pointer. If unspecified, + the default locations are searched])], + [no], + [no]) if test "$PHP_MYSQLI" = "yes" || test "$PHP_MYSQLI" = "mysqlnd"; then dnl This needs to be set in any extension which wishes to use mysqlnd @@ -52,12 +49,7 @@ elif test "$PHP_MYSQLI" != "no"; then MYSQL_CONFIG=$PHP_MYSQLI MYSQL_LIB_NAME='mysqlclient' - if test "$PHP_EMBEDDED_MYSQLI" = "yes"; then - AC_DEFINE(HAVE_EMBEDDED_MYSQLI, 1, [embedded MySQL support enabled]) - MYSQL_LIB_CFG='--libmysqld-libs' - dnl mysqlnd doesn't support embedded, so we have to add some extra stuff - mysqli_extra_sources="mysqli_embedded.c" - elif test "$enable_maintainer_zts" = "yes"; then + if test "$enable_maintainer_zts" = "yes"; then MYSQL_LIB_CFG='--libs_r' MYSQL_LIB_NAME='mysqlclient_r' else @@ -116,7 +108,7 @@ if test "$PHP_MYSQLI" != "no"; then mysqli_sources="mysqli.c mysqli_api.c mysqli_prop.c mysqli_nonapi.c \ mysqli_fe.c mysqli_report.c mysqli_driver.c mysqli_warning.c \ - mysqli_exception.c mysqli_result_iterator.c $mysqli_extra_sources" + mysqli_exception.c mysqli_result_iterator.c" PHP_NEW_EXTENSION(mysqli, $mysqli_sources, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) PHP_SUBST(MYSQLI_SHARED_LIBADD) PHP_INSTALL_HEADERS([ext/mysqli/php_mysqli_structs.h]) diff --git a/ext/mysqli/config.w32 b/ext/mysqli/config.w32 index 4d8630c27d..bd76923c0c 100644 --- a/ext/mysqli/config.w32 +++ b/ext/mysqli/config.w32 @@ -12,7 +12,6 @@ if (PHP_MYSQLI != "no") { "mysqli.c " + "mysqli_api.c " + "mysqli_driver.c " + - "mysqli_embedded.c " + "mysqli_exception.c " + "mysqli_fe.c " + "mysqli_nonapi.c " + diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index 73511b2639..612239527e 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -200,7 +200,9 @@ static void mysqli_objects_free_storage(zend_object *object) mysqli_object *intern = php_mysqli_fetch_object(object); MYSQLI_RESOURCE *my_res = (MYSQLI_RESOURCE *)intern->ptr; - my_efree(my_res); + if (my_res) { + efree(my_res); + } zend_object_std_dtor(&intern->zo); } /* }}} */ @@ -305,7 +307,11 @@ zval *mysqli_read_property(zval *object, zval *member, int type, void **cache_sl obj = Z_MYSQLI_P(object); if (Z_TYPE_P(member) != IS_STRING) { - ZVAL_STR(&tmp_member, zval_get_string_func(member)); + zend_string *str = zval_try_get_string_func(member); + if (UNEXPECTED(!str)) { + return &EG(uninitialized_zval); + } + ZVAL_STR(&tmp_member, str); member = &tmp_member; } @@ -331,14 +337,18 @@ zval *mysqli_read_property(zval *object, zval *member, int type, void **cache_sl /* }}} */ /* {{{ mysqli_write_property */ -void mysqli_write_property(zval *object, zval *member, zval *value, void **cache_slot) +zval *mysqli_write_property(zval *object, zval *member, zval *value, void **cache_slot) { zval tmp_member; mysqli_object *obj; mysqli_prop_handler *hnd = NULL; if (Z_TYPE_P(member) != IS_STRING) { - ZVAL_STR(&tmp_member, zval_get_string_func(member)); + zend_string *str = zval_try_get_string_func(member); + if (UNEXPECTED(!str)) { + return value; + } + ZVAL_STR(&tmp_member, str); member = &tmp_member; } @@ -351,12 +361,14 @@ void mysqli_write_property(zval *object, zval *member, zval *value, void **cache if (hnd) { hnd->write_func(obj, value); } else { - zend_std_write_property(object, member, value, cache_slot); + value = zend_std_write_property(object, member, value, cache_slot); } if (member == &tmp_member) { zval_ptr_dtor_str(&tmp_member); } + + return value; } /* }}} */ @@ -542,11 +554,7 @@ static PHP_GINIT_FUNCTION(mysqli) mysqli_globals->report_mode = 0; mysqli_globals->report_ht = 0; mysqli_globals->allow_local_infile = 0; -#ifdef HAVE_EMBEDDED_MYSQLI - mysqli_globals->embedded = 1; -#else mysqli_globals->embedded = 0; -#endif mysqli_globals->rollback_on_cached_plink = FALSE; } /* }}} */ @@ -626,7 +634,6 @@ PHP_MINIT_FUNCTION(mysqli) zend_declare_property_null(ce, "insert_id", sizeof("insert_id") - 1, ZEND_ACC_PUBLIC); zend_declare_property_null(ce, "server_info", sizeof("server_info") - 1, ZEND_ACC_PUBLIC); zend_declare_property_null(ce, "server_version", sizeof("server_version") - 1, ZEND_ACC_PUBLIC); - zend_declare_property_null(ce, "stat", sizeof("stat") - 1, ZEND_ACC_PUBLIC); zend_declare_property_null(ce, "sqlstate", sizeof("sqlstate") - 1, ZEND_ACC_PUBLIC); zend_declare_property_null(ce, "protocol_version", sizeof("protocol_version") - 1, ZEND_ACC_PUBLIC); zend_declare_property_null(ce, "thread_id", sizeof("thread_id") - 1, ZEND_ACC_PUBLIC); @@ -1265,7 +1272,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags ZVAL_COPY_VALUE(&dataset, return_value); - object_and_properties_init(return_value, ce, NULL); + object_init_ex(return_value, ce); if (!ce->default_properties_count && !ce->__set) { Z_OBJ_P(return_value)->properties = Z_ARR(dataset); } else { @@ -1311,12 +1318,3 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags } } /* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index c4ed1bf543..ffbb841c19 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -899,7 +899,10 @@ PHP_FUNCTION(mysqli_stmt_execute) if (!(stmt->param.is_null[i] = (Z_ISNULL_P(param)))) { switch (stmt->stmt->params[i].buffer_type) { case MYSQL_TYPE_VAR_STRING: - convert_to_string_ex(param); + if (!try_convert_to_string(param)) { + return; + } + stmt->stmt->params[i].buffer = Z_STRVAL_P(param); stmt->stmt->params[i].buffer_length = Z_STRLEN_P(param); break; @@ -967,17 +970,11 @@ void mysqli_stmt_fetch_libmysql(INTERNAL_FUNCTION_PARAMETERS) zval *result; /* it must be a reference, isn't it? */ if (Z_ISREF(stmt->result.vars[i])) { - result = Z_REFVAL(stmt->result.vars[i]); - } else { result = &stmt->result.vars[i]; + } else { + continue; // but be safe ... } - /* - QQ: Isn't it quite better to call zval_dtor(). What if the user has - assigned a resource, or an array to the bound variable? We are going - to leak probably. zval_dtor() will handle also Unicode/Non-unicode mode. - */ /* Even if the string is of length zero there is one byte alloced so efree() in all cases */ - zval_ptr_dtor(result); if (!stmt->result.is_null[i]) { switch (stmt->result.buf[i].type) { case IS_LONG: @@ -998,16 +995,16 @@ void mysqli_stmt_fetch_libmysql(INTERNAL_FUNCTION_PARAMETERS) } while (--j > 0); tmp[10]= '\0'; /* unsigned int > INT_MAX is 10 digits - ALWAYS */ - ZVAL_STRINGL(result, tmp, 10); + ZEND_TRY_ASSIGN_REF_STRINGL(result, tmp, 10); efree(tmp); break; } #endif } if (stmt->stmt->fields[i].flags & UNSIGNED_FLAG) { - ZVAL_LONG(result, *(unsigned int *)stmt->result.buf[i].val); + ZEND_TRY_ASSIGN_REF_LONG(result, *(unsigned int *)stmt->result.buf[i].val); } else { - ZVAL_LONG(result, *(int *)stmt->result.buf[i].val); + ZEND_TRY_ASSIGN_REF_LONG(result, *(int *)stmt->result.buf[i].val); } break; case IS_DOUBLE: @@ -1024,7 +1021,7 @@ void mysqli_stmt_fetch_libmysql(INTERNAL_FUNCTION_PARAMETERS) dval = *((double *)stmt->result.buf[i].val); } - ZVAL_DOUBLE(result, dval); + ZEND_TRY_ASSIGN_REF_DOUBLE(result, dval); break; } case IS_STRING: @@ -1065,20 +1062,20 @@ void mysqli_stmt_fetch_libmysql(INTERNAL_FUNCTION_PARAMETERS) * use MYSQLI_LL_SPEC. */ snprintf(tmp, sizeof(tmp), (stmt->stmt->fields[i].flags & UNSIGNED_FLAG)? MYSQLI_LLU_SPEC : MYSQLI_LL_SPEC, llval); - ZVAL_STRING(result, tmp); + ZEND_TRY_ASSIGN_REF_STRING(result, tmp); } else { - ZVAL_LONG(result, llval); + ZEND_TRY_ASSIGN_REF_LONG(result, llval); } } else { #if defined(MYSQL_DATA_TRUNCATED) && MYSQL_VERSION_ID > 50002 if (ret == MYSQL_DATA_TRUNCATED && *(stmt->stmt->bind[i].error) != 0) { /* result was truncated */ - ZVAL_STRINGL(result, stmt->result.buf[i].val, stmt->stmt->bind[i].buffer_length); + ZEND_TRY_ASSIGN_REF_STRINGL(result, stmt->result.buf[i].val, stmt->stmt->bind[i].buffer_length); } else { #else { #endif - ZVAL_STRINGL(result, stmt->result.buf[i].val, stmt->result.buf[i].output_len); + ZEND_TRY_ASSIGN_REF_STRINGL(result, stmt->result.buf[i].val, stmt->result.buf[i].output_len); } } break; @@ -1086,7 +1083,7 @@ void mysqli_stmt_fetch_libmysql(INTERNAL_FUNCTION_PARAMETERS) break; } } else { - ZVAL_NULL(result); + ZEND_TRY_ASSIGN_REF_NULL(result); } } } else { @@ -1608,18 +1605,12 @@ PHP_FUNCTION(mysqli_next_result) { } MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID); - if (!mysql_more_results(mysql->mysql)) { - php_error_docref(NULL, E_STRICT, "There is no next result set. " - "Please, call mysqli_more_results()/mysqli::more_results() to check " - "whether to call this function/method"); - } - RETURN_BOOL(!mysql_next_result(mysql->mysql)); } /* }}} */ #if defined(HAVE_STMT_NEXT_RESULT) && defined(MYSQLI_USE_MYSQLND) -/* {{{ proto bool mysqli_stmt_next_result(object link) +/* {{{ proto bool mysqli_stmt_more_results(object link) check if there any more query results from a multi query */ PHP_FUNCTION(mysqli_stmt_more_results) { @@ -1646,12 +1637,6 @@ PHP_FUNCTION(mysqli_stmt_next_result) { } MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); - if (!mysqlnd_stmt_more_results(stmt->stmt)) { - php_error_docref(NULL, E_STRICT, "There is no next result set. " - "Please, call mysqli_stmt_more_results()/mysqli_stmt::more_results() to check " - "whether to call this function/method"); - } - RETURN_BOOL(!mysql_stmt_next_result(stmt->stmt)); } /* }}} */ @@ -1787,7 +1772,9 @@ PHP_FUNCTION(mysqli_options) if (expected_type != Z_TYPE_P(mysql_value)) { switch (expected_type) { case IS_STRING: - convert_to_string_ex(mysql_value); + if (!try_convert_to_string(mysql_value)) { + return; + } break; case IS_LONG: convert_to_long_ex(mysql_value); @@ -2682,12 +2669,3 @@ PHP_FUNCTION(mysqli_warning_count) RETURN_LONG(mysql_warning_count(mysql->mysql)); } /* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/mysqli_driver.c b/ext/mysqli/mysqli_driver.c index 019e902391..7df2eca11b 100644 --- a/ext/mysqli/mysqli_driver.c +++ b/ext/mysqli/mysqli_driver.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -84,11 +84,7 @@ static int driver_report_write(mysqli_object *obj, zval *value) /* {{{ property driver_embedded_read */ static zval *driver_embedded_read(mysqli_object *obj, zval *retval) { -#ifdef HAVE_EMBEDDED_MYSQLI - ZVAL_TRUE(retval); -#else ZVAL_FALSE(retval); -#endif return retval; } /* }}} */ @@ -146,20 +142,6 @@ const mysqli_property_entry mysqli_driver_property_entries[] = { /* {{{ mysqli_driver_methods[] */ const zend_function_entry mysqli_driver_methods[] = { -#if defined(HAVE_EMBEDDED_MYSQLI) - PHP_FALIAS(embedded_server_start, mysqli_embedded_server_start, NULL) - PHP_FALIAS(embedded_server_end, mysqli_embedded_server_end, NULL) -#endif PHP_FE_END }; /* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/mysqli_embedded.c b/ext/mysqli/mysqli_embedded.c deleted file mode 100644 index 3e201c2e85..0000000000 --- a/ext/mysqli/mysqli_embedded.c +++ /dev/null @@ -1,131 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | PHP Version 7 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Georg Richter <georg@php.net> | - +----------------------------------------------------------------------+ - -*/ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <signal.h> - -#include "php.h" -#include "php_ini.h" -#include "ext/standard/info.h" -#include "php_mysqli_structs.h" - -/* {{{ proto bool mysqli_embedded_server_start(bool start, array arguments, array groups) - initialize and start embedded server */ -PHP_FUNCTION(mysqli_embedded_server_start) -{ -#ifdef HAVE_EMBEDDED_MYSQLI - zend_long start; - zval *args; - zval *grps; - - int argc = 0; - char **arguments; - char **groups; - HashPosition pos; - int index, rc; - - if (zend_parse_parameters(ZEND_NUM_ARGS(), "laa", &start, &args, &grps) == FAILURE) { - return; - } - - if (!start) { - mysql_server_init(-1,NULL, NULL); - RETURN_TRUE; - } - /* get arguments */ - if ((argc = zend_hash_num_elements(Z_ARRVAL_P(args)))) { - arguments = safe_emalloc(sizeof(char *), argc + 1, 0); - arguments[0] = NULL; - - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(args), &pos); - - for (index = 0;; zend_hash_move_forward_ex(Z_ARRVAL_P(args), &pos)) { - zval **item; - - if (zend_hash_get_current_data_ex(Z_ARRVAL_P(args), (void **) &item, &pos) == FAILURE) { - break; - } - - convert_to_string_ex(item); - - arguments[++index] = Z_STRVAL_PP(item); - } - argc++; - } - - /* get groups */ - if ((zend_hash_num_elements(Z_ARRVAL_P(grps)))) { - groups = safe_emalloc(sizeof(char *), zend_hash_num_elements(Z_ARRVAL_P(grps)) + 1, 0); - groups[0] = NULL; - - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(grps), &pos); - - for (index = 0;; zend_hash_move_forward_ex(Z_ARRVAL_P(grps), &pos)) { - zval ** item; - - if (zend_hash_get_current_data_ex(Z_ARRVAL_P(grps), (void **) &item, &pos) == FAILURE) { - break; - } - - convert_to_string_ex(item); - - groups[++index] = Z_STRVAL_PP(item); - } - groups[index] = NULL; - } else { - groups = safe_emalloc(sizeof(char *), 1, 0); - groups[0] = NULL; - } - - rc = mysql_server_init(argc, arguments, groups); - - if (argc) { - efree(arguments); - } - efree(groups); - - if (rc) { - RETURN_FALSE; - } - RETURN_TRUE; -#endif -} -/* }}} */ - -/* {{{ proto void mysqli_embedded_server_end(void) -*/ -PHP_FUNCTION(mysqli_embedded_server_end) -{ -#ifdef HAVE_MYSQLI_EMBEDDED - mysql_server_end(); -#endif -} -/* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/mysqli_exception.c b/ext/mysqli/mysqli_exception.c index 4d1d39e814..6ac5261e07 100644 --- a/ext/mysqli/mysqli_exception.c +++ b/ext/mysqli/mysqli_exception.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -72,13 +72,3 @@ void php_mysqli_throw_sql_exception(char *sqlstate, int errorno, char *format, . zend_throw_exception_object(&sql_ex); } - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/mysqli_fe.c b/ext/mysqli/mysqli_fe.c index bc5f3ecc6f..f17f009830 100644 --- a/ext/mysqli/mysqli_fe.c +++ b/ext/mysqli/mysqli_fe.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -420,10 +420,6 @@ const zend_function_entry mysqli_functions[] = { PHP_FE(mysqli_data_seek, arginfo_mysqli_data_seek) PHP_FE(mysqli_dump_debug_info, arginfo_mysqli_only_link) PHP_FE(mysqli_debug, arginfo_mysqli_debug) -#if defined(HAVE_EMBEDDED_MYSQLI) - PHP_FE(mysqli_embedded_server_end, NULL) - PHP_FE(mysqli_embedded_server_start, NULL) -#endif PHP_FE(mysqli_errno, arginfo_mysqli_only_link) PHP_FE(mysqli_error, arginfo_mysqli_only_link) PHP_FE(mysqli_error_list, arginfo_mysqli_only_link) @@ -658,12 +654,3 @@ const zend_function_entry mysqli_stmt_methods[] = { PHP_FE_END }; /* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/mysqli_fe.h b/ext/mysqli/mysqli_fe.h index 9dc038355f..c6e8293d1a 100644 --- a/ext/mysqli/mysqli_fe.h +++ b/ext/mysqli/mysqli_fe.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -101,8 +101,6 @@ PHP_FUNCTION(mysqli_stmt_prepare); PHP_FUNCTION(mysqli_stmt_fetch); PHP_FUNCTION(mysqli_stmt_param_count); PHP_FUNCTION(mysqli_stmt_send_long_data); -PHP_FUNCTION(mysqli_embedded_server_end); -PHP_FUNCTION(mysqli_embedded_server_start); PHP_FUNCTION(mysqli_sqlstate); PHP_FUNCTION(mysqli_ssl_set); PHP_FUNCTION(mysqli_stat); diff --git a/ext/mysqli/mysqli_libmysql.h b/ext/mysqli/mysqli_libmysql.h index a4ba66e15b..391fca9ff5 100644 --- a/ext/mysqli/mysqli_libmysql.h +++ b/ext/mysqli/mysqli_libmysql.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/mysqli/mysqli_mysqlnd.h b/ext/mysqli/mysqli_mysqlnd.h index 3c2dd30260..4c6872cf1a 100644 --- a/ext/mysqli/mysqli_mysqlnd.h +++ b/ext/mysqli/mysqli_mysqlnd.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index 7b6c07d2e3..2f272935b3 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -58,6 +58,7 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne size_t hostname_len = 0, username_len = 0, passwd_len = 0, dbname_len = 0, socket_len = 0; zend_bool persistent = FALSE; zend_long port = 0, flags = 0; + zend_bool port_is_null = 1; zend_string *hash_key = NULL; zend_bool new_connection = FALSE; zend_resource *le; @@ -80,8 +81,8 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne hostname = username = dbname = passwd = socket = NULL; if (!is_real_connect) { - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ssssls", &hostname, &hostname_len, &username, &username_len, - &passwd, &passwd_len, &dbname, &dbname_len, &port, &socket, &socket_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!s!s!s!l!s!", &hostname, &hostname_len, &username, &username_len, + &passwd, &passwd_len, &dbname, &dbname_len, &port, &port_is_null, &socket, &socket_len) == FAILURE) { return; } @@ -98,9 +99,8 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne flags |= CLIENT_MULTI_RESULTS; /* needed for mysql_multi_query() */ } else { /* We have flags too */ - if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|sssslsl", &object, mysqli_link_class_entry, - &hostname, &hostname_len, &username, &username_len, &passwd, &passwd_len, &dbname, &dbname_len, &port, &socket, &socket_len, - &flags) == FAILURE) { + if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|s!s!s!s!l!s!l", &object, mysqli_link_class_entry, + &hostname, &hostname_len, &username, &username_len, &passwd, &passwd_len, &dbname, &dbname_len, &port, &port_is_null, &socket, &socket_len, &flags) == FAILURE) { return; } @@ -121,7 +121,7 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne if (!socket_len || !socket) { socket = MyG(default_socket); } - if (!port){ + if (port_is_null || !port) { port = MyG(default_port); } if (!passwd) { @@ -155,13 +155,19 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne mysql->hash_key = hash_key; - /* check if we can reuse exisiting connection ... */ + /* check if we can reuse existing connection ... */ if ((le = zend_hash_find_ptr(&EG(persistent_list), hash_key)) != NULL) { if (le->type == php_le_pmysqli()) { plist = (mysqli_plist_entry *) le->ptr; do { if (zend_ptr_stack_num_elements(&plist->free_links)) { + /* If we have an initialized (but unconnected) mysql resource, + * close it before we reuse an existing persistent resource. */ + if (mysql->mysql) { + mysqli_close(mysql->mysql, MYSQLI_CLOSE_IMPLICIT); + } + mysql->mysql = zend_ptr_stack_pop(&plist->free_links); MyG(num_inactive_persistent)--; @@ -219,15 +225,6 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne new_connection = TRUE; } -#ifdef HAVE_EMBEDDED_MYSQLI - if (hostname_len) { - unsigned int external=1; - mysql_options(mysql->mysql, MYSQL_OPT_USE_REMOTE_CONNECTION, (char *)&external); - } else { - mysql_options(mysql->mysql, MYSQL_OPT_USE_EMBEDDED_CONNECTION, 0); - } -#endif - #if !defined(MYSQLI_USE_MYSQLND) /* BC for prior to bug fix #53425 */ flags |= CLIENT_MULTI_RESULTS; @@ -431,7 +428,7 @@ PHP_FUNCTION(mysqli_error_list) add_next_index_zval(return_value, &single_error); } } else { - ZVAL_EMPTY_ARRAY(return_value); + RETURN_EMPTY_ARRAY(); } #else if (mysql_errno(mysql->mysql)) { @@ -443,7 +440,7 @@ PHP_FUNCTION(mysqli_error_list) add_assoc_string_ex(&single_error, "error", sizeof("error") - 1, mysql_error(mysql->mysql)); add_next_index_zval(return_value, &single_error); } else { - ZVAL_EMPTY_ARRAY(return_value); + RETURN_EMPTY_ARRAY(); } #endif } @@ -477,7 +474,7 @@ PHP_FUNCTION(mysqli_stmt_error_list) add_next_index_zval(return_value, &single_error); } } else { - ZVAL_EMPTY_ARRAY(return_value); + RETURN_EMPTY_ARRAY(); } #else if (mysql_stmt_errno(stmt->stmt)) { @@ -489,7 +486,7 @@ PHP_FUNCTION(mysqli_stmt_error_list) add_assoc_string_ex(&single_error, "error", sizeof("error") - 1, mysql_stmt_error(stmt->stmt)); add_next_index_zval(return_value, &single_error); } else { - ZVAL_EMPTY_ARRAY(return_value); + RETURN_EMPTY_ARRAY(); } #endif } @@ -1206,13 +1203,3 @@ PHP_FUNCTION(mysqli_get_links_stats) add_assoc_long_ex(return_value, "cached_plinks", sizeof("cached_plinks") - 1, MyG(num_inactive_persistent)); } /* }}} */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/mysqli_priv.h b/ext/mysqli/mysqli_priv.h index de2e75c6ad..6448c7ce60 100644 --- a/ext/mysqli/mysqli_priv.h +++ b/ext/mysqli/mysqli_priv.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/mysqli/mysqli_prop.c b/ext/mysqli/mysqli_prop.c index 160ec551e0..eab1a0676c 100644 --- a/ext/mysqli/mysqli_prop.c +++ b/ext/mysqli/mysqli_prop.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -234,38 +234,6 @@ MYSQLI_MAP_PROPERTY_FUNC_STRING(link_sqlstate_read, mysql_sqlstate, MYSQLI_GET_M MYSQLI_MAP_PROPERTY_FUNC_LONG(link_thread_id_read, mysql_thread_id, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), zend_ulong, ZEND_ULONG_FMT) MYSQLI_MAP_PROPERTY_FUNC_LONG(link_warning_count_read, mysql_warning_count, MYSQLI_GET_MYSQL(MYSQLI_STATUS_VALID), zend_ulong, ZEND_ULONG_FMT) -/* {{{ property link_stat_read */ -static zval *link_stat_read(mysqli_object *obj, zval *retval) -{ - MY_MYSQL *mysql; - - ZVAL_NULL(retval); - -#if defined(MYSQLI_USE_MYSQLND) - CHECK_STATUS(MYSQLI_STATUS_INITIALIZED); -#else - CHECK_STATUS(MYSQLI_STATUS_VALID); -#endif - - mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj->ptr))->ptr; - - if (mysql) { -#if defined(MYSQLI_USE_MYSQLND) - zend_string * stat_msg; - if (mysqlnd_stat(mysql->mysql, &stat_msg) == PASS) { - ZVAL_STR(retval, stat_msg); - } -#else - char * stat_msg; - if ((stat_msg = (char *)mysql_stat(mysql->mysql))) { - ZVAL_STRING(retval, stat_msg); - } -#endif - } - return retval; -} -/* }}} */ - /* result properties */ /* {{{ property result_type_read */ @@ -435,7 +403,6 @@ const mysqli_property_entry mysqli_link_property_entries[] = { {"insert_id", sizeof("insert_id") - 1, link_insert_id_read, NULL}, {"server_info", sizeof("server_info") - 1, link_server_info_read, NULL}, {"server_version", sizeof("server_version") - 1, link_server_version_read, NULL}, - {"stat", sizeof("stat") - 1, link_stat_read, NULL}, {"sqlstate", sizeof("sqlstate") - 1, link_sqlstate_read, NULL}, {"protocol_version",sizeof("protocol_version") - 1, link_protocol_version_read, NULL}, {"thread_id", sizeof("thread_id") - 1, link_thread_id_read, NULL}, @@ -466,12 +433,3 @@ const mysqli_property_entry mysqli_stmt_property_entries[] = { {"id", sizeof("id") - 1, stmt_id_read, NULL}, {NULL, 0, NULL, NULL} }; - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/mysqli_report.c b/ext/mysqli/mysqli_report.c index 3b842aea4c..330e5a6f70 100644 --- a/ext/mysqli/mysqli_report.c +++ b/ext/mysqli/mysqli_report.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -65,12 +65,3 @@ void php_mysqli_report_index(const char *query, unsigned int status) { php_mysqli_throw_sql_exception("00000", 0, "%s used in query/prepared statement %s", index, query); } /* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/mysqli_result_iterator.c b/ext/mysqli/mysqli_result_iterator.c index 9b42094345..caf19c34d1 100644 --- a/ext/mysqli/mysqli_result_iterator.c +++ b/ext/mysqli/mysqli_result_iterator.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -52,7 +52,8 @@ zend_object_iterator *php_mysqli_result_get_iterator(zend_class_entry *ce, zval iterator = ecalloc(1, sizeof(php_mysqli_result_iterator)); zend_iterator_init(&iterator->intern); - ZVAL_COPY(&iterator->intern.data, object); + Z_ADDREF_P(object); + ZVAL_OBJ(&iterator->intern.data, Z_OBJ_P(object)); iterator->intern.funcs = &php_mysqli_result_iterator_funcs; iterator->result = Z_MYSQLI_P(object); iterator->row_num = -1; @@ -154,12 +155,3 @@ const zend_object_iterator_funcs php_mysqli_result_iterator_funcs = { NULL }; /* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/mysqli_warning.c b/ext/mysqli/mysqli_warning.c index 0170dec4bb..248d9a281f 100644 --- a/ext/mysqli/mysqli_warning.c +++ b/ext/mysqli/mysqli_warning.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -323,13 +323,3 @@ const mysqli_property_entry mysqli_warning_property_entries[] = { {NULL, 0, NULL, NULL} }; /* }}} */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/php_mysqli.h b/ext/mysqli/php_mysqli.h index abe66cbd46..64a979d3fd 100644 --- a/ext/mysqli/php_mysqli.h +++ b/ext/mysqli/php_mysqli.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -28,13 +28,3 @@ extern zend_module_entry mysqli_module_entry; #define PHP_MYSQLI_VERSION PHP_VERSION #endif /* PHP_MYSQLI.H */ - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/php_mysqli_structs.h b/ext/mysqli/php_mysqli_structs.h index 1b7ffddb1a..93fbc15e91 100644 --- a/ext/mysqli/php_mysqli_structs.h +++ b/ext/mysqli/php_mysqli_structs.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2018 The PHP Group | + | Copyright (c) The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -54,10 +54,6 @@ #define WE_HAD_MBSTATE_T #endif -#if defined(ulong) && !defined(HAVE_ULONG) -#define HAVE_ULONG -#endif - #include <my_global.h> #if !defined(HAVE_MBRLEN) && defined(WE_HAD_MBRLEN) @@ -342,20 +338,6 @@ ZEND_END_MODULE_GLOBALS(mysqli) ZEND_TSRMLS_CACHE_EXTERN() #endif -#define my_estrdup(x) (x) ? estrdup(x) : NULL -#define my_efree(x) if (x) efree(x) - ZEND_EXTERN_MODULE_GLOBALS(mysqli) #endif /* PHP_MYSQLI_STRUCTS.H */ - - -/* - * Local variables: - * tab-width: 4 - * c-basic-offset: 4 - * indent-tabs-mode: t - * End: - * vim600: noet sw=4 ts=4 fdm=marker - * vim<600: noet sw=4 ts=4 - */ diff --git a/ext/mysqli/tests/045.phpt b/ext/mysqli/tests/045.phpt index 5eff0b03bc..0b7b68239c 100644 --- a/ext/mysqli/tests/045.phpt +++ b/ext/mysqli/tests/045.phpt @@ -7,7 +7,7 @@ mysqli_stmt_bind_result (SHOW) require_once('skipifconnectfailure.inc'); require_once("connect.inc"); - $link = my_mysqli_connect($host, $user, $passwd); + $link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket); $stmt = mysqli_prepare($link, "SHOW VARIABLES LIKE 'port'"); mysqli_stmt_execute($stmt); diff --git a/ext/mysqli/tests/061.phpt b/ext/mysqli/tests/061.phpt index 1f68a1fe6e..0da9c1c09d 100644 --- a/ext/mysqli/tests/061.phpt +++ b/ext/mysqli/tests/061.phpt @@ -32,7 +32,7 @@ mysqli.allow_local_infile=1 $link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket); /* create temporary file */ - $filename = dirname(__FILE__) . "061.csv"; + $filename = __DIR__ . "061.csv"; $fp = fopen($filename, "w"); fwrite($fp, "foo;bar"); fclose($fp); diff --git a/ext/mysqli/tests/CONFLICTS b/ext/mysqli/tests/CONFLICTS new file mode 100644 index 0000000000..0eaebf1275 --- /dev/null +++ b/ext/mysqli/tests/CONFLICTS @@ -0,0 +1 @@ +mysql diff --git a/ext/mysqli/tests/bug31668.phpt b/ext/mysqli/tests/bug31668.phpt index 9b769a1bae..40bf357b6a 100644 --- a/ext/mysqli/tests/bug31668.phpt +++ b/ext/mysqli/tests/bug31668.phpt @@ -5,8 +5,6 @@ Bug #31668 (multi_query works exactly every other time (multi_query was global, require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); ?> ---INI-- -error_reporting = E_ALL & ~E_STRICT --FILE-- <?php require_once("connect.inc"); diff --git a/ext/mysqli/tests/bug34810.phpt b/ext/mysqli/tests/bug34810.phpt index 7c36d806bc..d9afc246eb 100644 --- a/ext/mysqli/tests/bug34810.phpt +++ b/ext/mysqli/tests/bug34810.phpt @@ -92,8 +92,6 @@ object(mysqli)#%d (%d) { string(%d) "%s" ["server_version"]=> int(%d) - ["stat"]=> - string(%d) "Uptime: %d Threads: %d Questions: %d Slow queries: %d Opens: %d Flush tables: %d Open tables: %d Queries per second avg: %d.%d" ["sqlstate"]=> string(5) "00000" ["protocol_version"]=> @@ -132,8 +130,6 @@ object(mysqli)#%d (%d) { bool(false) ["server_version"]=> bool(false) - ["stat"]=> - NULL ["sqlstate"]=> bool(false) ["protocol_version"]=> diff --git a/ext/mysqli/tests/bug55859.phpt b/ext/mysqli/tests/bug55859.phpt deleted file mode 100644 index 04467bce24..0000000000 --- a/ext/mysqli/tests/bug55859.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Bug #55859 mysqli->stat property access gives error ---SKIPIF-- -<?php -require_once('skipif.inc'); -require_once('skipifconnectfailure.inc'); -?> ---FILE-- -<?php - require_once("connect.inc"); - - if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { - printf("[001] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); - } - var_dump(soundex(mysqli_stat($link)) === soundex($link->stat)); - echo "done!"; -?> ---EXPECT-- -bool(true) -done! diff --git a/ext/mysqli/tests/bug76386.phpt b/ext/mysqli/tests/bug76386.phpt index 4182c651b7..2f5ded1de4 100644 --- a/ext/mysqli/tests/bug76386.phpt +++ b/ext/mysqli/tests/bug76386.phpt @@ -78,7 +78,7 @@ if ($stmt) { } $link->close(); ?> ---EXPECTF-- +--EXPECT-- string(19) "2018-01-01 11:22:33" string(22) "2018-02-02 11:22:33.77" string(22) "2018-01-01 03:04:05.06" diff --git a/ext/mysqli/tests/cacert.pem b/ext/mysqli/tests/cacert.pem deleted file mode 100644 index a0ba67444e..0000000000 --- a/ext/mysqli/tests/cacert.pem +++ /dev/null @@ -1,79 +0,0 @@ -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 16263805969935345171 (0xe1b4a55c3ddfa613) - Signature Algorithm: sha256WithRSAEncryption - Issuer: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=CA - Validity - Not Before: Dec 5 04:48:11 2014 GMT - Not After : Dec 1 04:48:11 2030 GMT - Subject: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=CA - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - Public-Key: (2048 bit) - Modulus: - 00:b4:95:bd:24:92:73:06:22:01:13:28:0e:09:a3: - 94:05:96:54:9d:dc:8f:83:39:f3:64:7a:31:70:f6: - d9:c4:14:19:75:87:a6:b1:ea:52:ed:40:54:5a:f6: - 9c:13:8e:d8:76:8f:5a:65:a5:20:19:19:bd:51:9d: - ba:35:ce:9a:a9:58:0a:fc:11:6e:1d:cb:a8:f1:92: - 79:ee:aa:fc:e3:32:5e:aa:0d:0b:23:34:95:e9:d3: - 8e:3f:72:93:90:bc:2c:b0:04:75:4f:a4:4a:a0:32: - db:ac:89:ac:34:9b:d0:07:e3:81:e9:ca:5b:26:f0: - f5:de:fe:d5:5e:a0:54:26:dd:ec:58:07:6e:b9:e5: - 97:f6:20:6d:d8:4a:c0:50:cc:81:e6:d2:3f:c7:47: - 70:8b:15:89:65:71:2e:47:c3:42:76:b5:ee:16:0e: - 26:97:6a:a3:1c:ad:90:53:50:b0:b1:6d:1d:b0:b8: - 6d:df:3c:ee:bd:3b:87:e8:db:4d:3a:72:78:dd:db: - 40:3d:c9:20:46:b8:4e:33:bb:76:b7:4f:b2:79:da: - 03:cc:f9:75:c0:1d:4c:51:0a:b9:9b:25:34:50:11: - 97:df:82:46:02:a9:bc:98:51:3e:c3:df:57:ad:b7: - 28:be:de:65:ce:2b:f3:2c:22:f5:af:31:28:1c:ef: - 10:09 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Subject Key Identifier: - 94:65:A1:A3:87:CF:BF:C1:74:BB:D8:84:97:B6:6B:EE:B2:90:73:B2 - X509v3 Authority Key Identifier: - keyid:94:65:A1:A3:87:CF:BF:C1:74:BB:D8:84:97:B6:6B:EE:B2:90:73:B2 - - X509v3 Basic Constraints: - CA:TRUE - Signature Algorithm: sha256WithRSAEncryption - 32:97:4c:af:bf:ca:e0:10:66:b7:cc:8b:0d:05:d1:d2:ca:b8: - 0c:c2:78:57:1f:f6:55:9c:74:fc:bd:31:58:05:18:bc:6d:b5: - 79:9a:22:8c:1f:da:33:ea:ef:db:e3:cb:46:bc:36:91:8b:d8: - 36:8d:06:40:c2:e9:fe:79:1b:4a:c5:70:74:6d:9d:92:2c:90: - be:3c:a7:88:03:e4:b7:ef:f4:b0:00:34:ec:8f:d1:c3:23:2b: - ef:bc:ff:ab:a2:0e:bc:ba:11:a5:8e:44:80:fa:d6:f4:26:66: - 84:64:2c:e3:23:62:0c:e2:ba:01:ab:5f:24:d6:9d:7e:9c:7b: - f4:5d:0e:ba:64:35:6e:a5:fa:98:0c:57:f3:72:e8:3e:2e:ce: - b3:f9:e3:fa:ee:aa:79:f9:06:01:19:b2:b3:28:ff:f4:d6:bb: - 17:bb:a6:a0:e0:45:23:f3:61:40:31:5c:a3:ee:88:1c:00:31: - 54:96:f9:71:37:b5:7f:66:6a:af:04:94:09:39:99:b3:88:86: - 9e:bb:d6:36:24:24:f4:37:2c:a6:6c:0b:35:2e:bb:40:af:a7: - 64:8a:7f:f2:74:e3:94:0c:32:bd:31:3d:d9:79:68:0f:1e:4b: - 17:c0:4e:df:85:3c:f0:84:df:58:f1:d2:4d:2f:ad:ff:1b:d7: - c8:9b:fe:dc ------BEGIN CERTIFICATE----- -MIIDmTCCAoGgAwIBAgIJAOG0pVw936YTMA0GCSqGSIb3DQEBCwUAMGMxCzAJBgNV -BAYTAlNFMRIwEAYDVQQIDAlTdG9ja2hvbG0xEjAQBgNVBAcMCVN0b2NraG9sbTEP -MA0GA1UECgwGT3JhY2xlMQ4wDAYDVQQLDAVNeVNRTDELMAkGA1UEAwwCQ0EwHhcN -MTQxMjA1MDQ0ODExWhcNMzAxMjAxMDQ0ODExWjBjMQswCQYDVQQGEwJTRTESMBAG -A1UECAwJU3RvY2tob2xtMRIwEAYDVQQHDAlTdG9ja2hvbG0xDzANBgNVBAoMBk9y -YWNsZTEOMAwGA1UECwwFTXlTUUwxCzAJBgNVBAMMAkNBMIIBIjANBgkqhkiG9w0B -AQEFAAOCAQ8AMIIBCgKCAQEAtJW9JJJzBiIBEygOCaOUBZZUndyPgznzZHoxcPbZ -xBQZdYemsepS7UBUWvacE47Ydo9aZaUgGRm9UZ26Nc6aqVgK/BFuHcuo8ZJ57qr8 -4zJeqg0LIzSV6dOOP3KTkLwssAR1T6RKoDLbrImsNJvQB+OB6cpbJvD13v7VXqBU -Jt3sWAduueWX9iBt2ErAUMyB5tI/x0dwixWJZXEuR8NCdrXuFg4ml2qjHK2QU1Cw -sW0dsLht3zzuvTuH6NtNOnJ43dtAPckgRrhOM7t2t0+yedoDzPl1wB1MUQq5myU0 -UBGX34JGAqm8mFE+w99Xrbcovt5lzivzLCL1rzEoHO8QCQIDAQABo1AwTjAdBgNV -HQ4EFgQUlGWho4fPv8F0u9iEl7Zr7rKQc7IwHwYDVR0jBBgwFoAUlGWho4fPv8F0 -u9iEl7Zr7rKQc7IwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAMpdM -r7/K4BBmt8yLDQXR0sq4DMJ4Vx/2VZx0/L0xWAUYvG21eZoijB/aM+rv2+PLRrw2 -kYvYNo0GQMLp/nkbSsVwdG2dkiyQvjyniAPkt+/0sAA07I/RwyMr77z/q6IOvLoR -pY5EgPrW9CZmhGQs4yNiDOK6AatfJNadfpx79F0OumQ1bqX6mAxX83LoPi7Os/nj -+u6qefkGARmysyj/9Na7F7umoOBFI/NhQDFco+6IHAAxVJb5cTe1f2ZqrwSUCTmZ -s4iGnrvWNiQk9DcspmwLNS67QK+nZIp/8nTjlAwyvTE92XloDx5LF8BO34U88ITf -WPHSTS+t/xvXyJv+3A== ------END CERTIFICATE----- diff --git a/ext/mysqli/tests/client-cert.pem b/ext/mysqli/tests/client-cert.pem deleted file mode 100644 index f60a088417..0000000000 --- a/ext/mysqli/tests/client-cert.pem +++ /dev/null @@ -1,82 +0,0 @@ -Certificate: - Data: - Version: 3 (0x2) - Serial Number: 16263805969935345173 (0xe1b4a55c3ddfa615) - Signature Algorithm: sha256WithRSAEncryption - Issuer: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=CA - Validity - Not Before: Dec 5 04:49:23 2014 GMT - Not After : Dec 1 04:49:23 2029 GMT - Subject: C=SE, ST=Stockholm, L=Stockholm, O=Oracle, OU=MySQL, CN=Client - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - Public-Key: (2048 bit) - Modulus: - 00:c8:d1:a1:fe:a4:8c:f3:1b:17:71:1b:74:35:11: - e0:0e:6c:40:0a:fb:c0:f7:f0:eb:bb:c9:1d:a1:c7: - d7:b0:8a:f6:f1:cf:fa:6b:d0:79:64:eb:bb:69:a5: - 0d:80:06:df:52:14:d2:85:32:cf:bf:ce:2a:47:28: - 5b:cd:0b:28:ab:bb:07:33:d5:8b:d3:b4:72:c4:a6: - b5:cc:37:b9:03:a8:78:56:25:58:1f:17:30:7c:d1: - 0a:bb:ec:3c:a3:03:90:97:99:92:49:ae:b3:57:96: - 5c:1a:e9:e8:02:23:ae:c8:c9:05:50:63:e5:77:a1: - 9a:73:06:74:0e:46:50:28:d8:c9:4f:c4:1c:37:b8: - 52:18:0b:af:19:2b:d4:e5:66:74:a4:f3:f0:da:09: - 30:f7:bc:0c:c9:9b:ce:57:06:04:27:e5:a1:2f:2b: - a0:ba:b7:99:69:9d:46:fc:21:b6:45:81:9d:b2:3d: - 2f:76:15:78:b5:33:62:ac:1e:6b:66:dd:27:61:0a: - 47:02:20:2b:57:bb:32:20:dd:06:4c:76:a4:9b:72: - 42:4c:9c:2c:76:72:12:1f:4b:df:1e:11:1f:a9:06: - 54:dc:88:12:b0:49:d5:40:83:ef:7e:48:43:86:7a: - 37:a6:c1:d7:9b:fe:08:34:98:e0:54:3c:30:4f:79: - 15:29 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Basic Constraints: - CA:FALSE - Netscape Comment: - OpenSSL Generated Certificate - X509v3 Subject Key Identifier: - 26:0C:90:BC:97:12:9E:43:BB:5E:FE:EB:A9:66:B3:C3:EE:B2:18:CB - X509v3 Authority Key Identifier: - keyid:94:65:A1:A3:87:CF:BF:C1:74:BB:D8:84:97:B6:6B:EE:B2:90:73:B2 - - Signature Algorithm: sha256WithRSAEncryption - 3e:3c:1f:6c:5b:83:d1:71:15:f5:45:52:fc:7f:67:bc:af:c5: - 92:f5:74:78:13:43:3c:fe:b5:61:bf:00:47:43:45:a0:b9:dd: - a1:10:0c:29:69:2a:6f:7d:67:3d:1e:09:b5:15:74:bf:73:11: - e6:e9:09:b6:6b:b5:cc:1e:06:fd:bd:3a:11:d3:44:bd:ca:7a: - a1:f1:09:43:fc:bf:83:89:3a:b1:18:40:f3:cf:6d:12:ef:6e: - 0c:b7:a4:99:03:8a:4f:0c:3c:2c:23:78:35:2a:99:ea:de:9c: - 1b:e8:8d:19:fb:44:80:13:89:81:c5:05:4b:a7:66:6b:c0:31: - 41:f0:6c:60:aa:ec:d3:4c:ff:c1:3b:d5:bb:0d:42:7d:37:5e: - 80:e7:9c:7e:60:90:0f:a4:4e:70:20:9c:b1:e4:1b:70:65:b0: - ef:bb:41:16:ed:ad:46:ce:34:d3:02:3d:dd:e2:50:fa:3c:5d: - f0:e2:71:f8:9a:ef:a3:32:25:c5:8e:64:f4:46:e1:f4:c0:69: - d2:34:56:8d:d9:c2:6e:b6:55:3b:6a:4d:b6:d2:84:ab:85:7b: - cb:fd:b4:73:40:ba:5d:49:e2:0d:39:77:17:01:49:bb:72:8b: - 3a:c9:b1:e2:cd:13:d2:9c:ce:7d:6c:a8:f0:32:c9:a4:af:56: - 6f:8a:e6:88 ------BEGIN CERTIFICATE----- -MIIDyDCCArCgAwIBAgIJAOG0pVw936YVMA0GCSqGSIb3DQEBCwUAMGMxCzAJBgNV -BAYTAlNFMRIwEAYDVQQIDAlTdG9ja2hvbG0xEjAQBgNVBAcMCVN0b2NraG9sbTEP -MA0GA1UECgwGT3JhY2xlMQ4wDAYDVQQLDAVNeVNRTDELMAkGA1UEAwwCQ0EwHhcN -MTQxMjA1MDQ0OTIzWhcNMjkxMjAxMDQ0OTIzWjBnMQswCQYDVQQGEwJTRTESMBAG -A1UECAwJU3RvY2tob2xtMRIwEAYDVQQHDAlTdG9ja2hvbG0xDzANBgNVBAoMBk9y -YWNsZTEOMAwGA1UECwwFTXlTUUwxDzANBgNVBAMMBkNsaWVudDCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAMjRof6kjPMbF3EbdDUR4A5sQAr7wPfw67vJ -HaHH17CK9vHP+mvQeWTru2mlDYAG31IU0oUyz7/OKkcoW80LKKu7BzPVi9O0csSm -tcw3uQOoeFYlWB8XMHzRCrvsPKMDkJeZkkmus1eWXBrp6AIjrsjJBVBj5XehmnMG -dA5GUCjYyU/EHDe4UhgLrxkr1OVmdKTz8NoJMPe8DMmbzlcGBCfloS8roLq3mWmd -RvwhtkWBnbI9L3YVeLUzYqwea2bdJ2EKRwIgK1e7MiDdBkx2pJtyQkycLHZyEh9L -3x4RH6kGVNyIErBJ1UCD735IQ4Z6N6bB15v+CDSY4FQ8ME95FSkCAwEAAaN7MHkw -CQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2Vy -dGlmaWNhdGUwHQYDVR0OBBYEFCYMkLyXEp5Du17+66lms8PushjLMB8GA1UdIwQY -MBaAFJRloaOHz7/BdLvYhJe2a+6ykHOyMA0GCSqGSIb3DQEBCwUAA4IBAQA+PB9s -W4PRcRX1RVL8f2e8r8WS9XR4E0M8/rVhvwBHQ0Wgud2hEAwpaSpvfWc9Hgm1FXS/ -cxHm6Qm2a7XMHgb9vToR00S9ynqh8QlD/L+DiTqxGEDzz20S724Mt6SZA4pPDDws -I3g1Kpnq3pwb6I0Z+0SAE4mBxQVLp2ZrwDFB8GxgquzTTP/BO9W7DUJ9N16A55x+ -YJAPpE5wIJyx5BtwZbDvu0EW7a1GzjTTAj3d4lD6PF3w4nH4mu+jMiXFjmT0RuH0 -wGnSNFaN2cJutlU7ak220oSrhXvL/bRzQLpdSeINOXcXAUm7cos6ybHizRPSnM59 -bKjwMsmkr1ZviuaI ------END CERTIFICATE----- diff --git a/ext/mysqli/tests/client-key.pem b/ext/mysqli/tests/client-key.pem deleted file mode 100644 index e0aae4f2c4..0000000000 --- a/ext/mysqli/tests/client-key.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAyNGh/qSM8xsXcRt0NRHgDmxACvvA9/Dru8kdocfXsIr28c/6 -a9B5ZOu7aaUNgAbfUhTShTLPv84qRyhbzQsoq7sHM9WL07RyxKa1zDe5A6h4ViVY -HxcwfNEKu+w8owOQl5mSSa6zV5ZcGunoAiOuyMkFUGPld6GacwZ0DkZQKNjJT8Qc -N7hSGAuvGSvU5WZ0pPPw2gkw97wMyZvOVwYEJ+WhLyugureZaZ1G/CG2RYGdsj0v -dhV4tTNirB5rZt0nYQpHAiArV7syIN0GTHakm3JCTJwsdnISH0vfHhEfqQZU3IgS -sEnVQIPvfkhDhno3psHXm/4INJjgVDwwT3kVKQIDAQABAoIBAFrliE2abbIcMSAh -LRhYXvIoTVSrX0za39i/z4nKyvY98EjDurXSRyBHEy1eaB3q/mpIwoFH3oES8FAF -FIha5K3Wmgv8PK42nzwjuWYWUsg1GULk5F4uQOQ+On2VEF0439m+yVhQmxyqEkac -WUeenx6C3sTkcpkTrLUj1qQfb2kM6JmeGsXfJNFLP/U36x8Q6kp2089DxBFgVcFu -W3ge24W08umDBKuZWIF5B9GX8JFzmbAwPT2KATppGeroX0+bo4KAts4F1dBKmbrm -3815kqYnz+VqyWbw6AHUA7aw2TY6QIT1oHrm+EdfnOQZaf8d/2CHWlIZPmxB46Lz -6zQTVgECgYEA/L9awju31alISm0WYOPZBBndIHsOve4iKcMmy85GTKSvV+cAvgAZ -uQwabZi4ZYHYaa4LPF0hbTb5IdV6krQzGYXpAjlwaarW0Zx4VoQIErWyji79OnFD -QpbzIPGQiUAc0D7Gk7kJpwNmpgjyYcSkjEibF4cFEhDpTVlccbgxboUCgYEAy2c0 -tIfKiu1hwo/8UdcO4LQ6LWJdbIDdNU45HCk/IhIe4FrB0pXnk1yIBBn0ezY7Mgzy -USYlfPTjFmnQOFF/6bHyGmeB4YTYamlTDuHlUUdH76brCZ3ywUlqpToiAPJFjx36 -nTNjo8JLF7eyjMOy4uN6eJzzS7OP9GwsHllux1UCgYBeFLCo+me8va2uHpsk58th -TmtUatoa8uh+mSj41kiuwOKQGunYz9rDWfEAeMey6TlwZRvDlXsa10q3QGrG7xLS -XllUvaLNgo1CKzdUJQOIS2AysuUJ+x0pTV0lFyZRIK9ZCPUMCeXA6HAuP8hRgkwp -9+DbSiQmDGt7olbZ8dFcrQKBgQCOFzzUWH//aTD/z8H+EfQMuRpjFfIZmDPvxwNS -TuYRkQMMy5nW2G17ngpOgyss34eewTiNw84waoow4B5bGWP4Bx0PoPs0Za8hNw6U -uO2PR/JS0hIjF7m7mOPtJJ0YeCZrgg/OvVV/0nzOxr7uYs+WfD7T/yBe48NOhjqT -wPoIOQKBgGRLd3G8b0AbPTv4NVwzIl3xKHCKYd1EcBbfyPWjAZ8+BagEPK8mJfOt -MXkMrSKOq6ShEfzRsdJna7eI0te3zNXXFu/G3IHQZUdC0RtksW5T9tXvASRN3wnX -+aaoIM1q/KUgfH0TF/1pQPHFSUfFrGyLDiCDUu1sJ2ijULr5rZES ------END RSA PRIVATE KEY----- diff --git a/ext/mysqli/tests/connect.inc b/ext/mysqli/tests/connect.inc index aa33f17f85..c190e6f61f 100644 --- a/ext/mysqli/tests/connect.inc +++ b/ext/mysqli/tests/connect.inc @@ -1,22 +1,22 @@ <?php /* Default values are "localhost", "root", - database "stest" and empty password. + database "test" and empty password. Change the MYSQL_TEST environment values if you want to use another configuration */ $driver = new mysqli_driver; - $host = getenv("MYSQL_TEST_HOST") ? getenv("MYSQL_TEST_HOST") : "localhost"; - $port = getenv("MYSQL_TEST_PORT") ? getenv("MYSQL_TEST_PORT") : 3306; - $user = getenv("MYSQL_TEST_USER") ? getenv("MYSQL_TEST_USER") : "root"; - $passwd = getenv("MYSQL_TEST_PASSWD") ? getenv("MYSQL_TEST_PASSWD") : ""; - $db = getenv("MYSQL_TEST_DB") ? getenv("MYSQL_TEST_DB") : "test"; - $engine = getenv("MYSQL_TEST_ENGINE") ? getenv("MYSQL_TEST_ENGINE") : "MyISAM"; - $socket = getenv("MYSQL_TEST_SOCKET") ? getenv("MYSQL_TEST_SOCKET") : null; - $skip_on_connect_failure = getenv("MYSQL_TEST_SKIP_CONNECT_FAILURE") ? getenv("MYSQL_TEST_SKIP_CONNECT_FAILURE") : true; - $connect_flags = getenv("MYSQL_TEST_CONNECT_FLAGS") ? (int)getenv("MYSQL_TEST_CONNECT_FLAGS") : 0; + $host = getenv("MYSQL_TEST_HOST") ?: "localhost"; + $port = getenv("MYSQL_TEST_PORT") ?: 3306; + $user = getenv("MYSQL_TEST_USER") ?: "root"; + $passwd = getenv("MYSQL_TEST_PASSWD") ?: ""; + $db = getenv("MYSQL_TEST_DB") ?: "test"; + $engine = getenv("MYSQL_TEST_ENGINE") ?: "MyISAM"; + $socket = getenv("MYSQL_TEST_SOCKET") ?: null; + $skip_on_connect_failure = getenv("MYSQL_TEST_SKIP_CONNECT_FAILURE") ?: true; + $connect_flags = (int)getenv("MYSQL_TEST_CONNECT_FLAGS") ?: 0; if ($socket) { ini_set('mysqli.default_socket', $socket); } @@ -27,35 +27,6 @@ false; $IS_MYSQLND = stristr(mysqli_get_client_info(), "mysqlnd"); - if (!$IS_MYSQLND) { - $MYSQLND_VERSION = NULL; - } else { - /* - The formatting of the version reported by mysqli_get_client_info() - has changed significantly in the past. To get tests working properly - with PHP 5.3.0 and up, we set everything that looks like prior to - PHP 5.3.0 to version 5.0.4 = 5 * 10000 + 0 * 100 + 4 = 50004. - PHP 5.3.0 reports mysqlnd 5.0.5 dev (= 5 * 10000 + 0 * 100 + 5 = 50005. - */ - if (preg_match('@Revision:\s+(\d+)\s*\$@ism', mysqli_get_client_info(), $matches)) { - /* something prior to PHP 5.3.0 */ - $MYSQLND_VERSION = 50004; - } else if (preg_match('@^mysqlnd (\d+)\.(\d+)\.(\d+).*@ism', mysqli_get_client_info(), $matches)) { - /* formatting schema used by PHP 5.3.0 */ - $MYSQLND_VERSION = (int)$matches[1] * 10000 + (int)$matches[2] * 100 + (int)$matches[3]; - } else if (preg_match('@^mysqlnd/PHP 6.0.0-dev@ism', mysqli_get_client_info(), $matches)) { - /* - PHP 6.0 at the time of the first PHP 5.3.0 release. - HEAD and 5.3 have been in sync when 5.3.0 was released. - It is at least 5.0.5-dev. - */ - $MYSQLND_VERSION = 50005; - } else { - /* unknown */ - $MYSQLND_VERSION = -1; - } - - } if (!function_exists('sys_get_temp_dir')) { function sys_get_temp_dir() { diff --git a/ext/mysqli/tests/gracefull_fail_on_empty_result_set.phpt b/ext/mysqli/tests/gracefull_fail_on_empty_result_set.phpt new file mode 100644 index 0000000000..e37e22887a --- /dev/null +++ b/ext/mysqli/tests/gracefull_fail_on_empty_result_set.phpt @@ -0,0 +1,59 @@ +--TEST--
+Fail gracefully on empty result set
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+require_once('skipifemb.inc');
+require_once('skipifconnectfailure.inc');
+?>
+--FILE--
+<?php
+ require_once("connect.inc");
+ require('table.inc');
+
+ // Returns only one result set
+ $link->multi_query("SELECT 1");
+ var_dump($link->next_result()); // should return false
+ var_dump($link->store_result()); // now what happens here!?
+
+
+ // Returns only one result set
+ $link->multi_query("SELECT 1");
+ var_dump($link->next_result());
+ var_dump($link->use_result());
+
+ $link->close();
+?>
+=== DONE ===
+--CLEAN--
+<?php
+ require_once("clean_table.inc");
+?>
+--EXPECT--
+bool(false)
+object(mysqli_result)#3 (5) {
+ ["current_field"]=>
+ int(0)
+ ["field_count"]=>
+ int(1)
+ ["lengths"]=>
+ NULL
+ ["num_rows"]=>
+ int(1)
+ ["type"]=>
+ int(0)
+}
+bool(false)
+object(mysqli_result)#3 (5) {
+ ["current_field"]=>
+ int(0)
+ ["field_count"]=>
+ int(1)
+ ["lengths"]=>
+ NULL
+ ["num_rows"]=>
+ int(0)
+ ["type"]=>
+ int(1)
+}
+=== DONE ===
diff --git a/ext/mysqli/tests/mysqli_auth_pam.phpt b/ext/mysqli/tests/mysqli_auth_pam.phpt index 86c5c4809a..30d2da5675 100644 --- a/ext/mysqli/tests/mysqli_auth_pam.phpt +++ b/ext/mysqli/tests/mysqli_auth_pam.phpt @@ -6,7 +6,7 @@ require_once('skipif.inc'); require_once('skipifemb.inc'); require_once('connect.inc'); -if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { +if (!$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { die(sprintf("SKIP Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", $host, $user, $db, $port, $socket)); } diff --git a/ext/mysqli/tests/mysqli_change_user_new.phpt b/ext/mysqli/tests/mysqli_change_user_new.phpt index ec6b3e31c9..e9ef937406 100644 --- a/ext/mysqli/tests/mysqli_change_user_new.phpt +++ b/ext/mysqli/tests/mysqli_change_user_new.phpt @@ -35,9 +35,6 @@ if (mysqli_get_server_version($link) < 50600) print "done!"; ?> ---EXPECTF-- -Warning: mysqli_query(): MySQL server has gone away in %s on line %d - -Warning: mysqli_query(): Error reading result set's header in %s on line %d +--EXPECT-- [003] [2006] MySQL server has gone away done! diff --git a/ext/mysqli/tests/mysqli_change_user_old.phpt b/ext/mysqli/tests/mysqli_change_user_old.phpt index cf53016f59..a077d9c4b6 100644 --- a/ext/mysqli/tests/mysqli_change_user_old.phpt +++ b/ext/mysqli/tests/mysqli_change_user_old.phpt @@ -20,21 +20,6 @@ if (mysqli_get_server_version($link) >= 50600) $tmp = NULL; $link = NULL; - if (!is_null($tmp = @mysqli_change_user())) - printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - - if (!is_null($tmp = @mysqli_change_user($link))) - printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - - if (!is_null($tmp = @mysqli_change_user($link, $link))) - printf("[003] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - - if (!is_null($tmp = @mysqli_change_user($link, $link, $link))) - printf("[004] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - - if (!is_null($tmp = @mysqli_change_user($link, $link, $link, $link, $link))) - printf("[005] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[006] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", $host, $user, $db, $port, $socket); @@ -118,8 +103,8 @@ if (mysqli_get_server_version($link) >= 50600) mysqli_close($link); - if (NULL !== ($tmp = @mysqli_change_user($link, $user, $passwd, $db))) - printf("[026] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); + if (false !== ($tmp = @mysqli_change_user($link, $user, $passwd, $db))) + printf("[026] Expecting false, got %s/%s\n", gettype($tmp), $tmp); print "done!"; ?> diff --git a/ext/mysqli/tests/mysqli_change_user_oo.phpt b/ext/mysqli/tests/mysqli_change_user_oo.phpt index 5203381088..7707cca095 100644 --- a/ext/mysqli/tests/mysqli_change_user_oo.phpt +++ b/ext/mysqli/tests/mysqli_change_user_oo.phpt @@ -25,18 +25,6 @@ if (mysqli_get_server_version($link) >= 50600) printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", $host, $user, $db, $port, $socket); - if (!is_null($tmp = @$mysqli->change_user())) - printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - - if (!is_null($tmp = @$mysqli->change_user($link))) - printf("[003] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - - if (!is_null($tmp = @$mysqli->change_user($link, $link))) - printf("[004] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - - if (!is_null($tmp = @$mysqli->change_user($link, $link, $link, $link))) - printf("[005] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - if (false !== ($tmp = $mysqli->change_user($user . '_unknown_really', $passwd . 'non_empty', $db))) printf("[006] Expecting false, got %s/%s\n", gettype($tmp), $tmp); @@ -83,8 +71,8 @@ if (mysqli_get_server_version($link) >= 50600) $mysqli->close(); - if (NULL !== ($tmp = @$mysqli->change_user($user, $passwd, $db))) - printf("[018] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); + if (false !== ($tmp = @$mysqli->change_user($user, $passwd, $db))) + printf("[018] Expecting false, got %s/%s\n", gettype($tmp), $tmp); print "done!"; ?> diff --git a/ext/mysqli/tests/mysqli_class_mysqli_driver_interface.phpt b/ext/mysqli/tests/mysqli_class_mysqli_driver_interface.phpt index 681590e1ab..78784210bb 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_driver_interface.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_driver_interface.phpt @@ -20,15 +20,6 @@ require_once('skipifconnectfailure.inc'); $methods = get_class_methods($driver); $expected_methods = array(); - if (!$IS_MYSQLND && (isset($methods['embedded_server_start']))) { - /* libmysql only - needs extra compile flag, no way to check properly in the - PHP user land if its compiled in or not */ - $expected_methods = array_merge($expected_methods, array( - 'embedded_server_start' => true, - 'embedded_server_end' => true, - )); - } - foreach ($methods as $k => $method) { if (isset($expected_methods[$method])) { unset($expected_methods[$method]); diff --git a/ext/mysqli/tests/mysqli_class_mysqli_driver_reflection.phpt b/ext/mysqli/tests/mysqli_class_mysqli_driver_reflection.phpt index 11c3492817..7b6c0a65d9 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_driver_reflection.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_driver_reflection.phpt @@ -40,7 +40,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'client_version' isPublic: yes @@ -48,7 +48,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'driver_version' isPublic: yes @@ -56,7 +56,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'embedded' isPublic: yes @@ -64,7 +64,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'reconnect' isPublic: yes @@ -72,7 +72,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'report_mode' isPublic: yes @@ -80,7 +80,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Default property 'client_info' Default property 'client_version' Default property 'driver_version' diff --git a/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt b/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt index 27d399be16..dfefb9098c 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_interface.phpt @@ -53,7 +53,7 @@ require_once('skipifconnectfailure.inc'); 'set_charset' => true, 'set_opt' => true, 'ssl_set' => true, - 'stat' => true, + 'stat' => true, 'stmt_init' => true, 'store_result' => true, 'thread_safe' => true, @@ -109,7 +109,6 @@ require_once('skipifconnectfailure.inc'); "server_info" => true, "server_version" => true, "sqlstate" => true, - "stat" => true, "thread_id" => true, "warning_count" => true, ); @@ -200,11 +199,6 @@ require_once('skipifconnectfailure.inc'); $mysqli->sqlstate, gettype($mysqli->sqlstate), mysqli_sqlstate($link), gettype(mysqli_sqlstate($link))); - assert(soundex(mysqli_stat($link)) == soundex($mysqli->stat)); - printf("mysqli->stat = '%s'/%s ('%s'/%s)\n", - $mysqli->stat, gettype($mysqli->stat), - mysqli_stat($link), gettype(mysqli_stat($link))); - assert(mysqli_get_host_info($link) === $mysqli->host_info); printf("mysqli->host_info = '%s'/%s ('%s'/%s)\n", $mysqli->host_info, gettype($mysqli->host_info), @@ -288,7 +282,6 @@ mysqli->error = ''/string (''/string) mysqli->field_count = '0'/integer ('0'/integer) mysqli->insert_id = '0'/integer ('0'/integer) mysqli->sqlstate = '00000'/string ('00000'/string) -mysqli->stat = 'Uptime: %d Threads: %d Questions: %d Slow queries: %d Opens: %d Flush tables: %d Open tables: %d Queries per second avg: %d.%d'/string ('Uptime: %d Threads: %d Questions: %d Slow queries: %d Opens: %d Flush tables: %d Open tables: %d Queries per second avg: %d.%d'/string) mysqli->host_info = '%s'/string ('%s'/string) mysqli->info = ''/NULL (''/NULL) mysqli->thread_id = '%d'/integer ('%d'/integer) diff --git a/ext/mysqli/tests/mysqli_class_mysqli_properties_no_conn.phpt b/ext/mysqli/tests/mysqli_class_mysqli_properties_no_conn.phpt index fe6808e8c0..b7f227a7c2 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_properties_no_conn.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_properties_no_conn.phpt @@ -160,7 +160,6 @@ protocol_version = 'false' server_info = 'false' server_version = 'false' sqlstate = 'false' -stat = 'false' thread_id = 'false' warning_count = 'false' @@ -179,7 +178,6 @@ info = 'false' insert_id = 'false' server_info = 'false' server_version = 'false' -stat = 'false' sqlstate = 'false' protocol_version = 'false' thread_id = 'false' @@ -233,7 +231,6 @@ protocol_version = 'false' server_info = 'false' server_version = 'false' sqlstate = 'false' -stat = 'false' thread_id = 'false' warning_count = 'false' @@ -252,7 +249,6 @@ info = 'false' insert_id = 'false' server_info = 'false' server_version = 'false' -stat = 'false' sqlstate = 'false' protocol_version = 'false' thread_id = 'false' diff --git a/ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt b/ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt index 9247721e43..47beb1d79b 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_reflection.phpt @@ -7,14 +7,12 @@ require_once('skipifemb.inc'); require_once('connect.inc'); /* -Let's not deal with cross-version issues in the EXPECTF/UEXPECTF. +Let's not deal with cross-version issues in the EXPECTF section. Most of the things which we test are covered by mysqli_class_*_interface.phpt. Those tests go into the details and are aimed to be a development tool, no more. */ if (!$IS_MYSQLND) - die("skip Test has been written for the latest version of mysqlnd only"); -if ($MYSQLND_VERSION < 50004) - die("skip Test requires mysqlnd Revision 5.0.4 or newer"); + die("skip Test has been written for mysqlnd only"); ?> --FILE-- @@ -49,7 +47,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 6 Number of Required Parameters: 0 @@ -107,7 +105,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 6 Number of Required Parameters: 0 @@ -165,7 +163,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 1 Number of Required Parameters: 1 @@ -188,7 +186,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 2 Number of Required Parameters: 0 @@ -218,7 +216,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 3 Number of Required Parameters: 3 @@ -255,7 +253,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -271,7 +269,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -287,7 +285,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 2 Number of Required Parameters: 0 @@ -317,7 +315,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 6 Number of Required Parameters: 0 @@ -375,7 +373,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 1 Number of Required Parameters: 1 @@ -398,7 +396,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -414,7 +412,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 1 Number of Required Parameters: 1 @@ -437,7 +435,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -453,7 +451,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -469,7 +467,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -485,7 +483,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -501,7 +499,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -517,7 +515,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -533,7 +531,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 1 Number of Required Parameters: 1 @@ -556,7 +554,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -572,7 +570,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 1 Number of Required Parameters: 1 @@ -595,7 +593,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -611,7 +609,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 2 Number of Required Parameters: 2 @@ -641,7 +639,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -657,7 +655,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 257 +Modifiers: 17 Number of Parameters: 5 Number of Required Parameters: 4 @@ -708,7 +706,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 1 Number of Required Parameters: 1 @@ -731,7 +729,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 2 Number of Required Parameters: 1 @@ -761,7 +759,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 7 Number of Required Parameters: 0 @@ -826,7 +824,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 1 Number of Required Parameters: 1 @@ -849,7 +847,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 1 Number of Required Parameters: 1 @@ -872,7 +870,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -888,7 +886,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 1 Number of Required Parameters: 1 @@ -911,7 +909,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 1 Number of Required Parameters: 1 @@ -934,7 +932,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 2 Number of Required Parameters: 0 @@ -964,7 +962,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 1 Number of Required Parameters: 1 @@ -987,7 +985,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 1 Number of Required Parameters: 1 @@ -1010,7 +1008,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 1 Number of Required Parameters: 1 @@ -1033,7 +1031,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 2 Number of Required Parameters: 2 @@ -1063,7 +1061,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 5 Number of Required Parameters: 5 @@ -1114,7 +1112,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -1130,7 +1128,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -1146,7 +1144,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 1 Number of Required Parameters: 0 @@ -1169,7 +1167,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -1185,7 +1183,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -1195,7 +1193,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'client_info' isPublic: yes @@ -1203,7 +1201,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'client_version' isPublic: yes @@ -1211,7 +1209,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'connect_errno' isPublic: yes @@ -1219,7 +1217,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'connect_error' isPublic: yes @@ -1227,7 +1225,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'errno' isPublic: yes @@ -1235,7 +1233,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'error' isPublic: yes @@ -1243,7 +1241,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'error_list' isPublic: yes @@ -1251,7 +1249,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'field_count' isPublic: yes @@ -1259,7 +1257,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'host_info' isPublic: yes @@ -1267,7 +1265,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'info' isPublic: yes @@ -1275,7 +1273,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'insert_id' isPublic: yes @@ -1283,7 +1281,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'protocol_version' isPublic: yes @@ -1291,7 +1289,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'server_info' isPublic: yes @@ -1299,7 +1297,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'server_version' isPublic: yes @@ -1307,7 +1305,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'sqlstate' isPublic: yes @@ -1315,15 +1313,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 - -Inspecting property 'stat' -isPublic: yes -isPrivate: no -isProtected: no -isStatic: no -isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'thread_id' isPublic: yes @@ -1331,7 +1321,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'warning_count' isPublic: yes @@ -1339,7 +1329,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Default property 'affected_rows' Default property 'client_info' Default property 'client_version' @@ -1356,7 +1346,6 @@ Default property 'protocol_version' Default property 'server_info' Default property 'server_version' Default property 'sqlstate' -Default property 'stat' Default property 'thread_id' Default property 'warning_count' done! diff --git a/ext/mysqli/tests/mysqli_class_mysqli_result_reflection.phpt b/ext/mysqli/tests/mysqli_class_mysqli_result_reflection.phpt index ee2765c4dc..b3b7759ace 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_result_reflection.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_result_reflection.phpt @@ -8,14 +8,12 @@ require_once('skipifconnectfailure.inc'); require_once('connect.inc'); /* -Let's not deal with cross-version issues in the EXPECTF/UEXPECTF. +Let's not deal with cross-version issues in the EXPECTF section. Most of the things which we test are covered by mysqli_class_*_interface.phpt. Those tests go into the details and are aimed to be a development tool, no more. */ if (!$IS_MYSQLND) - die("skip Test has been written for the latest version of mysqlnd only"); -if ($MYSQLND_VERSION < 50004) - die("skip Test requires mysqlnd Revision 5.0.4 or newer"); + die("skip Test has been written for mysqlnd only"); ?> --FILE-- <?php @@ -49,7 +47,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -65,7 +63,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -81,7 +79,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -97,7 +95,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 1 Number of Required Parameters: 1 @@ -120,7 +118,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 1 Number of Required Parameters: 0 @@ -143,7 +141,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 1 Number of Required Parameters: 0 @@ -166,7 +164,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -182,7 +180,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -198,7 +196,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 1 Number of Required Parameters: 1 @@ -221,7 +219,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -237,7 +235,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 2 Number of Required Parameters: 0 @@ -267,7 +265,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -283,7 +281,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 1 Number of Required Parameters: 1 @@ -306,7 +304,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -322,7 +320,7 @@ isDestructor: no isInternal: yes isUserDefined: no returnsReference: no -Modifiers: 256 +Modifiers: 1 Number of Parameters: 0 Number of Required Parameters: 0 @@ -332,7 +330,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'field_count' isPublic: yes @@ -340,7 +338,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'lengths' isPublic: yes @@ -348,7 +346,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'num_rows' isPublic: yes @@ -356,7 +354,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'type' isPublic: yes @@ -364,7 +362,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Default property 'current_field' Default property 'field_count' Default property 'lengths' diff --git a/ext/mysqli/tests/mysqli_class_mysqli_warning_reflection.phpt b/ext/mysqli/tests/mysqli_class_mysqli_warning_reflection.phpt index 8ad12737a7..f57945e589 100644 --- a/ext/mysqli/tests/mysqli_class_mysqli_warning_reflection.phpt +++ b/ext/mysqli/tests/mysqli_class_mysqli_warning_reflection.phpt @@ -7,14 +7,12 @@ require_once('skipifemb.inc'); require_once('connect.inc'); /* -Let's not deal with cross-version issues in the EXPECTF/UEXPECTF. +Let's not deal with cross-version issues in the EXPECTF section. Most of the things which we test are covered by mysqli_class_*_interface.phpt. Those tests go into the details and are aimed to be a development tool, no more. */ if (!$IS_MYSQLND) - die("skip Test has been written for the latest version of mysqlnd only"); -if ($MYSQLND_VERSION < 50004) - die("skip Test requires mysqlnd Revision 5.0.4 or newer"); + die("skip Test has been written for mysqlnd only"); ?> --FILE-- <?php @@ -90,7 +88,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'message' isPublic: yes @@ -98,7 +96,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Inspecting property 'sqlstate' isPublic: yes @@ -106,7 +104,7 @@ isPrivate: no isProtected: no isStatic: no isDefault: yes -Modifiers: 256 +Modifiers: 1 Default property 'errno' Default property 'message' Default property 'sqlstate' diff --git a/ext/mysqli/tests/mysqli_connect_oo_warnings.phpt b/ext/mysqli/tests/mysqli_connect_oo_warnings.phpt index e5a1b0fc99..8204d0f1da 100644 --- a/ext/mysqli/tests/mysqli_connect_oo_warnings.phpt +++ b/ext/mysqli/tests/mysqli_connect_oo_warnings.phpt @@ -44,7 +44,7 @@ new mysqli() --EXPECTF-- 1) bail -Warning: mysqli::mysqli(): (HY000/200%d): %s +Warning: mysqli::__construct(): (HY000/200%d): %s 2) be quiet %s(%d) "%s" int(200%d) diff --git a/ext/mysqli/tests/mysqli_debug_ini.phpt b/ext/mysqli/tests/mysqli_debug_ini.phpt index de02d0ebd7..f1a37bf882 100644 --- a/ext/mysqli/tests/mysqli_debug_ini.phpt +++ b/ext/mysqli/tests/mysqli_debug_ini.phpt @@ -16,8 +16,8 @@ if (defined('MYSQLI_DEBUG_TRACE_ENABLED') && !MYSQLI_DEBUG_TRACE_ENABLED) die("skip: debug functionality not enabled"); require_once('connect.inc'); -if (!$IS_MYSQLND || ($MYSQLND_VERSION < 50004)) - die("skip needs mysqlnd version/revision 5.0.4"); +if (!$IS_MYSQLND) + die("skip needs mysqlnd"); if (!$fp = @fopen('/tmp/mysqli_debug_phpt.trace', 'w')) die("skip PHP cannot create a file in /tmp/mysqli_debug_phpt"); diff --git a/ext/mysqli/tests/mysqli_expire_password.phpt b/ext/mysqli/tests/mysqli_expire_password.phpt index 853daf0cdf..fdf8b783fb 100644 --- a/ext/mysqli/tests/mysqli_expire_password.phpt +++ b/ext/mysqli/tests/mysqli_expire_password.phpt @@ -6,7 +6,7 @@ require_once('skipif.inc'); require_once('skipifemb.inc'); require_once('connect.inc'); -if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { +if (!$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { die(sprintf("SKIP Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", $host, $user, $db, $port, $socket)); } diff --git a/ext/mysqli/tests/mysqli_fork.phpt b/ext/mysqli/tests/mysqli_fork.phpt index 81f453ca80..cc4c72f561 100644 --- a/ext/mysqli/tests/mysqli_fork.phpt +++ b/ext/mysqli/tests/mysqli_fork.phpt @@ -111,7 +111,7 @@ if (!have_innodb($link)) continue; $tmp = mysqli_fetch_assoc($pres); mysqli_free_result($pres); - if ($tmp['msg_id'] == $msg_id) + if (!$tmp || $tmp['msg_id'] == $msg_id) /* no new message */ continue; if ($tmp['msg'] == 'stop') @@ -143,7 +143,7 @@ if (!have_innodb($link)) $wait_id = pcntl_waitpid($pid, $status, WNOHANG); if ($pres = mysqli_query($plink, $sql)) { $row = mysqli_fetch_assoc($pres); - if ($row['msg_id'] != $last_msg_id) { + if ($row && $row['msg_id'] != $last_msg_id) { $last_msg_id = $row['msg_id']; switch ($row['msg']) { case 'start': @@ -179,7 +179,7 @@ if (!have_innodb($link)) if ($parent_row != $client_row) { printf("[015] Child indicates different results than parent.\n"); - var_dump($child_row); + var_dump($client_row); var_dump($parent_row); if (!mysqli_query($plink, sprintf($parent_sql, 'stop'))) { printf("[016] Parent cannot inform child\n", mysqli_errno($plink), mysqli_error($plink)); diff --git a/ext/mysqli/tests/mysqli_kill.phpt b/ext/mysqli/tests/mysqli_kill.phpt index 85eb90e65a..8b4e36afd4 100644 --- a/ext/mysqli/tests/mysqli_kill.phpt +++ b/ext/mysqli/tests/mysqli_kill.phpt @@ -44,9 +44,6 @@ require_once('skipifconnectfailure.inc'); if ($link->info != 'Records: 6 Duplicates: 0 Warnings: 0') { printf("[008] mysqlnd used to be more verbose and used to support SELECT\n"); } - if ($link->stat != NULL) { - printf("[009] NULL expected because of error.\n"); - } } else { if ($link->info != NULL) { printf("[008] Time for wonders - libmysql has started to support SELECT, change test\n"); @@ -123,8 +120,6 @@ object(mysqli)#%d (%d) { string(%d) "%s" ["server_version"]=> int(%d) - ["stat"]=> - %s ["sqlstate"]=> string(5) "HY000" ["protocol_version"]=> diff --git a/ext/mysqli/tests/mysqli_more_results.phpt b/ext/mysqli/tests/mysqli_more_results.phpt index 4ce6a19c79..7f0a1f748b 100644 --- a/ext/mysqli/tests/mysqli_more_results.phpt +++ b/ext/mysqli/tests/mysqli_more_results.phpt @@ -73,14 +73,10 @@ bool(false) [006] 1 2 - -Strict Standards: mysqli_next_result(): There is no next result set. Please, call mysqli_more_results()/mysqli::more_results() to check whether to call this function/method in %s on line %d [010] 1 2 -Strict Standards: mysqli_next_result(): There is no next result set. Please, call mysqli_more_results()/mysqli::more_results() to check whether to call this function/method in %s on line %d - Warning: mysqli_more_results(): Couldn't fetch mysqli in %s on line %d bool(false) done! diff --git a/ext/mysqli/tests/mysqli_multi_query.phpt b/ext/mysqli/tests/mysqli_multi_query.phpt index 28898b1dcb..05f564313d 100644 --- a/ext/mysqli/tests/mysqli_multi_query.phpt +++ b/ext/mysqli/tests/mysqli_multi_query.phpt @@ -104,7 +104,7 @@ require_once('skipifconnectfailure.inc'); mysqli_free_result($res); - } while (@mysqli_next_result($link)); + } while (mysqli_next_result($link)); if ($res_num != 4) printf("[015] Expecting 3 result sets got %d result set[s]\n", $res_num); @@ -120,12 +120,9 @@ require_once('skipifconnectfailure.inc'); require_once("clean_table.inc"); ?> --EXPECTF-- -Strict Standards: mysqli_next_result(): There is no next result set. Please, call mysqli_more_results()/mysqli::more_results() to check whether to call this function/method in %s on line %d [006] 3 [008] 0 [009] [2014] Commands out of sync; you can't run this command now - -Strict Standards: mysqli_next_result(): There is no next result set. Please, call mysqli_more_results()/mysqli::more_results() to check whether to call this function/method in %s on line %d [010] 7 Warning: mysqli_multi_query(): Couldn't fetch mysqli in %s on line %d diff --git a/ext/mysqli/tests/mysqli_mysqlnd_read_timeout.phpt b/ext/mysqli/tests/mysqli_mysqlnd_read_timeout.phpt index 7dbdc134eb..4f65f77480 100644 --- a/ext/mysqli/tests/mysqli_mysqlnd_read_timeout.phpt +++ b/ext/mysqli/tests/mysqli_mysqlnd_read_timeout.phpt @@ -28,9 +28,6 @@ mysqlnd.net_read_timeout=1 print "done!"; ?> ---EXPECTF-- -Warning: mysqli_query(): MySQL server has gone away in %s on line %d - -Warning: mysqli_query(): Error reading result set's header in %s on line %d -[002] [%d] %s +--EXPECT-- +[002] [2006] MySQL server has gone away done! diff --git a/ext/mysqli/tests/mysqli_next_result.phpt b/ext/mysqli/tests/mysqli_next_result.phpt index e01f507c20..6760cbbadc 100644 --- a/ext/mysqli/tests/mysqli_next_result.phpt +++ b/ext/mysqli/tests/mysqli_next_result.phpt @@ -73,15 +73,6 @@ require_once('skipifconnectfailure.inc'); require_once("clean_table.inc"); ?> --EXPECTF-- -Strict Standards: mysqli_next_result(): There is no next result set. Please, call mysqli_more_results()/mysqli::more_results() to check whether to call this function/method in %s on line %d - -Strict Standards: mysqli_next_result(): There is no next result set. Please, call mysqli_more_results()/mysqli::more_results() to check whether to call this function/method in %s on line %d - -Strict Standards: mysqli_next_result(): There is no next result set. Please, call mysqli_more_results()/mysqli::more_results() to check whether to call this function/method in %s on line %d - -Strict Standards: mysqli_next_result(): There is no next result set. Please, call mysqli_more_results()/mysqli::more_results() to check whether to call this function/method in %s on line %d - -Strict Standards: mysqli_next_result(): There is no next result set. Please, call mysqli_more_results()/mysqli::more_results() to check whether to call this function/method in %s on line %d Warning: mysqli_next_result(): Couldn't fetch mysqli in %s on line %d bool(false) diff --git a/ext/mysqli/tests/mysqli_pconn_max_links.phpt b/ext/mysqli/tests/mysqli_pconn_max_links.phpt index 4b610c3a9a..221be0699f 100644 --- a/ext/mysqli/tests/mysqli_pconn_max_links.phpt +++ b/ext/mysqli/tests/mysqli_pconn_max_links.phpt @@ -234,10 +234,6 @@ Before second pconnect:array(3) { ["cached_plinks"]=> int(0) } - -Warning: main(): MySQL server has gone away in %s on line %d - -Warning: main(): Error reading result set's header in %s line %d After second pconnect:array(3) { ["total"]=> int(1) diff --git a/ext/mysqli/tests/mysqli_phpinfo.phpt b/ext/mysqli/tests/mysqli_phpinfo.phpt index 02913daa69..4f856f2b65 100644 --- a/ext/mysqli/tests/mysqli_phpinfo.phpt +++ b/ext/mysqli/tests/mysqli_phpinfo.phpt @@ -46,17 +46,6 @@ require_once('skipifconnectfailure.inc'); if ($IS_MYSQLND) { $expected = array( - 'mysqlnd statistics', - 'bytes_sent', 'bytes_received', 'packets_sent', 'packets_received', - 'protocol_overhead_in', 'protocol_overhead_out', 'result_set_queries', - 'non_result_set_queries', 'no_index_used', 'bad_index_used', - 'buffered_sets', 'unbuffered_sets', 'ps_buffered_sets', 'ps_unbuffered_sets', - 'flushed_normal_sets', 'flushed_ps_sets', 'rows_fetched_from_server', - 'rows_fetched_from_client', 'rows_skipped', 'copy_on_write_saved', - 'copy_on_write_performed', 'command_buffer_too_small', 'connect_success', - 'connect_failure', 'connection_reused', 'explicit_close', 'implicit_close', - 'disconnect_close', 'in_middle_of_command_close', 'explicit_free_result', - 'implicit_free_result', 'explicit_stmt_close', 'implicit_stmt_close', 'size', 'mysqli.allow_local_infile', 'mysqli.allow_persistent', 'mysqli.max_persistent' diff --git a/ext/mysqli/tests/mysqli_query.phpt b/ext/mysqli/tests/mysqli_query.phpt index bfa703bb01..08145cddcf 100644 --- a/ext/mysqli/tests/mysqli_query.phpt +++ b/ext/mysqli/tests/mysqli_query.phpt @@ -94,12 +94,7 @@ require_once('skipifconnectfailure.inc'); printf("[012] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_free_result($res); - $valid = array(MYSQLI_USE_RESULT, MYSQLI_STORE_RESULT); - do { - $mode = mt_rand(-1000, 1000); - } while (in_array($mode, $valid)); - - if (false !== ($res = @mysqli_query($link, "SELECT id FROM test ORDER BY id", $mode))) + if (false !== ($res = @mysqli_query($link, "SELECT id FROM test ORDER BY id", 1234))) printf("[013] Invalid mode should return false got %s/%s, [%d] %s\n", gettype($res), (is_object($res)) ? 'object' : $res, mysqli_errno($link), mysqli_error($link)); diff --git a/ext/mysqli/tests/mysqli_real_connect.phpt b/ext/mysqli/tests/mysqli_real_connect.phpt index 5e4b56173b..1316d1a981 100644 --- a/ext/mysqli/tests/mysqli_real_connect.phpt +++ b/ext/mysqli/tests/mysqli_real_connect.phpt @@ -207,8 +207,6 @@ object(mysqli)#%d (%d) { bool(false) ["server_version"]=> bool(false) - ["stat"]=> - bool(false) ["sqlstate"]=> bool(false) ["protocol_version"]=> diff --git a/ext/mysqli/tests/mysqli_report_wo_ps.phpt b/ext/mysqli/tests/mysqli_report_wo_ps.phpt index d08ffa5e7d..535efb1fac 100644 --- a/ext/mysqli/tests/mysqli_report_wo_ps.phpt +++ b/ext/mysqli/tests/mysqli_report_wo_ps.phpt @@ -20,9 +20,6 @@ if (mysqli_get_server_version($link) >= 50600) $tmp = NULL; $link = NULL; - if (NULL !== ($tmp = @mysqli_report())) - printf("[001] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - if (true !== ($tmp = mysqli_report(-1))) printf("[002] Expecting boolean/true even for invalid flags, got %s/%s\n", gettype($tmp), $tmp); diff --git a/ext/mysqli/tests/mysqli_mysqli_result_invalid_mode.phpt b/ext/mysqli/tests/mysqli_result_invalid_mode.phpt index 29ff65780c..29ff65780c 100644 --- a/ext/mysqli/tests/mysqli_mysqli_result_invalid_mode.phpt +++ b/ext/mysqli/tests/mysqli_result_invalid_mode.phpt diff --git a/ext/mysqli/tests/mysqli_rollback.phpt b/ext/mysqli/tests/mysqli_rollback.phpt index 06af152c8c..3a15ebbb79 100644 --- a/ext/mysqli/tests/mysqli_rollback.phpt +++ b/ext/mysqli/tests/mysqli_rollback.phpt @@ -1,9 +1,7 @@ --TEST-- mysqli_rollback() --SKIPIF-- -<?php ?> -<?php ?> -<?PHP +<?php require_once('skipif.inc'); require_once('skipifemb.inc'); require_once('skipifconnectfailure.inc'); |
