to losing precision we need second variable. Conversion to double is to see if
value is too big for a long. As said, precision could be lost.
*/
- zval tmp_data_copy;
- ZVAL_COPY(&tmp_data_copy, tmp_data);
- convert_to_double_ex(&tmp_data_copy);
+ double d = zval_get_double(tmp_data);
/*
if it doesn't fit in a long send it as a string.
Check bug #52891 : Wrong data inserted with mysqli/mysqlnd when using bind_param, value > LONG_MAX
We do transformation here, which will be used later when sending types. The code later relies on this.
*/
- if (Z_DVAL(tmp_data_copy) > ZEND_LONG_MAX || Z_DVAL(tmp_data_copy) < ZEND_LONG_MIN) {
+ if (d > ZEND_LONG_MAX || d < ZEND_LONG_MIN) {
stmt->send_types_to_server = *resend_types_next_time = 1;
convert_to_string_ex(tmp_data);
} else {
- convert_to_long_ex(tmp_data);
+ convert_to_long(tmp_data);
}
-
- zval_ptr_dtor(&tmp_data_copy);
}
}
}
}
intern = Z_XSL_P(id);
if ((value = zend_hash_find(intern->parameter, name)) != NULL) {
- convert_to_string_ex(value);
- RETURN_STR_COPY(Z_STR_P(value));
+ RETURN_STR(zval_get_string(value));
} else {
RETURN_FALSE;
}