]> granicus.if.org Git - php/commitdiff
Fix ZTS build
authorAndrey Hristov <andrey@php.net>
Wed, 30 Sep 2009 23:34:56 +0000 (23:34 +0000)
committerAndrey Hristov <andrey@php.net>
Wed, 30 Sep 2009 23:34:56 +0000 (23:34 +0000)
ext/mysqlnd/mysqlnd.h
ext/mysqlnd/mysqlnd_ps.c
ext/mysqlnd/mysqlnd_ps_codec.c
ext/mysqlnd/mysqlnd_structs.h
ext/mysqlnd/mysqlnd_wireprotocol.c

index 2d9a38420b831438e04fcffe9b67cd73979744e3..4d7dbbdf0c74086c1545634b495bf1e68dee5fcb 100644 (file)
@@ -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);
index befaf9ee4b00251a337b675a08e91e2972642222..a980e960afc94cde47757199842b5c4a39c3a4ef 100644 (file)
@@ -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);
 }
index b8aa80cd7da8e89f8bb6cfe681d98a7d74253eae..ec1e05e9a78480e22ca35c6e8d57355b8da8609c 100644 (file)
@@ -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
index ddb7b40da6a80095be49285d6a600b549aef0126..9612fa3fce9369fa716ef96b747c2fcd85face2b 100644 (file)
@@ -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;
 };
index 207dcbcbacebb174ebb708345a584774e4e23403..cc0697cd0b0280f01951596f37e8c3f029db1c9b 100644 (file)
@@ -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");