Commit 08e10a97 authored by venu@myvenu.com's avatar venu@myvenu.com

Added mysql_fetch_column function

Added MYSQL_TYPE_NULL as a dummy bind case for fetch buffers
Fix for offset based re-fetch using mysql_fetch_column
Misc cleanups for ODBC compatibility
parent 55f2e018
...@@ -509,12 +509,15 @@ typedef struct st_mysql_bind ...@@ -509,12 +509,15 @@ typedef struct st_mysql_bind
my_bool *is_null; /* Pointer to null indicators */ my_bool *is_null; /* Pointer to null indicators */
char *buffer; /* buffer to get/put data */ char *buffer; /* buffer to get/put data */
enum enum_field_types buffer_type; /* buffer type */ enum enum_field_types buffer_type; /* buffer type */
/* Must be set for string/blob data */ unsigned long buffer_length; /* buffer length, must be set for str/binary */
unsigned long buffer_length; /* buffer length */
/* The following are for internal use. Set by mysql_bind_param */ /* Following are for internal use. Set by mysql_bind_param */
unsigned char *inter_buffer; /* for the current data position */
unsigned long offset; /* offset position for char/binary fetch */
unsigned int param_number; /* For null count and error messages */ unsigned int param_number; /* For null count and error messages */
my_bool long_data_used; /* If used with mysql_send_long_data */ my_bool long_data_used; /* If used with mysql_send_long_data */
my_bool binary_data; /* data buffer is binary */
my_bool null_field; /* NULL data cache flag */
void (*store_param_func)(NET *net, struct st_mysql_bind *param); void (*store_param_func)(NET *net, struct st_mysql_bind *param);
void (*fetch_result)(struct st_mysql_bind *, unsigned char **row); void (*fetch_result)(struct st_mysql_bind *, unsigned char **row);
} MYSQL_BIND; } MYSQL_BIND;
...@@ -529,8 +532,11 @@ typedef struct st_mysql_stmt ...@@ -529,8 +532,11 @@ typedef struct st_mysql_stmt
MYSQL_BIND *bind; /* row binding */ MYSQL_BIND *bind; /* row binding */
MYSQL_FIELD *fields; /* prepare meta info */ MYSQL_FIELD *fields; /* prepare meta info */
LIST list; /* list to keep track of all stmts */ LIST list; /* list to keep track of all stmts */
unsigned char *current_row; /* unbuffered row */
unsigned char *last_fetched_buffer; /* last fetched column buffer */
char *query; /* query buffer */ char *query; /* query buffer */
MEM_ROOT mem_root; /* root allocations */ MEM_ROOT mem_root; /* root allocations */
my_ulonglong last_fetched_column; /* last fetched column */
unsigned long param_count; /* parameters count */ unsigned long param_count; /* parameters count */
unsigned long field_count; /* fields count */ unsigned long field_count; /* fields count */
unsigned long stmt_id; /* Id for prepared statement */ unsigned long stmt_id; /* Id for prepared statement */
...@@ -558,6 +564,9 @@ my_bool STDCALL mysql_commit(MYSQL * mysql); ...@@ -558,6 +564,9 @@ my_bool STDCALL mysql_commit(MYSQL * mysql);
my_bool STDCALL mysql_rollback(MYSQL * mysql); my_bool STDCALL mysql_rollback(MYSQL * mysql);
my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode); my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode);
int STDCALL mysql_fetch(MYSQL_STMT *stmt); int STDCALL mysql_fetch(MYSQL_STMT *stmt);
int STDCALL mysql_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind,
my_ulonglong column,
unsigned long offset);
my_bool STDCALL mysql_send_long_data(MYSQL_STMT *stmt, my_bool STDCALL mysql_send_long_data(MYSQL_STMT *stmt,
unsigned int param_number, unsigned int param_number,
const char *data, const char *data,
......
This diff is collapsed.
...@@ -112,13 +112,22 @@ EXPORTS ...@@ -112,13 +112,22 @@ EXPORTS
mysql_param_count mysql_param_count
mysql_bind_param mysql_bind_param
mysql_bind_result mysql_bind_result
mysql_param_result
mysql_prepare_result mysql_prepare_result
mysql_stmt_close mysql_stmt_close
mysql_stmt_error mysql_stmt_error
mysql_stmt_errno mysql_stmt_errno
mysql_fetch mysql_fetch
mysql_fetch_column
mysql_send_long_data mysql_send_long_data
mysql_next_result mysql_next_result
mysql_stmt_affected_rows
mysql_stmt_store_result
mysql_stmt_data_seek
mysql_stmt_row_seek
mysql_stmt_row_tell
mysql_stmt_num_rows
mysql_more_results
mysql_commit mysql_commit
mysql_rollback mysql_rollback
mysql_autocommit mysql_autocommit
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment