Changeset 7882 for trunk/tools/database/mysql
- Timestamp:
- Feb 12, 2002, 8:05:28 AM (24 years ago)
- Location:
- trunk/tools/database/mysql
- Files:
-
- 3 added
- 2 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/database/mysql/mysql.h
r1993 r7882 1 /* Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB 2 This file is public domain and comes with NO WARRANTY of any kind */ 3 4 /* defines for libmysql */ 1 /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB 2 3 This library is free software; you can redistribute it and/or 4 modify it under the terms of the GNU Library General Public 5 License as published by the Free Software Foundation; either 6 version 2 of the License, or (at your option) any later version. 7 8 This library is distributed in the hope that it will be useful, 9 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 Library General Public License for more details. 12 13 You should have received a copy of the GNU Library General Public 14 License along with this library; if not, write to the Free 15 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 16 MA 02111-1307, USA */ 17 18 /* defines for the libmysql library */ 5 19 6 20 #ifndef _mysql_h 7 21 #define _mysql_h 8 #ifdef __cplusplus 22 23 #ifdef __CYGWIN__ /* CYGWIN implements a UNIX API */ 24 #undef WIN 25 #undef _WIN 26 #undef _WIN32 27 #undef _WIN64 28 #undef __WIN__ 29 #endif 30 31 #ifndef MYSQL_SERVER 32 #ifdef __cplusplus 9 33 extern "C" { 10 34 #endif 11 12 #ifndef _global_h /* If not standard header */ 35 #endif 36 37 #ifndef _global_h /* If not standard header */ 13 38 #include <sys/types.h> 14 39 typedef char my_bool; 15 #if !defined(WIN32) 16 #if defined(__IBMC__) || defined(__IBMCPP__) 17 #define STDCALL _System 18 #else 19 #define STDCALL 20 #endif 40 #if (defined(_WIN32) || defined(_WIN64)) && !defined(__WIN__) 41 #define __WIN__ 42 #endif 43 #if defined(__IBMC__) || defined(__IBMCPP__) 44 #define STDCALL _System _Export 45 #elif !defined(__WIN__) 46 #define STDCALL 21 47 #else 22 48 #define STDCALL __stdcall … … 26 52 #ifndef ST_USED_MEM_DEFINED 27 53 #define ST_USED_MEM_DEFINED 28 typedef struct st_used_mem { 29 struct st_used_mem *next; 30 unsigned int left;/* memory left in block */31 unsigned int size;/* size of block */54 typedef struct st_used_mem { /* struct for once_alloc */ 55 struct st_used_mem *next; /* Next block in use */ 56 unsigned int left; /* memory left in block */ 57 unsigned int size; /* size of block */ 32 58 } USED_MEM; 33 59 typedef struct st_mem_root { 34 60 USED_MEM *free; 35 61 USED_MEM *used; 36 unsigned int min_malloc; 37 unsigned int block_size; 62 USED_MEM *pre_alloc; 63 unsigned int min_malloc; 64 unsigned int block_size; 65 38 66 void (*error_handler)(void); 39 67 } MEM_ROOT; … … 41 69 42 70 #ifndef my_socket_defined 43 #ifdef WIN3271 #ifdef __WIN__ 44 72 #define my_socket SOCKET 45 73 #else … … 54 82 extern char *mysql_unix_port; 55 83 56 #define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG) 57 #define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG) 58 #define IS_BLOB(n) ((n) & BLOB_FLAG) 59 #define IS_NUM(t) ((t) <= FIELD_TYPE_INT24 || (t) == FIELD_TYPE_YEAR) 84 #define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG) 85 #define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG) 86 #define IS_BLOB(n) ((n) & BLOB_FLAG) 87 #define IS_NUM(t) ((t) <= FIELD_TYPE_INT24 || (t) == FIELD_TYPE_YEAR) 88 #define IS_NUM_FIELD(f) ((f)->flags & NUM_FLAG) 89 #define INTERNAL_NUM_FIELD(f) (((f)->type <= FIELD_TYPE_INT24 && ((f)->type != FIELD_TYPE_TIMESTAMP || (f)->length == 14 || (f)->length == 8)) || (f)->type == FIELD_TYPE_YEAR) 60 90 61 91 typedef struct st_mysql_field { 62 char *name; 63 char *table; 64 char *def; 65 enum enum_field_types type; 66 unsigned int length; 67 unsigned int max_length; 68 unsigned int flags; 69 unsigned int decimals; 92 char *name; /* Name of column */ 93 char *table; /* Table of column if column was a field */ 94 char *def; /* Default value (set by mysql_list_fields) */ 95 enum enum_field_types type; /* Type of field. Se mysql_com.h for types */ 96 unsigned int length; /* Width of column */ 97 unsigned int max_length; /* Max width of selected set */ 98 unsigned int flags; /* Div flags */ 99 unsigned int decimals; /* Number of decimals in field */ 70 100 } MYSQL_FIELD; 71 101 72 typedef char **MYSQL_ROW; 102 typedef char **MYSQL_ROW; /* return data as array of strings */ 73 103 typedef unsigned int MYSQL_FIELD_OFFSET; /* offset to current field */ 74 104 75 105 #if defined(NO_CLIENT_LONG_LONG) 76 106 typedef unsigned long my_ulonglong; 77 #elif defined ( WIN32)107 #elif defined (__WIN__) 78 108 typedef unsigned __int64 my_ulonglong; 79 109 #else … … 84 114 85 115 typedef struct st_mysql_rows { 86 struct st_mysql_rows *next; 116 struct st_mysql_rows *next; /* list of rows */ 87 117 MYSQL_ROW data; 88 118 } MYSQL_ROWS; 89 119 90 typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; 120 typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; /* offset to current row */ 91 121 92 122 typedef struct st_mysql_data { 93 #if defined(__IBMC__) || defined(__IBMCPP__)94 unsigned long rows;95 unsigned long rows_;96 #else97 123 my_ulonglong rows; 98 #endif99 124 unsigned int fields; 100 125 MYSQL_ROWS *data; … … 107 132 unsigned int port; 108 133 char *host,*init_command,*user,*password,*unix_socket,*db; 109 char *my_cnf_file,*my_cnf_group; 134 char *my_cnf_file,*my_cnf_group, *charset_dir, *charset_name; 135 my_bool use_ssl; /* if to use SSL or not */ 136 char *ssl_key; /* PEM key file */ 137 char *ssl_cert; /* PEM cert file */ 138 char *ssl_ca; /* PEM CA file */ 139 char *ssl_capath; /* PEM directory of CA-s? */ 110 140 }; 111 141 112 142 enum mysql_option { MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, 113 MYSQL_OPT_NAMED_PIPE, MYSQL_INIT_COMMAND, 114 MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP }; 143 MYSQL_OPT_NAMED_PIPE, MYSQL_INIT_COMMAND, 144 MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP, 145 MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME}; 115 146 116 147 enum mysql_status { MYSQL_STATUS_READY,MYSQL_STATUS_GET_RESULT, 117 148 MYSQL_STATUS_USE_RESULT}; 118 149 119 150 typedef struct st_mysql { 120 NET net; /* Communication parameters */ 121 char *host,*user,*passwd,*unix_socket,*server_version,*host_info, 122 *info,*db; 123 unsigned int port,client_flag,server_capabilities; 124 unsigned int protocol_version; 125 unsigned int field_count; 126 unsigned long thread_id; /* Id for connection in server */ 127 #if defined(__IBMC__) || defined(__IBMCPP__) 128 unsigned long affected_rows; 129 unsigned long _affected_rows; 130 unsigned long insert_id; /* id if insert on table with NEXTNR */ 131 unsigned long _insert_id; /* id if insert on table with NEXTNR */ 132 unsigned long extra_info; /* Used by mysqlshow */ 133 unsigned long _extra_info; /* Used by mysqlshow */ 134 #else 151 NET net; /* Communication parameters */ 152 gptr connector_fd; /* ConnectorFd for SSL */ 153 char *host,*user,*passwd,*unix_socket,*server_version,*host_info, 154 *info,*db; 155 unsigned int port,client_flag,server_capabilities; 156 unsigned int protocol_version; 157 unsigned int field_count; 158 unsigned int server_status; 159 unsigned long thread_id; /* Id for connection in server */ 135 160 my_ulonglong affected_rows; 136 my_ulonglong insert_id; /* id if insert on table with NEXTNR */ 137 my_ulonglong extra_info; /* Used by mysqlshow */ 138 #endif 139 161 my_ulonglong insert_id; /* id if insert on table with NEXTNR */ 162 my_ulonglong extra_info; /* Used by mysqlshow */ 140 163 unsigned long packet_length; 141 164 enum mysql_status status; 142 MYSQL_FIELD 143 MEM_ROOT 144 my_bool free_me;/* If free in mysql_close */145 my_bool reconnect;/* set to 1 if automatic reconnect */165 MYSQL_FIELD *fields; 166 MEM_ROOT field_alloc; 167 my_bool free_me; /* If free in mysql_close */ 168 my_bool reconnect; /* set to 1 if automatic reconnect */ 146 169 struct st_mysql_options options; 170 char scramble_buff[9]; 171 struct charset_info_st *charset; 172 unsigned int server_language; 147 173 } MYSQL; 148 174 149 175 150 176 typedef struct st_mysql_res { 151 #if defined(__IBMC__) || defined(__IBMCPP__)152 unsigned long row_count;153 unsigned long _row_count;154 #else155 177 my_ulonglong row_count; 156 #endif 157 unsigned int field_count, current_field; 158 MYSQL_FIELD *fields; 159 MYSQL_DATA *data; 160 MYSQL_ROWS *data_cursor; 161 MEM_ROOT field_alloc; 162 MYSQL_ROW row; /* If unbuffered read */ 163 MYSQL_ROW current_row; /* buffer to current row */ 164 unsigned long *lengths; /* column lengths of current row */ 165 MYSQL *handle; /* for unbuffered reads */ 166 my_bool eof; /* Used my mysql_fetch_row */ 178 unsigned int field_count, current_field; 179 MYSQL_FIELD *fields; 180 MYSQL_DATA *data; 181 MYSQL_ROWS *data_cursor; 182 MEM_ROOT field_alloc; 183 MYSQL_ROW row; /* If unbuffered read */ 184 MYSQL_ROW current_row; /* buffer to current row */ 185 unsigned long *lengths; /* column lengths of current row */ 186 MYSQL *handle; /* for unbuffered reads */ 187 my_bool eof; /* Used my mysql_fetch_row */ 167 188 } MYSQL_RES; 168 189 169 170 #define mysql_num_rows(res) (res)->row_count 171 #define mysql_num_fields(res) (res)->field_count 172 #define mysql_eof(res) (res)->eof 173 #define mysql_fetch_field_direct(res,fieldnr) (&(res)->fields[fieldnr]) 174 #define mysql_fetch_fields(res) (res)->fields 175 #define mysql_row_tell(res) (res)->data_cursor 176 #define mysql_field_tell(res) (res)->current_field 177 178 #define mysql_field_count(mysql) (mysql)->field_count 179 #define mysql_affected_rows(mysql) (mysql)->affected_rows 180 #define mysql_insert_id(mysql) (mysql)->insert_id 181 #define mysql_error(mysql) (mysql)->net.last_error 182 #define mysql_errno(mysql) (mysql)->net.last_errno 183 #define mysql_info(mysql) (mysql)->info 184 #define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT) 185 #define mysql_thread_id(mysql) (mysql)->thread_id 186 187 MYSQL * STDCALL mysql_init(MYSQL *mysql); 188 MYSQL * STDCALL mysql_connect(MYSQL *mysql, const char *host, 189 const char *user, const char *passwd); 190 /* Functions to get information from the MYSQL and MYSQL_RES structures */ 191 /* Should definitely be used if one uses shared libraries */ 192 193 my_ulonglong STDCALL mysql_num_rows(MYSQL_RES *res); 194 unsigned int STDCALL mysql_num_fields(MYSQL_RES *res); 195 my_bool STDCALL mysql_eof(MYSQL_RES *res); 196 MYSQL_FIELD *STDCALL mysql_fetch_field_direct(MYSQL_RES *res, 197 unsigned int fieldnr); 198 MYSQL_FIELD * STDCALL mysql_fetch_fields(MYSQL_RES *res); 199 MYSQL_ROWS * STDCALL mysql_row_tell(MYSQL_RES *res); 200 unsigned int STDCALL mysql_field_tell(MYSQL_RES *res); 201 202 unsigned int STDCALL mysql_field_count(MYSQL *mysql); 203 my_ulonglong STDCALL mysql_affected_rows(MYSQL *mysql); 204 my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql); 205 unsigned int STDCALL mysql_errno(MYSQL *mysql); 206 char * STDCALL mysql_error(MYSQL *mysql); 207 char * STDCALL mysql_info(MYSQL *mysql); 208 unsigned long STDCALL mysql_thread_id(MYSQL *mysql); 209 const char * STDCALL mysql_character_set_name(MYSQL *mysql); 210 211 MYSQL * STDCALL mysql_init(MYSQL *mysql); 212 #ifdef HAVE_OPENSSL 213 int STDCALL mysql_ssl_set(MYSQL *mysql, const char *key, 214 const char *cert, const char *ca, 215 const char *capath); 216 char * STDCALL mysql_ssl_cipher(MYSQL *mysql); 217 int STDCALL mysql_ssl_clear(MYSQL *mysql); 218 #endif /* HAVE_OPENSSL */ 219 MYSQL * STDCALL mysql_connect(MYSQL *mysql, const char *host, 220 const char *user, const char *passwd); 221 my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, 222 const char *passwd, const char *db); 190 223 #if MYSQL_VERSION_ID >= 32200 191 MYSQL * 192 193 194 195 196 197 224 MYSQL * STDCALL mysql_real_connect(MYSQL *mysql, const char *host, 225 const char *user, 226 const char *passwd, 227 const char *db, 228 unsigned int port, 229 const char *unix_socket, 230 unsigned int clientflag); 198 231 #else 199 MYSQL * STDCALL mysql_real_connect(MYSQL *mysql, const char *host, 200 const char *user, 201 const char *passwd, 202 unsigned int port, 203 const char *unix_socket, 204 unsigned int clientflag); 205 #endif 206 void STDCALL mysql_close(MYSQL *sock); 207 int STDCALL mysql_select_db(MYSQL *mysql, const char *db); 208 int STDCALL mysql_query(MYSQL *mysql, const char *q); 209 int STDCALL mysql_real_query(MYSQL *mysql, const char *q, 210 unsigned int length); 211 int STDCALL mysql_create_db(MYSQL *mysql, const char *DB); 212 int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB); 213 int STDCALL mysql_shutdown(MYSQL *mysql); 214 int STDCALL mysql_dump_debug_info(MYSQL *mysql); 215 int STDCALL mysql_refresh(MYSQL *mysql, 216 unsigned int refresh_options); 217 int STDCALL mysql_kill(MYSQL *mysql,unsigned long pid); 218 int STDCALL mysql_ping(MYSQL *mysql); 219 char * STDCALL mysql_stat(MYSQL *mysql); 220 char * STDCALL mysql_get_server_info(MYSQL *mysql); 221 char * STDCALL mysql_get_client_info(void); 222 char * STDCALL mysql_get_host_info(MYSQL *mysql); 223 unsigned int STDCALL mysql_get_proto_info(MYSQL *mysql); 224 MYSQL_RES * STDCALL mysql_list_dbs(MYSQL *mysql,const char *wild); 225 MYSQL_RES * STDCALL mysql_list_tables(MYSQL *mysql,const char *wild); 226 MYSQL_RES * STDCALL mysql_list_fields(MYSQL *mysql, const char *table, 227 const char *wild); 228 MYSQL_RES * STDCALL mysql_list_processes(MYSQL *mysql); 229 MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql); 230 MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql); 231 int STDCALL mysql_options(MYSQL *mysql,enum mysql_option option, 232 const char *arg); 233 void STDCALL mysql_free_result(MYSQL_RES *result); 234 void STDCALL mysql_data_seek(MYSQL_RES *result,unsigned int offset); 232 MYSQL * STDCALL mysql_real_connect(MYSQL *mysql, const char *host, 233 const char *user, 234 const char *passwd, 235 unsigned int port, 236 const char *unix_socket, 237 unsigned int clientflag); 238 #endif 239 void STDCALL mysql_close(MYSQL *sock); 240 int STDCALL mysql_select_db(MYSQL *mysql, const char *db); 241 int STDCALL mysql_query(MYSQL *mysql, const char *q); 242 int STDCALL mysql_send_query(MYSQL *mysql, const char *q, 243 unsigned int length); 244 int STDCALL mysql_read_query_result(MYSQL *mysql); 245 int STDCALL mysql_real_query(MYSQL *mysql, const char *q, 246 unsigned int length); 247 int STDCALL mysql_create_db(MYSQL *mysql, const char *DB); 248 int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB); 249 int STDCALL mysql_shutdown(MYSQL *mysql); 250 int STDCALL mysql_dump_debug_info(MYSQL *mysql); 251 int STDCALL mysql_refresh(MYSQL *mysql, 252 unsigned int refresh_options); 253 int STDCALL mysql_kill(MYSQL *mysql,unsigned long pid); 254 int STDCALL mysql_ping(MYSQL *mysql); 255 char * STDCALL mysql_stat(MYSQL *mysql); 256 char * STDCALL mysql_get_server_info(MYSQL *mysql); 257 char * STDCALL mysql_get_client_info(void); 258 char * STDCALL mysql_get_host_info(MYSQL *mysql); 259 unsigned int STDCALL mysql_get_proto_info(MYSQL *mysql); 260 MYSQL_RES * STDCALL mysql_list_dbs(MYSQL *mysql,const char *wild); 261 MYSQL_RES * STDCALL mysql_list_tables(MYSQL *mysql,const char *wild); 262 MYSQL_RES * STDCALL mysql_list_fields(MYSQL *mysql, const char *table, 263 const char *wild); 264 MYSQL_RES * STDCALL mysql_list_processes(MYSQL *mysql); 265 MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql); 266 MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql); 267 int STDCALL mysql_options(MYSQL *mysql,enum mysql_option option, 268 const char *arg); 269 void STDCALL mysql_free_result(MYSQL_RES *result); 270 void STDCALL mysql_data_seek(MYSQL_RES *result, 271 my_ulonglong offset); 235 272 MYSQL_ROW_OFFSET STDCALL mysql_row_seek(MYSQL_RES *result, MYSQL_ROW_OFFSET); 236 273 MYSQL_FIELD_OFFSET STDCALL mysql_field_seek(MYSQL_RES *result, 237 238 MYSQL_ROW 274 MYSQL_FIELD_OFFSET offset); 275 MYSQL_ROW STDCALL mysql_fetch_row(MYSQL_RES *result); 239 276 unsigned long * STDCALL mysql_fetch_lengths(MYSQL_RES *result); 240 MYSQL_FIELD * STDCALL mysql_fetch_field(MYSQL_RES *result); 241 unsigned int STDCALL mysql_escape_string(char *to,const char *from, 242 unsigned int from_length); 243 void STDCALL mysql_debug(const char *debug); 277 MYSQL_FIELD * STDCALL mysql_fetch_field(MYSQL_RES *result); 278 unsigned long STDCALL mysql_escape_string(char *to,const char *from, 279 unsigned long from_length); 280 unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql, 281 char *to,const char *from, 282 unsigned long length); 283 void STDCALL mysql_debug(const char *debug); 284 char * STDCALL mysql_odbc_escape_string(MYSQL *mysql, 285 char *to, 286 unsigned long to_length, 287 const char *from, 288 unsigned long from_length, 289 void *param, 290 char * 291 (*extend_buffer) 292 (void *, char *to, 293 unsigned long *length)); 294 void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name); 295 unsigned int STDCALL mysql_thread_safe(void); 296 297 298 #define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT) 244 299 245 300 /* new api functions */ … … 247 302 #define HAVE_MYSQL_REAL_CONNECT 248 303 249 #ifdef __cplusplus 304 #ifndef MYSQL_SERVER 305 #ifdef __cplusplus 250 306 } 251 307 #endif 252 308 #endif 309 310 #endif -
trunk/tools/database/mysql/mysql_com.h
r1936 r7882 1 /* Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB 2 This file is public domain and comes with NO WARRANTY of any kind */ 1 /* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB 2 3 This library is free software; you can redistribute it and/or 4 modify it under the terms of the GNU Library General Public 5 License as published by the Free Software Foundation; either 6 version 2 of the License, or (at your option) any later version. 7 8 This library is distributed in the hope that it will be useful, 9 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 Library General Public License for more details. 12 13 You should have received a copy of the GNU Library General Public 14 License along with this library; if not, write to the Free 15 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 16 MA 02111-1307, USA */ 3 17 4 18 /* … … 8 22 #ifndef _mysql_com_h 9 23 #define _mysql_com_h 10 #ifdef __cplusplus 11 extern "C" { 12 #endif 24 13 25 14 26 #define NAME_LEN 64 /* Field/table name length */ 15 27 #define HOSTNAME_LENGTH 60 16 28 #define USERNAME_LENGTH 16 29 #define SERVER_VERSION_LENGTH 60 17 30 18 31 #define LOCAL_HOST "localhost" 19 32 #define LOCAL_HOST_NAMEDPIPE "." 20 33 21 #define MYSQL_PORT 3306 /* Alloced by ISI for MySQL */ 22 #define MYSQL_UNIX_ADDR "/tmp/mysql.sock" 23 #if defined(__EMX__) || defined(__OS2__) 24 #undef MYSQL_UNIX_ADDR 25 #define MYSQL_OS2_ADDR "\\socket\\MySQL" 26 #define MYSQL_UNIX_ADDR MYSQL_OS2_ADDR 27 #endif 28 #ifdef WIN32 34 #if defined(__WIN__) && !defined( _CUSTOMCONFIG_) 29 35 #define MYSQL_NAMEDPIPE "MySQL" 30 36 #define MYSQL_SERVICENAME "MySql" 31 #endif 37 #endif /* __WIN__ */ 32 38 33 39 enum enum_server_command {COM_SLEEP,COM_QUIT,COM_INIT_DB,COM_QUERY, … … 35 41 COM_SHUTDOWN,COM_STATISTICS, 36 42 COM_PROCESS_INFO,COM_CONNECT,COM_PROCESS_KILL, 37 COM_DEBUG,COM_PING,COM_TIME,COM_DELAYED_INSERT}; 43 COM_DEBUG,COM_PING,COM_TIME,COM_DELAYED_INSERT, 44 COM_CHANGE_USER, COM_BINLOG_DUMP, 45 COM_TABLE_DUMP, COM_CONNECT_OUT}; 38 46 39 47 #define NOT_NULL_FLAG 1 /* Field can't be NULL */ … … 50 58 #define TIMESTAMP_FLAG 1024 /* Field is a timestamp */ 51 59 #define SET_FLAG 2048 /* field is a set */ 60 #define NUM_FLAG 32768 /* Field is num (for clients) */ 52 61 #define PART_KEY_FLAG 16384 /* Intern; Part of some key */ 53 62 #define GROUP_FLAG 32768 /* Intern: Group field */ … … 59 68 #define REFRESH_HOSTS 8 /* Flush host cache */ 60 69 #define REFRESH_STATUS 16 /* Flush status variables */ 70 #define REFRESH_THREADS 32 /* Flush status variables */ 71 #define REFRESH_SLAVE 64 /* Reset master info and restart slave 72 thread */ 73 #define REFRESH_MASTER 128 /* Remove all bin logs in the index 74 and truncate the index */ 75 76 /* The following can't be set with mysql_refresh() */ 77 #define REFRESH_READ_LOCK 16384 /* Lock tables for read */ 61 78 #define REFRESH_FAST 32768 /* Intern flag */ 62 79 … … 66 83 #define CLIENT_CONNECT_WITH_DB 8 /* One can specify db on connect */ 67 84 #define CLIENT_NO_SCHEMA 16 /* Don't allow database.table.column */ 68 #define CLIENT_COMPRESS 32 /* Can use compression prot col */85 #define CLIENT_COMPRESS 32 /* Can use compression protocol */ 69 86 #define CLIENT_ODBC 64 /* Odbc client */ 70 87 #define CLIENT_LOCAL_FILES 128 /* Can use LOAD DATA LOCAL */ 71 88 #define CLIENT_IGNORE_SPACE 256 /* Ignore spaces before '(' */ 89 #define CLIENT_CHANGE_USER 512 /* Support the mysql_change_user() */ 90 #define CLIENT_INTERACTIVE 1024 /* This is an interactive client */ 91 #define CLIENT_SSL 2048 /* Switch to SSL after handshake */ 92 #define CLIENT_IGNORE_SIGPIPE 4096 /* IGNORE sigpipes */ 93 #define CLIENT_TRANSACTIONS 8192 /* Client knows about transactions */ 94 95 #define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */ 96 #define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */ 72 97 73 98 #define MYSQL_ERRMSG_SIZE 200 … … 76 101 #define NET_WAIT_TIMEOUT 8*60*60 /* Wait for new query */ 77 102 78 enum enum_net_type { NET_TYPE_TCPIP, NET_TYPE_SOCKET, NET_TYPE_NAMEDPIPE }; 103 #ifndef Vio_defined 104 #define Vio_defined 105 #ifdef HAVE_VIO 106 class Vio; /* Fill Vio class in C++ */ 107 #else 108 struct st_vio; /* Only C */ 109 typedef struct st_vio Vio; 110 #endif 111 #endif 79 112 80 113 typedef struct st_net { 81 enum enum_net_type nettype; 82 #ifdef WIN32 83 HANDLE hPipe; 84 #endif 85 my_socket fd; 114 Vio* vio; 115 my_socket fd; /* For Perl DBI/dbd */ 86 116 int fcntl; 87 117 unsigned char *buff,*buff_end,*write_pos,*read_pos; 88 118 char last_error[MYSQL_ERRMSG_SIZE]; 89 119 unsigned int last_errno,max_packet,timeout,pkt_nr; 90 my_bool error,return_errno,compress; 91 120 unsigned char error; 121 my_bool return_errno,compress; 122 my_bool no_send_ok; /* needed if we are doing several 123 queries in one command ( as in LOAD TABLE ... FROM MASTER ), 124 and do not want to confuse the client with OK at the wrong time 125 */ 92 126 unsigned long remain_in_buf,length, buf_length, where_b; 93 my_bool more; 127 unsigned int *return_status; 128 unsigned char reading_or_writing; 94 129 char save_char; 95 130 } NET; … … 123 158 #define net_new_transaction(net) ((net)->pkt_nr=0) 124 159 125 int my_net_init(NET *net, enum enum_net_type nettype, my_socket fd, 126 void *); 160 int my_net_init(NET *net, Vio* vio); 127 161 void net_end(NET *net); 128 162 void net_clear(NET *net); … … 169 203 /* Prototypes to password functions */ 170 204 205 #ifdef __cplusplus 206 extern "C" { 207 #endif 208 171 209 void randominit(struct rand_struct *,unsigned long seed1, 172 210 unsigned long seed2); … … 174 212 void make_scrambled_password(char *to,const char *password); 175 213 void get_salt_from_password(unsigned long *res,const char *password); 214 void make_password_from_salt(char *to, unsigned long *hash_res); 176 215 char *scramble(char *to,const char *message,const char *password, 177 216 my_bool old_ver); … … 180 219 char *get_tty_password(char *opt_message); 181 220 void hash_password(unsigned long *result, const char *password); 221 #ifdef __cplusplus 222 } 223 #endif 182 224 183 225 /* Some other useful functions */ … … 189 231 #define NULL_LENGTH ((unsigned long) ~0) /* For net_store_length */ 190 232 191 #ifdef WIN32233 #ifdef __WIN__ 192 234 #define socket_errno WSAGetLastError() 235 #elif defined(OS2) 236 #define socket_errno sock_errno() 193 237 #else 194 238 #define socket_errno errno 195 239 #endif 196 240 197 #ifdef __cplusplus 198 } 199 #endif 200 #endif 241 #endif -
trunk/tools/database/mysql/mysql_version.h
r1936 r7882 1 /* Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB1 /* Copyright Abandoned 1996, 1999, 2001 MySQL AB 2 2 This file is public domain and comes with NO WARRANTY of any kind */ 3 3 4 4 /* Version numbers for protocol & mysqld */ 5 5 6 #define MYSQL_SERVER_VERSION "3.22.26a" 7 #define FRM_VER 6 8 #define MYSQL_VERSION_ID 32226 6 #ifdef _CUSTOMCONFIG_ 7 #include <custom_conf.h> 8 #else 9 #define PROTOCOL_VERSION 10 10 #define MYSQL_SERVER_VERSION "3.23.40" 11 #define MYSQL_SERVER_SUFFIX "" 12 #define FRM_VER 6 13 #define MYSQL_VERSION_ID 32333 14 #define MYSQL_PORT 3306 15 #define MYSQL_UNIX_ADDR "\\socket\\MySQL" 16 17 /* mysqld compile time options */ 18 #ifndef MYSQL_CHARSET 19 #define MYSQL_CHARSET "latin1" 20 #endif 21 #endif
Note:
See TracChangeset
for help on using the changeset viewer.