]> granicus.if.org Git - php/commitdiff
Two functions, which should be methods so one can catch
authorAndrey Hristov <andrey@php.net>
Thu, 24 Jun 2010 19:52:13 +0000 (19:52 +0000)
committerAndrey Hristov <andrey@php.net>
Thu, 24 Jun 2010 19:52:13 +0000 (19:52 +0000)
their output, for example

ext/mysqlnd/mysqlnd_ps.c
ext/mysqlnd/mysqlnd_ps_codec.c
ext/mysqlnd/mysqlnd_structs.h

index c6463cb5d3e64f5d52b85ffad26cc347c27f5cfd..a6f2b33c7aaf367bd99fcfc21b731a4a8a8848c3 100644 (file)
@@ -39,10 +39,7 @@ const char * const mysqlnd_stmt_not_prepared = "Statement not prepared";
 static struct st_mysqlnd_stmt_methods *mysqlnd_stmt_methods;
 
 /* Exported by mysqlnd_ps_codec.c */
-enum_func_status mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC);
-
-
-MYSQLND_RES * _mysqlnd_stmt_use_result(MYSQLND_STMT *stmt TSRMLS_DC);
+enum_func_status mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC);
 
 enum_func_status mysqlnd_fetch_stmt_row_buffered(MYSQLND_RES *result, void *param,
                                                                                                unsigned int flags,
@@ -56,7 +53,6 @@ static void mysqlnd_stmt_separate_result_bind(MYSQLND_STMT * const stmt TSRMLS_D
 static void mysqlnd_stmt_separate_one_result_bind(MYSQLND_STMT * const stmt, unsigned int param_no TSRMLS_DC);
 
 static void mysqlnd_internal_free_stmt_content(MYSQLND_STMT * const stmt TSRMLS_DC);
-static enum_func_status mysqlnd_stmt_execute_parse_response(MYSQLND_STMT * const stmt TSRMLS_DC);
 
 /* {{{ mysqlnd_stmt::store_result */
 static MYSQLND_RES *
@@ -234,7 +230,7 @@ MYSQLND_METHOD(mysqlnd_stmt, next_result)(MYSQLND_STMT * s TSRMLS_DC)
        /* Free space for next result */
        mysqlnd_internal_free_stmt_content(s TSRMLS_CC);
 
-       DBG_RETURN(mysqlnd_stmt_execute_parse_response(s TSRMLS_CC));
+       DBG_RETURN(s->m->parse_execute_response(s TSRMLS_CC));
 }
 /* }}} */
 
@@ -671,7 +667,7 @@ MYSQLND_METHOD(mysqlnd_stmt, execute)(MYSQLND_STMT * const s TSRMLS_DC)
                        DBG_RETURN(FAIL);
                }
        }
-       ret = mysqlnd_stmt_execute_generate_request(s, &request, &request_len, &free_request TSRMLS_CC);
+       ret = s->m->generate_execute_request(s, &request, &request_len, &free_request TSRMLS_CC);
        if (ret == PASS) {
                /* support for buffer types should be added here ! */
                ret = stmt->conn->m->simple_command(stmt->conn, COM_STMT_EXECUTE, (char *)request, request_len,
@@ -692,7 +688,7 @@ MYSQLND_METHOD(mysqlnd_stmt, execute)(MYSQLND_STMT * const s TSRMLS_DC)
        }
        stmt->execute_count++;
 
-       ret = mysqlnd_stmt_execute_parse_response(s TSRMLS_CC);
+       ret = s->m->parse_execute_response(s TSRMLS_CC);
 
        if (ret == PASS && conn->last_query_type == QUERY_UPSERT && stmt->upsert_status.affected_rows) {
                MYSQLND_INC_CONN_STATISTIC_W_VALUE(conn->stats, STAT_ROWS_AFFECTED_PS, stmt->upsert_status.affected_rows);
@@ -2320,7 +2316,9 @@ MYSQLND_CLASS_METHODS_START(mysqlnd_stmt)
        MYSQLND_METHOD(mysqlnd_stmt, alloc_result_bind),
        MYSQLND_METHOD(mysqlnd_stmt, free_parameter_bind),
        MYSQLND_METHOD(mysqlnd_stmt, free_result_bind),
-       MYSQLND_METHOD(mysqlnd_stmt, server_status)
+       MYSQLND_METHOD(mysqlnd_stmt, server_status),
+       mysqlnd_stmt_execute_generate_request,
+       mysqlnd_stmt_execute_parse_response
 MYSQLND_CLASS_METHODS_END;
 
 
index c9308a1b292079c9f3b2697bf51785a2eacb0d90..673cfacb5a87241febc2d487e216be44009f4b8c 100644 (file)
@@ -825,7 +825,7 @@ end:
 
 /* {{{ mysqlnd_stmt_execute_generate_request */
 enum_func_status
-mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC)
+mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC)
 {
        MYSQLND_STMT_DATA * stmt = s->data;
        zend_uchar      *p = stmt->execute_cmd_buffer.buffer,
index 21780e51c502a7b9d314fdf5481087a755404683..6f74faf2ab0fa9e8c0a2c8324c93ac4c9e6f485a 100644 (file)
@@ -623,6 +623,8 @@ typedef MYSQLND_RESULT_BIND*(*func_mysqlnd_stmt__alloc_result_bind)(MYSQLND_STMT
 typedef        void                            (*func_mysqlnd_stmt__free_parameter_bind)(MYSQLND_STMT * const stmt, MYSQLND_PARAM_BIND * TSRMLS_DC);
 typedef        void                            (*func_mysqlnd_stmt__free_result_bind)(MYSQLND_STMT * const stmt, MYSQLND_RESULT_BIND * TSRMLS_DC);
 typedef unsigned int           (*func_mysqlnd_stmt__server_status)(const MYSQLND_STMT * const stmt TSRMLS_DC);
+typedef enum_func_status       (*func_mysqlnd_stmt__generate_execute_request)(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC);
+typedef enum_func_status       (*func_mysqlnd_stmt__parse_execute_response)(MYSQLND_STMT * const s TSRMLS_DC);
 
 struct st_mysqlnd_stmt_methods
 {
@@ -671,6 +673,9 @@ struct st_mysqlnd_stmt_methods
        func_mysqlnd_stmt__free_result_bind free_result_bind;
 
        func_mysqlnd_stmt__server_status get_server_status;
+
+       func_mysqlnd_stmt__generate_execute_request generate_execute_request;
+       func_mysqlnd_stmt__parse_execute_response parse_execute_response;
 };