fetch(); <-- no binding, but that's not a problem
bind_result();
execute(); <-- here we will leak because we separate without need
- */
unsigned int i;
for (i = 0; i < stmt->field_count; i++) {
if (stmt->result_bind[i].bound == TRUE) {
zval_copy_ctor(&stmt->result_bind[i].zv);
}
}
+ */
}
#endif
for (i = 0; i < result->field_count; i++) {
/* Clean what we copied last time */
#ifndef WE_DONT_COPY_IN_BUFFERED_AND_UNBUFFERED_BECAUSEOF_IS_REF
- zval_dtor(&stmt->result_bind[i].zv);
+ zval_dtor(Z_REFVAL(stmt->result_bind[i].zv));
#endif
/* copy the type */
if (stmt->result_bind[i].bound == TRUE) {
counting the user can't delete the strings the variables point to.
*/
- ZVAL_COPY_VALUE(&stmt->result_bind[i].zv, ¤t_row[i]);
+ ZVAL_COPY_VALUE(Z_REFVAL(stmt->result_bind[i].zv), ¤t_row[i]);
#ifndef WE_DONT_COPY_IN_BUFFERED_AND_UNBUFFERED_BECAUSEOF_IS_REF
- zval_copy_ctor(&stmt->result_bind[i].zv);
+ zval_copy_ctor(Z_REFVAL(stmt->result_bind[i].zv));
#endif
} else {
- ZVAL_NULL(&stmt->result_bind[i].zv);
+ ZVAL_NULL(Z_REFVAL(stmt->result_bind[i].zv));
}
}
}
in result->unbuf->m.free_last_data()
*/
#ifndef WE_DONT_COPY_IN_BUFFERED_AND_UNBUFFERED_BECAUSEOF_IS_REF
- zval_dtor(&stmt->result_bind[i].zv);
+ zval_dtor(Z_REFVAL(stmt->result_bind[i].zv));
#endif
if (!Z_ISNULL_P(data)) {
if ((Z_TYPE_P(data) == IS_STRING) &&
(meta->fields[i].max_length < (unsigned long) Z_STRLEN_P(data))) {
meta->fields[i].max_length = Z_STRLEN_P(data);
}
- ZVAL_COPY_VALUE(&stmt->result_bind[i].zv, data);
+ ZVAL_COPY_VALUE(Z_REFVAL(stmt->result_bind[i].zv), data);
/* copied data, thus also the ownership. Thus null data */
ZVAL_NULL(data);
}
in result->unbuf->m.free_last_data()
*/
#ifndef WE_DONT_COPY_IN_BUFFERED_AND_UNBUFFERED_BECAUSEOF_IS_REF
- zval_dtor(&stmt->result_bind[i].zv);
+ zval_dtor(Z_REFVAL(stmt->result_bind[i].zv));
#endif
DBG_INF_FMT("i=%u bound_var=%p type=%u refc=%u", i, &stmt->result_bind[i].zv,
Z_TYPE_P(data), Z_REFCOUNTED(stmt->result_bind[i].zv)?
(meta->fields[i].max_length < (unsigned long) Z_STRLEN_P(data))) {
meta->fields[i].max_length = Z_STRLEN_P(data);
}
- ZVAL_COPY_VALUE(&stmt->result_bind[i].zv, data);
+ ZVAL_COPY_VALUE(Z_REFVAL(stmt->result_bind[i].zv), data);
/* copied data, thus also the ownership. Thus null data */
ZVAL_NULL(data);
}
*copies = mnd_ecalloc(param_count, sizeof(zval));
}
if (*copies) {
+ ZVAL_DEREF(original);
ZVAL_COPY(&(*copies)[current], original);
//????Z_SET_REFCOUNT_P((*copies)[current], 1);
//zval_copy_ctor((*copies)[current]);
value is too big for a long. As said, precision could be lost.
*/
zval tmp_data_copy;
+ ZVAL_DEREF(tmp_data);
ZVAL_COPY(&tmp_data_copy, tmp_data);
convert_to_double_ex(&tmp_data_copy);