mysql.h

1、select返回的结果集:
typedef struct st_mysql_res {
my_ulonglong row_count; //行数
MYSQL_FIELD *fields; //列信息指针
MYSQL_DATA *data;
MYSQL_ROWS *data_cursor; //行指针
unsigned long lengths; / column lengths of current row */
MYSQL handle; / for unbuffered reads */
const struct st_mysql_methods *methods;
MYSQL_ROW row; /* If unbuffered read */
MYSQL_ROW current_row; /* buffer to current row */
MEM_ROOT field_alloc;
unsigned int field_count, current_field; //列数
my_bool eof; /* Used by mysql_fetch_row */
/* mysql_stmt_close() had to cancel this result */
my_bool unbuffered_fetch_cancelled;
void *extension;
} MYSQL_RES;
2、列信息:
typedef struct st_mysql_field {
char name; / Name of column */
char org_name; / Original column name, if an alias */
char table; / Table of column if column was a field */ //返回表名
char org_table; / Org table name, if table was an alias */
char db; / Database for table */
char catalog; / Catalog for table */
char def; / Default value (set by mysql_list_fields) */
unsigned long length; /* Width of column (create length) */
unsigned long max_length; /* Max width for selected set */
unsigned int name_length;
unsigned int org_name_length;
unsigned int table_length;
unsigned int org_table_length;
unsigned int db_length;
unsigned int catalog_length;
unsigned int def_length;
unsigned int flags; /* Div flags */
unsigned int decimals; /* Number of decimals in field */
unsigned int charsetnr; /* Character set */
enum enum_field_types type; /* Type of field. See mysql_com.h for types */
void *extension;
} MYSQL_FIELD;
3、数据集:
typedef struct st_mysql_data {
MYSQL_ROWS *data;
struct embedded_query_result *embedded_info;
MEM_ROOT alloc;
my_ulonglong rows;
unsigned int fields;
/* extra info for embedded library */
void *extension;
} MYSQL_DATA;
4、行链表:
typedef struct st_mysql_rows {
struct st_mysql_rows next; / list of rows */
MYSQL_ROW data; // typedef char **MYSQL_ROW;
unsigned long length;
} MYSQL_ROWS;

猜你喜欢

转载自blog.csdn.net/misterfm/article/details/80383479