summaryrefslogtreecommitdiff
path: root/ext/pdo_mysql/mysql_statement.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2005-07-10 02:58:51 +0000
committerAndrey Hristov <andrey@php.net>2005-07-10 02:58:51 +0000
commit31de8e901822ab87aceb451f5066715f0ad7d027 (patch)
tree7c4bad99b623d4496e54b62d2a9c2604b5ddf423 /ext/pdo_mysql/mysql_statement.c
parent55ab9b75a689d26f5c8d9c628ec390921a0754ef (diff)
downloadphp-git-31de8e901822ab87aceb451f5066715f0ad7d027.tar.gz
stmt->column_count is set only if the result has been already bound, don't
rely on that and use the real count which is kept in st_mysql_stmt #of course using internal values is bad idea but the comment already says #that this should be fixed
Diffstat (limited to 'ext/pdo_mysql/mysql_statement.c')
-rwxr-xr-xext/pdo_mysql/mysql_statement.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c
index bfade370fb..0051313b71 100755
--- a/ext/pdo_mysql/mysql_statement.c
+++ b/ext/pdo_mysql/mysql_statement.c
@@ -96,11 +96,11 @@ static int pdo_mysql_stmt_execute(pdo_stmt_t *stmt TSRMLS_DC)
my_bool on = 1;
/* if we have bound the buffers don't set the attribute again */
if (!S->result) {
- for (i= 0; i < stmt->column_count; i++) {
- /*
- FIXME: using directly internal structs - but for now cleaner
- then calling 2 times result_metadata.
- */
+ /*
+ FIXME: using directly internal structs - but for now cleaner
+ then calling 2 times result_metadata.
+ */
+ for (i= 0; i < S->stmt->field_count; i++) {
switch (S->fields[i].type) {
case MYSQL_TYPE_MEDIUM_BLOB:
case MYSQL_TYPE_LONG_BLOB: