summaryrefslogtreecommitdiff
path: root/ext/pdo_mysql/mysql_statement.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2010-03-16 12:36:57 +0000
committerAndrey Hristov <andrey@php.net>2010-03-16 12:36:57 +0000
commit7496cc761ea31bfae22842811020039d1ea25030 (patch)
treef1062c57ceefa6c55b062cc435c60fb352555249 /ext/pdo_mysql/mysql_statement.c
parentda538251c17e6ad8609f9c6c11388c8dcae4db3c (diff)
downloadphp-git-7496cc761ea31bfae22842811020039d1ea25030.tar.gz
decouple the methods in MYSQLND_STMT from the data,
needed to move to a new structure MYSQLND_STMT. Makes the code cleaner and less error-prone. Also fix PDO/MySQL which directly touch mysqlnd internals instead of using API calls.
Diffstat (limited to 'ext/pdo_mysql/mysql_statement.c')
-rwxr-xr-xext/pdo_mysql/mysql_statement.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c
index d8d40edb3e..22b3474b0f 100755
--- a/ext/pdo_mysql/mysql_statement.c
+++ b/ext/pdo_mysql/mysql_statement.c
@@ -264,7 +264,7 @@ static int pdo_mysql_stmt_execute_prepared_mysqlnd(pdo_stmt_t *stmt TSRMLS_DC) /
}
/* for SHOW/DESCRIBE and others the column/field count is not available before execute */
- stmt->column_count = S->stmt->field_count;
+ stmt->column_count = mysql_stmt_field_count(S->stmt);
for (i = 0; i < stmt->column_count; i++) {
mysqlnd_stmt_bind_one_result(S->stmt, i);
}
@@ -376,7 +376,7 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
/* for SHOW/DESCRIBE and others the column/field count is not available before execute */
int i;
- stmt->column_count = S->stmt->field_count;
+ stmt->column_count = mysql_stmt_field_count(S->stmt);
for (i = 0; i < stmt->column_count; i++) {
mysqlnd_stmt_bind_one_result(S->stmt, i);
}
@@ -745,8 +745,8 @@ static int pdo_mysql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, unsig
}
#if PDO_USE_MYSQLND
if (S->stmt) {
- Z_ADDREF_P(S->stmt->result_bind[colno].zv);
- *ptr = (char*)&S->stmt->result_bind[colno].zv;
+ Z_ADDREF_P(S->stmt->data->result_bind[colno].zv);
+ *ptr = (char*)&S->stmt->data->result_bind[colno].zv;
*len = sizeof(zval);
PDO_DBG_RETURN(1);
}