/*****************************************************************************************************/
-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);
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);
}
}
}
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);
}
}
/* {{{ 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);
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);
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);
/* {{{ 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);
}
}
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;
}
}
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;
}
/* {{{ 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);
}
/* {{{ 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);
}
/* {{{ 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 *));
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;
}
}
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;
#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;
#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
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);
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;
};
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");