]> granicus.if.org Git - php/commitdiff
Fix a bug that let PDO fail. It has been long fixed, but locally. Now I know
authorAndrey Hristov <andrey@php.net>
Thu, 29 May 2008 15:49:32 +0000 (15:49 +0000)
committerAndrey Hristov <andrey@php.net>
Thu, 29 May 2008 15:49:32 +0000 (15:49 +0000)
what it fixes :)

ext/mysqlnd/mysqlnd_result.c

index 7b5f3d6af4365dfc4454c2678d2936b79107f20b..6b94e2ca9231b0db2b6c4ae1a82fd2cf3a0beb38 100644 (file)
@@ -521,8 +521,8 @@ mysqlnd_query_read_result_set_header(MYSQLND *conn, MYSQLND_STMT *stmt TSRMLS_DC
                                conn->last_query_type = QUERY_SELECT;
                                CONN_SET_STATE(conn, CONN_FETCHING_DATA);
                                /* PS has already allocated it */
+                               conn->field_count = rset_header.field_count;
                                if (!stmt) {
-                                       conn->field_count = rset_header.field_count;
                                        result =
                                                conn->current_result=
                                                        mysqlnd_result_init(rset_header.field_count,
@@ -536,7 +536,6 @@ mysqlnd_query_read_result_set_header(MYSQLND *conn, MYSQLND_STMT *stmt TSRMLS_DC
                                                  prepared statements can't send result set metadata for these queries
                                                  on prepare stage. Read it now.
                                                */
-                                               conn->field_count = rset_header.field_count;
                                                result =
                                                        stmt->result =
                                                                mysqlnd_result_init(rset_header.field_count,