summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Richter <georg@php.net>2003-02-14 16:31:51 +0000
committerGeorg Richter <georg@php.net>2003-02-14 16:31:51 +0000
commit14bc73defe061c98431fb0f67ce06fcb4389f592 (patch)
treecd2cf3746a42425a4357c3a0fb4f4a26763cde4f
parent1a7a41cf9f4eddcc7a9898b06defa2cb4f9b2edb (diff)
downloadphp-git-14bc73defe061c98431fb0f67ce06fcb4389f592.tar.gz
bind_result fix
-rw-r--r--ext/mysqli/mysqli_api.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index 99f2729f8c..8219d170b8 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -282,12 +282,12 @@ PHP_FUNCTION(mysqli_bind_result)
case MYSQL_TYPE_LONGLONG:
stmt->bind[ofs].type = IS_STRING;
- stmt->bind[ofs].buflen = (stmt->stmt->fields) ? stmt->stmt->fields[ofs].length + 1 : 256;
+ stmt->bind[ofs].buflen = sizeof(my_ulonglong);
stmt->bind[ofs].buffer = (char *)emalloc(stmt->bind[ofs].buflen);
bind[ofs].buffer_type = MYSQL_TYPE_LONGLONG;
bind[ofs].buffer = stmt->bind[ofs].buffer;
bind[ofs].is_null = &stmt->is_null[ofs];
- bind[ofs].buffer_length = stmt->bind[ofs].buflen - 1;
+ bind[ofs].buffer_length = stmt->bind[ofs].buflen;
break;
case MYSQL_TYPE_DATE:
case MYSQL_TYPE_TIME:
@@ -298,15 +298,16 @@ PHP_FUNCTION(mysqli_bind_result)
case MYSQL_TYPE_BLOB:
case MYSQL_TYPE_TIMESTAMP:
stmt->bind[ofs].type = IS_STRING;
- stmt->bind[ofs].buflen = (stmt->stmt->fields) ? stmt->stmt->fields[ofs].length + 1: 256;
+ stmt->bind[ofs].buflen = (stmt->stmt->fields) ? stmt->stmt->fields[ofs].length + 1: 250;
stmt->bind[ofs].buffer = (char *)emalloc(stmt->bind[ofs].buflen);
bind[ofs].buffer_type = MYSQL_TYPE_STRING;
bind[ofs].buffer = stmt->bind[ofs].buffer;
bind[ofs].is_null = &stmt->is_null[ofs];
bind[ofs].buffer_length = stmt->bind[ofs].buflen;
+ bind[ofs].length = &stmt->bind[ofs].buflen;
break;
}
- bind[ofs].length = &stmt->bind[ofs].buflen;
+// bind[ofs].length = &stmt->bind[ofs].buflen;
}
if (mysql_bind_result(stmt->stmt, bind)) {