From 2f81bcd44bf57126300a6e125d39365158f27d2c Mon Sep 17 00:00:00 2001 From: Andrey Hristov Date: Wed, 30 Sep 2009 23:34:56 +0000 Subject: [PATCH] Fix ZTS build --- ext/mysqlnd/mysqlnd.h | 4 ++-- ext/mysqlnd/mysqlnd_ps.c | 20 ++++++++++---------- ext/mysqlnd/mysqlnd_ps_codec.c | 10 +++++----- ext/mysqlnd/mysqlnd_structs.h | 8 ++++---- ext/mysqlnd/mysqlnd_wireprotocol.c | 2 ++ 5 files changed, 23 insertions(+), 21 deletions(-) diff --git a/ext/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h index b85a1380dc..5da8819837 100644 --- a/ext/mysqlnd/mysqlnd.h +++ b/ext/mysqlnd/mysqlnd.h @@ -228,8 +228,8 @@ PHPAPI unsigned int mysqlnd_get_client_version(); /*****************************************************************************************************/ -PHPAPI void mysqlnd_efree_param_bind_dtor(MYSQLND_PARAM_BIND * param_bind); -PHPAPI void mysqlnd_efree_result_bind_dtor(MYSQLND_RESULT_BIND * result_bind); +PHPAPI void mysqlnd_efree_param_bind_dtor(MYSQLND_PARAM_BIND * param_bind TSRMLS_DC); +PHPAPI void mysqlnd_efree_result_bind_dtor(MYSQLND_RESULT_BIND * result_bind TSRMLS_DC); PHPAPI const char * mysqlnd_field_type_name(enum mysqlnd_field_types field_type); diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c index befaf9ee4b..a980e960af 100644 --- a/ext/mysqlnd/mysqlnd_ps.c +++ b/ext/mysqlnd/mysqlnd_ps.c @@ -1329,7 +1329,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_parameters)(MYSQLND_STMT * const stmt, SET_STMT_ERROR(stmt, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared); DBG_ERR("not prepared"); if (param_bind && stmt->param_bind_dtor) { - stmt->param_bind_dtor(param_bind); + stmt->param_bind_dtor(param_bind TSRMLS_CC); } DBG_RETURN(FAIL); } @@ -1362,7 +1362,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_parameters)(MYSQLND_STMT * const stmt, } } if (stmt->param_bind != param_bind && stmt->param_bind_dtor) { - stmt->param_bind_dtor(stmt->param_bind); + stmt->param_bind_dtor(stmt->param_bind TSRMLS_CC); } } @@ -1465,7 +1465,7 @@ MYSQLND_METHOD(mysqlnd_stmt, refresh_bind_param)(MYSQLND_STMT * const stmt TSRML /* {{{ mysqlnd_stmt::set_bind_param_dtor */ static void MYSQLND_METHOD(mysqlnd_stmt, set_param_bind_dtor)(MYSQLND_STMT * const stmt, - void (*param_bind_dtor)(MYSQLND_PARAM_BIND *dtor) TSRMLS_DC) + void (*param_bind_dtor)(MYSQLND_PARAM_BIND * dtor TSRMLS_DC) TSRMLS_DC) { DBG_ENTER("mysqlnd_stmt::set_bind_param_dtor"); DBG_INF_FMT("stmt=%p", param_bind_dtor); @@ -1487,7 +1487,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_result)(MYSQLND_STMT * const stmt, if (stmt->state < MYSQLND_STMT_PREPARED) { SET_STMT_ERROR(stmt, CR_NO_PREPARE_STMT, UNKNOWN_SQLSTATE, mysqlnd_stmt_not_prepared); if (result_bind && stmt->result_bind_dtor) { - stmt->result_bind_dtor(result_bind); + stmt->result_bind_dtor(result_bind TSRMLS_CC); } DBG_ERR("not prepared"); DBG_RETURN(FAIL); @@ -1519,7 +1519,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_result)(MYSQLND_STMT * const stmt, stmt->result_bind[i].bound = TRUE; } } else if (result_bind && stmt->result_bind_dtor) { - stmt->result_bind_dtor(result_bind); + stmt->result_bind_dtor(result_bind TSRMLS_CC); } DBG_INF("PASS"); DBG_RETURN(PASS); @@ -1574,7 +1574,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_one_result)(MYSQLND_STMT * const stmt, unsigne /* {{{ mysqlnd_stmt::set_bind_result_dtor */ static void MYSQLND_METHOD(mysqlnd_stmt, set_result_bind_dtor)(MYSQLND_STMT * const stmt, - void (*result_bind_dtor)(MYSQLND_RESULT_BIND *dtor) TSRMLS_DC) + void (*result_bind_dtor)(MYSQLND_RESULT_BIND * dtor TSRMLS_DC) TSRMLS_DC) { DBG_ENTER("mysqlnd_stmt::set_bind_param_dtor"); DBG_INF_FMT("stmt=%p", result_bind_dtor); @@ -1898,7 +1898,7 @@ void mysqlnd_stmt_separate_result_bind(MYSQLND_STMT * const stmt TSRMLS_DC) } } if (stmt->result_bind_dtor) { - stmt->result_bind_dtor(stmt->result_bind); + stmt->result_bind_dtor(stmt->result_bind TSRMLS_CC); } stmt->result_bind = NULL; @@ -1979,7 +1979,7 @@ void mysqlnd_internal_free_stmt_content(MYSQLND_STMT * const stmt TSRMLS_DC) } } if (stmt->param_bind_dtor) { - stmt->param_bind_dtor(stmt->param_bind); + stmt->param_bind_dtor(stmt->param_bind TSRMLS_CC); } stmt->param_bind = NULL; } @@ -2177,7 +2177,7 @@ MYSQLND_STMT * _mysqlnd_stmt_init(MYSQLND * const conn TSRMLS_DC) /* {{{ mysqlnd_efree_param_bind_dtor */ PHPAPI void -mysqlnd_efree_param_bind_dtor(MYSQLND_PARAM_BIND * param_bind) +mysqlnd_efree_param_bind_dtor(MYSQLND_PARAM_BIND * param_bind TSRMLS_DC) { mnd_efree(param_bind); } @@ -2186,7 +2186,7 @@ mysqlnd_efree_param_bind_dtor(MYSQLND_PARAM_BIND * param_bind) /* {{{ mysqlnd_efree_result_bind_dtor */ PHPAPI void -mysqlnd_efree_result_bind_dtor(MYSQLND_RESULT_BIND * result_bind) +mysqlnd_efree_result_bind_dtor(MYSQLND_RESULT_BIND * result_bind TSRMLS_DC) { mnd_efree(result_bind); } diff --git a/ext/mysqlnd/mysqlnd_ps_codec.c b/ext/mysqlnd/mysqlnd_ps_codec.c index b8aa80cd7d..ec1e05e9a7 100644 --- a/ext/mysqlnd/mysqlnd_ps_codec.c +++ b/ext/mysqlnd/mysqlnd_ps_codec.c @@ -580,7 +580,7 @@ void _mysqlnd_init_ps_fetch_subsystem() /* {{{ mysqlnd_stmt_copy_it */ static void -mysqlnd_stmt_copy_it(zval *** copies, zval *original, unsigned int param_count, unsigned int current) +mysqlnd_stmt_copy_it(zval *** copies, zval *original, unsigned int param_count, unsigned int current TSRMLS_DC) { if (!*copies) { *copies = mnd_ecalloc(param_count, sizeof(zval *)); @@ -643,7 +643,7 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT *stmt, zend_uchar **buf, zend_uch for (j = i + 1; j < stmt->param_count; j++) { if (stmt->param_bind[j].zv == the_var) { /* Double binding of the same zval, make a copy */ - mysqlnd_stmt_copy_it(&copies, the_var, stmt->param_count, i); + mysqlnd_stmt_copy_it(&copies, the_var, stmt->param_count, i TSRMLS_CC); break; } } @@ -653,7 +653,7 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT *stmt, zend_uchar **buf, zend_uch data_size += 8; if (Z_TYPE_P(the_var) != IS_DOUBLE) { if (!copies || !copies[i]) { - mysqlnd_stmt_copy_it(&copies, the_var, stmt->param_count, i); + mysqlnd_stmt_copy_it(&copies, the_var, stmt->param_count, i TSRMLS_CC); } } break; @@ -668,7 +668,7 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT *stmt, zend_uchar **buf, zend_uch #endif if (Z_TYPE_P(the_var) != IS_LONG) { if (!copies || !copies[i]) { - mysqlnd_stmt_copy_it(&copies, the_var, stmt->param_count, i); + mysqlnd_stmt_copy_it(&copies, the_var, stmt->param_count, i TSRMLS_CC); } } break; @@ -691,7 +691,7 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT *stmt, zend_uchar **buf, zend_uch #endif { if (!copies || !copies[i]) { - mysqlnd_stmt_copy_it(&copies, the_var, stmt->param_count, i); + mysqlnd_stmt_copy_it(&copies, the_var, stmt->param_count, i TSRMLS_CC); } the_var = copies[i]; #if PHP_MAJOR_VERSION >= 6 diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h index ddb7b40da6..9612fa3fce 100644 --- a/ext/mysqlnd/mysqlnd_structs.h +++ b/ext/mysqlnd/mysqlnd_structs.h @@ -360,10 +360,10 @@ struct st_mysqlnd_stmt_methods enum_func_status (*bind_parameters)(MYSQLND_STMT * const stmt, MYSQLND_PARAM_BIND * const param_bind TSRMLS_DC); enum_func_status (*bind_one_parameter)(MYSQLND_STMT * const stmt, unsigned int param_no, zval * const zv, zend_uchar type TSRMLS_DC); enum_func_status (*refresh_bind_param)(MYSQLND_STMT * const stmt TSRMLS_DC); - void (*set_param_bind_dtor)(MYSQLND_STMT * const stmt, void (*param_bind_dtor)(MYSQLND_PARAM_BIND *) TSRMLS_DC); + void (*set_param_bind_dtor)(MYSQLND_STMT * const stmt, void (*param_bind_dtor)(MYSQLND_PARAM_BIND * TSRMLS_DC) TSRMLS_DC); enum_func_status (*bind_result)(MYSQLND_STMT * const stmt, MYSQLND_RESULT_BIND * const result_bind TSRMLS_DC); enum_func_status (*bind_one_result)(MYSQLND_STMT * const stmt, unsigned int param_no TSRMLS_DC); - void (*set_result_bind_dtor)(MYSQLND_STMT * const stmt, void (*result_bind_dtor)(MYSQLND_RESULT_BIND *) TSRMLS_DC); + void (*set_result_bind_dtor)(MYSQLND_STMT * const stmt, void (*result_bind_dtor)(MYSQLND_RESULT_BIND * TSRMLS_DC) TSRMLS_DC); enum_func_status (*send_long_data)(MYSQLND_STMT * const stmt, unsigned int param_num, const char * const data, unsigned long length TSRMLS_DC); MYSQLND_RES * (*get_parameter_metadata)(MYSQLND_STMT * const stmt); @@ -625,8 +625,8 @@ struct st_mysqlnd_stmt MYSQLND_CMD_BUFFER execute_cmd_buffer; unsigned int execute_count;/* count how many times the stmt was executed */ - void (*param_bind_dtor)(MYSQLND_PARAM_BIND *); - void (*result_bind_dtor)(MYSQLND_RESULT_BIND *); + void (*param_bind_dtor)(MYSQLND_PARAM_BIND * TSRMLS_DC); + void (*result_bind_dtor)(MYSQLND_RESULT_BIND * TSRMLS_DC); struct st_mysqlnd_stmt_methods *m; }; diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c index 207dcbcbac..cc0697cd0b 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.c +++ b/ext/mysqlnd/mysqlnd_wireprotocol.c @@ -1373,8 +1373,10 @@ void php_mysqlnd_rowp_read_binary_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffe zend_uchar *null_ptr, bit; zval **current_field, **end_field, **start_field; zend_bool as_unicode = conn->options.numeric_and_datetime_as_unicode; +#ifdef USE_ZVAL_CACHE zend_bool allocated; void *obj; +#endif DBG_ENTER("php_mysqlnd_rowp_read_binary_protocol"); -- 2.40.0