summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mysqli/mysqli_api.c')
-rw-r--r--ext/mysqli/mysqli_api.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index 509fa81ee9..a2f1ab2b85 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -749,8 +749,10 @@ PHP_FUNCTION(mysqli_stmt_execute)
switch (stmt->stmt->params[i].buffer_type) {
case MYSQL_TYPE_VAR_STRING:
if (UG(unicode) && Z_TYPE_P(the_var) == IS_UNICODE) {
- php_mysqli_stmt_copy_it(&copies, stmt->param.vars[i], stmt->param.var_cnt, i);
- the_var = copies[i];
+ if (the_var == stmt->param.vars[i]) {
+ php_mysqli_stmt_copy_it(&copies, stmt->param.vars[i], stmt->param.var_cnt, i);
+ the_var = copies[i];
+ }
zval_unicode_to_string_ex(the_var, UG(utf8_conv) TSRMLS_CC);
} else {
if (the_var == stmt->param.vars[i] && Z_TYPE_P(stmt->param.vars[i]) != IS_STRING) {