From 362c29241db872cf7eb030cef1148d47d3489be1 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 15 Dec 2020 10:55:53 +0100 Subject: [PATCH] Remove mysqlnd_extension enum ext/mysql is no longer supported, drop handling for it from mysqlnd. --- ext/mysqli/mysqli.c | 2 +- ext/mysqli/mysqli_warning.c | 2 +- ext/mysqlnd/mysqlnd.h | 2 +- ext/mysqlnd/mysqlnd_enum_n_def.h | 6 ------ ext/mysqlnd/mysqlnd_result.c | 15 +++------------ ext/mysqlnd/mysqlnd_structs.h | 2 +- 6 files changed, 7 insertions(+), 22 deletions(-) diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index cea4ba6394..50c5038f15 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -1130,7 +1130,7 @@ void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * result, zend } } #else - mysqlnd_fetch_into(result, ((fetchtype & MYSQLI_NUM)? MYSQLND_FETCH_NUM:0) | ((fetchtype & MYSQLI_ASSOC)? MYSQLND_FETCH_ASSOC:0), return_value, MYSQLND_MYSQLI); + mysqlnd_fetch_into(result, ((fetchtype & MYSQLI_NUM)? MYSQLND_FETCH_NUM:0) | ((fetchtype & MYSQLI_ASSOC)? MYSQLND_FETCH_ASSOC:0), return_value); #endif } /* }}} */ diff --git a/ext/mysqli/mysqli_warning.c b/ext/mysqli/mysqli_warning.c index 7b1552e5ac..6dd7090911 100644 --- a/ext/mysqli/mysqli_warning.c +++ b/ext/mysqli/mysqli_warning.c @@ -131,7 +131,7 @@ MYSQLI_WARNING * php_get_warnings(MYSQLND_CONN_DATA * mysql) zval *entry; int errno; - mysqlnd_fetch_into(result, MYSQLND_FETCH_NUM, &row, MYSQLND_MYSQLI); + mysqlnd_fetch_into(result, MYSQLND_FETCH_NUM, &row); if (Z_TYPE(row) != IS_ARRAY) { zval_ptr_dtor(&row); break; diff --git a/ext/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h index bf3a9d640f..b4d3d1f8c3 100644 --- a/ext/mysqlnd/mysqlnd.h +++ b/ext/mysqlnd/mysqlnd.h @@ -98,7 +98,7 @@ PHPAPI MYSQLND * mysqlnd_connection_connect(MYSQLND * conn, PHPAPI void mysqlnd_debug(const char *mode); /* Query */ -#define mysqlnd_fetch_into(result, flags, ret_val, ext) (result)->m.fetch_into((result), (flags), (ret_val), (ext) ZEND_FILE_LINE_CC) +#define mysqlnd_fetch_into(result, flags, ret_val) (result)->m.fetch_into((result), (flags), (ret_val) ZEND_FILE_LINE_CC) #define mysqlnd_fetch_row_c(result) (result)->m.fetch_row_c((result)) #define mysqlnd_fetch_all(result, flags, return_value) (result)->m.fetch_all((result), (flags), (return_value) ZEND_FILE_LINE_CC) #define mysqlnd_get_connection_stats(conn, values) ((conn)->data)->m->get_statistics((conn)->data, (values) ZEND_FILE_LINE_CC) diff --git a/ext/mysqlnd/mysqlnd_enum_n_def.h b/ext/mysqlnd/mysqlnd_enum_n_def.h index 161a3821bd..191b8388b3 100644 --- a/ext/mysqlnd/mysqlnd_enum_n_def.h +++ b/ext/mysqlnd/mysqlnd_enum_n_def.h @@ -148,12 +148,6 @@ #define TRANS_COR_RELEASE 4 #define TRANS_COR_NO_RELEASE 8 -typedef enum mysqlnd_extension -{ - MYSQLND_MYSQL = 0, - MYSQLND_MYSQLI -} enum_mysqlnd_extension; - enum { MYSQLND_FETCH_ASSOC = 1, diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c index bdeefd5d04..f67f8bdcc1 100644 --- a/ext/mysqlnd/mysqlnd_result.c +++ b/ext/mysqlnd/mysqlnd_result.c @@ -1692,8 +1692,7 @@ MYSQLND_METHOD(mysqlnd_res, field_tell)(const MYSQLND_RES * const result) /* {{{ mysqlnd_res::fetch_into */ static void MYSQLND_METHOD(mysqlnd_res, fetch_into)(MYSQLND_RES * result, const unsigned int flags, - zval *return_value, - enum_mysqlnd_extension extension ZEND_FILE_LINE_DC) + zval *return_value ZEND_FILE_LINE_DC) { zend_bool fetched_anything; unsigned int array_size; @@ -1715,15 +1714,7 @@ MYSQLND_METHOD(mysqlnd_res, fetch_into)(MYSQLND_RES * result, const unsigned int RETVAL_FALSE; } else if (fetched_anything == FALSE) { zend_array_destroy(Z_ARR_P(return_value)); - switch (extension) { - case MYSQLND_MYSQLI: - RETVAL_NULL(); - break; - case MYSQLND_MYSQL: - RETVAL_FALSE; - break; - default:exit(0); - } + RETVAL_NULL(); } /* return_value is IS_NULL for no more data and an array for data. Thus it's ok @@ -1778,7 +1769,7 @@ MYSQLND_METHOD(mysqlnd_res, fetch_all)(MYSQLND_RES * result, const unsigned int array_init_size(return_value, set? (unsigned int) set->row_count : 4); do { - mysqlnd_fetch_into(result, flags, &row, MYSQLND_MYSQLI); + mysqlnd_fetch_into(result, flags, &row); if (Z_TYPE(row) != IS_ARRAY) { zval_ptr_dtor_nogc(&row); break; diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h index f8562432ae..f992f70baf 100644 --- a/ext/mysqlnd/mysqlnd_structs.h +++ b/ext/mysqlnd/mysqlnd_structs.h @@ -641,7 +641,7 @@ typedef enum_func_status (*func_mysqlnd_res__row_decoder)(MYSQLND_ROW_BUFFER * r typedef MYSQLND_RES * (*func_mysqlnd_res__use_result)(MYSQLND_RES * const result, const zend_bool ps_protocol); typedef MYSQLND_RES * (*func_mysqlnd_res__store_result)(MYSQLND_RES * result, MYSQLND_CONN_DATA * const conn, const unsigned int flags); -typedef void (*func_mysqlnd_res__fetch_into)(MYSQLND_RES *result, const unsigned int flags, zval *return_value, enum_mysqlnd_extension ext ZEND_FILE_LINE_DC); +typedef void (*func_mysqlnd_res__fetch_into)(MYSQLND_RES *result, const unsigned int flags, zval *return_value ZEND_FILE_LINE_DC); typedef MYSQLND_ROW_C (*func_mysqlnd_res__fetch_row_c)(MYSQLND_RES *result); typedef void (*func_mysqlnd_res__fetch_all)(MYSQLND_RES *result, const unsigned int flags, zval *return_value ZEND_FILE_LINE_DC); typedef uint64_t (*func_mysqlnd_res__num_rows)(const MYSQLND_RES * const result); -- 2.40.0