📄 mysql_com.h
字号:
MYSQL_TYPE_BIT, MYSQL_TYPE_NEWDECIMAL=246, MYSQL_TYPE_ENUM=247, MYSQL_TYPE_SET=248, MYSQL_TYPE_TINY_BLOB=249, MYSQL_TYPE_MEDIUM_BLOB=250, MYSQL_TYPE_LONG_BLOB=251, MYSQL_TYPE_BLOB=252, MYSQL_TYPE_VAR_STRING=253, MYSQL_TYPE_STRING=254, MYSQL_TYPE_GEOMETRY=255};/* For backward compatibility */#define CLIENT_MULTI_QUERIES CLIENT_MULTI_STATEMENTS #define FIELD_TYPE_DECIMAL MYSQL_TYPE_DECIMAL#define FIELD_TYPE_NEWDECIMAL MYSQL_TYPE_NEWDECIMAL#define FIELD_TYPE_TINY MYSQL_TYPE_TINY#define FIELD_TYPE_SHORT MYSQL_TYPE_SHORT#define FIELD_TYPE_LONG MYSQL_TYPE_LONG#define FIELD_TYPE_FLOAT MYSQL_TYPE_FLOAT#define FIELD_TYPE_DOUBLE MYSQL_TYPE_DOUBLE#define FIELD_TYPE_NULL MYSQL_TYPE_NULL#define FIELD_TYPE_TIMESTAMP MYSQL_TYPE_TIMESTAMP#define FIELD_TYPE_LONGLONG MYSQL_TYPE_LONGLONG#define FIELD_TYPE_INT24 MYSQL_TYPE_INT24#define FIELD_TYPE_DATE MYSQL_TYPE_DATE#define FIELD_TYPE_TIME MYSQL_TYPE_TIME#define FIELD_TYPE_DATETIME MYSQL_TYPE_DATETIME#define FIELD_TYPE_YEAR MYSQL_TYPE_YEAR#define FIELD_TYPE_NEWDATE MYSQL_TYPE_NEWDATE#define FIELD_TYPE_ENUM MYSQL_TYPE_ENUM#define FIELD_TYPE_SET MYSQL_TYPE_SET#define FIELD_TYPE_TINY_BLOB MYSQL_TYPE_TINY_BLOB#define FIELD_TYPE_MEDIUM_BLOB MYSQL_TYPE_MEDIUM_BLOB#define FIELD_TYPE_LONG_BLOB MYSQL_TYPE_LONG_BLOB#define FIELD_TYPE_BLOB MYSQL_TYPE_BLOB#define FIELD_TYPE_VAR_STRING MYSQL_TYPE_VAR_STRING#define FIELD_TYPE_STRING MYSQL_TYPE_STRING#define FIELD_TYPE_CHAR MYSQL_TYPE_TINY#define FIELD_TYPE_INTERVAL MYSQL_TYPE_ENUM#define FIELD_TYPE_GEOMETRY MYSQL_TYPE_GEOMETRY#define FIELD_TYPE_BIT MYSQL_TYPE_BIT/* Shutdown/kill enums and constants */ /* Bits for THD::killable. */#define MYSQL_SHUTDOWN_KILLABLE_CONNECT (unsigned char)(1 << 0)#define MYSQL_SHUTDOWN_KILLABLE_TRANS (unsigned char)(1 << 1)#define MYSQL_SHUTDOWN_KILLABLE_LOCK_TABLE (unsigned char)(1 << 2)#define MYSQL_SHUTDOWN_KILLABLE_UPDATE (unsigned char)(1 << 3)enum mysql_enum_shutdown_level { /* We want levels to be in growing order of hardness (because we use number comparisons). Note that DEFAULT does not respect the growing property, but it's ok. */ SHUTDOWN_DEFAULT = 0, /* wait for existing connections to finish */ SHUTDOWN_WAIT_CONNECTIONS= MYSQL_SHUTDOWN_KILLABLE_CONNECT, /* wait for existing trans to finish */ SHUTDOWN_WAIT_TRANSACTIONS= MYSQL_SHUTDOWN_KILLABLE_TRANS, /* wait for existing updates to finish (=> no partial MyISAM update) */ SHUTDOWN_WAIT_UPDATES= MYSQL_SHUTDOWN_KILLABLE_UPDATE, /* flush InnoDB buffers and other storage engines' buffers*/ SHUTDOWN_WAIT_ALL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1), /* don't flush InnoDB buffers, flush other storage engines' buffers*/ SHUTDOWN_WAIT_CRITICAL_BUFFERS= (MYSQL_SHUTDOWN_KILLABLE_UPDATE << 1) + 1, /* Now the 2 levels of the KILL command */#if MYSQL_VERSION_ID >= 50000 KILL_QUERY= 254,#endif KILL_CONNECTION= 255};enum enum_cursor_type{ CURSOR_TYPE_NO_CURSOR= 0, CURSOR_TYPE_READ_ONLY= 1, CURSOR_TYPE_FOR_UPDATE= 2, CURSOR_TYPE_SCROLLABLE= 4};/* options for mysql_set_option */enum enum_mysql_set_option{ MYSQL_OPTION_MULTI_STATEMENTS_ON, MYSQL_OPTION_MULTI_STATEMENTS_OFF};#define net_new_transaction(net) ((net)->pkt_nr=0)#ifdef __cplusplusextern "C" {#endifmy_bool my_net_init(NET *net, Vio* vio);void my_net_local_init(NET *net);void net_end(NET *net);void net_clear(NET *net);my_bool net_realloc(NET *net, unsigned long length);my_bool net_flush(NET *net);my_bool my_net_write(NET *net,const char *packet,unsigned long len);my_bool net_write_command(NET *net,unsigned char command, const char *header, unsigned long head_len, const char *packet, unsigned long len);int net_real_write(NET *net,const char *packet,unsigned long len);unsigned long my_net_read(NET *net);/* The following function is not meant for normal usage Currently it's used internally by manager.c*/struct sockaddr;int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen, unsigned int timeout);struct rand_struct { unsigned long seed1,seed2,max_value; double max_value_dbl;};#ifdef __cplusplus}#endif /* The following is for user defined functions */enum Item_result {STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT, DECIMAL_RESULT};typedef struct st_udf_args{ unsigned int arg_count; /* Number of arguments */ enum Item_result *arg_type; /* Pointer to item_results */ char **args; /* Pointer to argument */ unsigned long *lengths; /* Length of string arguments */ char *maybe_null; /* Set to 1 for all maybe_null args */ char **attributes; /* Pointer to attribute name */ unsigned long *attribute_lengths; /* Length of attribute arguments */} UDF_ARGS; /* This holds information about the result */typedef struct st_udf_init{ my_bool maybe_null; /* 1 if function can return NULL */ unsigned int decimals; /* for real functions */ unsigned long max_length; /* For string functions */ char *ptr; /* free pointer for function data */ my_bool const_item; /* 0 if result is independent of arguments */} UDF_INIT; /* Constants when using compression */#define NET_HEADER_SIZE 4 /* standard header size */#define COMP_HEADER_SIZE 3 /* compression header extra size */ /* Prototypes to password functions */#ifdef __cplusplusextern "C" {#endif/* These functions are used for authentication by client and server and implemented in sql/password.c*/void randominit(struct rand_struct *, unsigned long seed1, unsigned long seed2);double my_rnd(struct rand_struct *);void create_random_string(char *to, unsigned int length, struct rand_struct *rand_st);void hash_password(unsigned long *to, const char *password, unsigned int password_len);void make_scrambled_password_323(char *to, const char *password);void scramble_323(char *to, const char *message, const char *password);my_bool check_scramble_323(const char *, const char *message, unsigned long *salt);void get_salt_from_password_323(unsigned long *res, const char *password);void make_password_from_salt_323(char *to, const unsigned long *salt);void make_scrambled_password(char *to, const char *password);void scramble(char *to, const char *message, const char *password);my_bool check_scramble(const char *reply, const char *message, const unsigned char *hash_stage2);void get_salt_from_password(unsigned char *res, const char *password);void make_password_from_salt(char *to, const unsigned char *hash_stage2);char *octet2hex(char *to, const char *str, unsigned int len);/* end of password.c */char *get_tty_password(char *opt_message);const char *mysql_errno_to_sqlstate(unsigned int mysql_errno);/* Some other useful functions */my_bool my_init(void);extern int modify_defaults_file(const char *file_location, const char *option, const char *option_value, const char *section_name, int remove_option);int load_defaults(const char *conf_file, const char **groups, int *argc, char ***argv);my_bool my_thread_init(void);void my_thread_end(void);#ifdef _global_hulong STDCALL net_field_length(uchar **packet);my_ulonglong net_field_length_ll(uchar **packet);char *net_store_length(char *pkg, ulonglong length);#endif#ifdef __cplusplus}#endif#define NULL_LENGTH ((unsigned long) ~0) /* For net_store_length */#define MYSQL_STMT_HEADER 4#define MYSQL_LONG_DATA_HEADER 6#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -