1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 17:38:14 +02:00

MFH: Fixed type conversion for NULL values in mysql_stmt_execute

This commit is contained in:
Georg Richter
2004-12-20 16:42:20 +00:00
parent 3ed65da8cb
commit 001a3117ac
2 changed files with 20 additions and 19 deletions
+1
View File
@@ -1,6 +1,7 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2005, PHP 5.0.4
- Fixed a bug in mysql_stmt_execute (type conversion with NULL values). (Georg)
- Fixed bug #31139 (XML Parser Functions seem to drop & when parsing). (Rob)
- Fixed bug #31111 (Compile failure of zend_strtod.c). (Derick)
- Fixed bug #31110 (PHP 4.3.10 does not compile on Tru64 UNIX 5.1B). (Derick)
+19 -19
View File
@@ -540,25 +540,25 @@ PHP_FUNCTION(mysqli_stmt_execute)
for (i = 0; i < stmt->param.var_cnt; i++) {
if (stmt->param.vars[i]) {
stmt->param.is_null[i] = (stmt->param.vars[i]->type == IS_NULL);
switch (stmt->stmt->params[i].buffer_type) {
case MYSQL_TYPE_VAR_STRING:
convert_to_string_ex(&stmt->param.vars[i]);
stmt->stmt->params[i].buffer = Z_STRVAL_PP(&stmt->param.vars[i]);
stmt->stmt->params[i].buffer_length = strlen(Z_STRVAL_PP(&stmt->param.vars[i]));
break;
case MYSQL_TYPE_DOUBLE:
convert_to_double_ex(&stmt->param.vars[i]);
stmt->stmt->params[i].buffer = (gptr)&Z_LVAL_PP(&stmt->param.vars[i]);
break;
case MYSQL_TYPE_LONG:
convert_to_long_ex(&stmt->param.vars[i]);
stmt->stmt->params[i].buffer = (gptr)&Z_LVAL_PP(&stmt->param.vars[i]);
break;
default:
break;
}
if ( !(stmt->param.is_null[i] = (stmt->param.vars[i]->type == IS_NULL)) ) {
switch (stmt->stmt->params[i].buffer_type) {
case MYSQL_TYPE_VAR_STRING:
convert_to_string_ex(&stmt->param.vars[i]);
stmt->stmt->params[i].buffer = Z_STRVAL_PP(&stmt->param.vars[i]);
stmt->stmt->params[i].buffer_length = strlen(Z_STRVAL_PP(&stmt->param.vars[i]));
break;
case MYSQL_TYPE_DOUBLE:
convert_to_double_ex(&stmt->param.vars[i]);
stmt->stmt->params[i].buffer = (gptr)&Z_LVAL_PP(&stmt->param.vars[i]);
break;
case MYSQL_TYPE_LONG:
convert_to_long_ex(&stmt->param.vars[i]);
stmt->stmt->params[i].buffer = (gptr)&Z_LVAL_PP(&stmt->param.vars[i]);
break;
default:
break;
}
}
}
}
if (mysql_stmt_execute(stmt->stmt)) {