diff options
author | sasha@mysql.sashanet.com <> | 2001-10-03 14:21:16 -0600 |
---|---|---|
committer | sasha@mysql.sashanet.com <> | 2001-10-03 14:21:16 -0600 |
commit | c0f87c836accdc284b526e52a589f20b8e1be87e (patch) | |
tree | 228338950ecb3ac05baf2e782fc004a02682b17a /include | |
parent | 20ece90471c53f406030d8106bae193f995557a2 (diff) | |
parent | 1805368556e304e77d65fc77d6241192f020374e (diff) | |
download | mariadb-git-c0f87c836accdc284b526e52a589f20b8e1be87e.tar.gz |
merged
Diffstat (limited to 'include')
-rw-r--r-- | include/m_ctype.h | 2 | ||||
-rw-r--r-- | include/my_global.h | 9 | ||||
-rw-r--r-- | include/my_sys.h | 9 | ||||
-rw-r--r-- | include/myisam.h | 7 | ||||
-rw-r--r-- | include/mysql.h | 11 | ||||
-rw-r--r-- | include/mysql_com.h | 2 | ||||
-rw-r--r-- | include/mysqld_error.h | 5 | ||||
-rw-r--r-- | include/sslopt-case.h | 6 | ||||
-rw-r--r-- | include/sslopt-longopts.h | 2 | ||||
-rw-r--r-- | include/sslopt-usage.h | 3 | ||||
-rw-r--r-- | include/sslopt-vars.h | 1 | ||||
-rw-r--r-- | include/violite.h | 20 |
12 files changed, 54 insertions, 23 deletions
diff --git a/include/m_ctype.h b/include/m_ctype.h index b41323e10b9..86a67541d73 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -57,6 +57,8 @@ extern CHARSET_INFO *default_charset_info; extern CHARSET_INFO *find_compiled_charset(uint cs_number); extern CHARSET_INFO *find_compiled_charset_by_name(const char *name); extern CHARSET_INFO compiled_charsets[]; +extern uint compiled_charset_number(const char *name); +extern const char *compiled_charset_name(uint charset_number); #define MY_CHARSET_UNDEFINED 0 #define MY_CHARSET_CURRENT (default_charset_info->number) diff --git a/include/my_global.h b/include/my_global.h index 7cd79b3e078..e8527e83e28 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -965,4 +965,13 @@ typedef union { #define statistic_add(V,C,L) (V)+=(C) #endif +/* Macros to make switching between C and C++ mode easier */ +#ifdef __cplusplus +#define C_MODE_START extern "C" { +#define C_MODE_END } +#else +#define C_MODE_START +#define C_MODE_END +#endif + #endif /* _global_h */ diff --git a/include/my_sys.h b/include/my_sys.h index 63703afb42b..158b9b93dd9 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -109,7 +109,8 @@ extern int NEAR my_errno; /* Last error in mysys */ #define MY_WAIT_FOR_USER_TO_FIX_PANIC 60 /* in seconds */ #define MY_WAIT_GIVE_USER_A_MESSAGE 10 /* Every 10 times of prev */ #define MIN_COMPRESS_LENGTH 50 /* Don't compress small bl. */ -#define KEYCACHE_BLOCK_SIZE 1024 +#define DEFAULT_KEYCACHE_BLOCK_SIZE 1024 +#define MAX_KEYCACHE_BLOCK_SIZE 16384 /* root_alloc flags */ #define MY_KEEP_PREALLOC 1 @@ -193,9 +194,10 @@ extern char *get_charsets_dir(char *buf); /* statistics */ extern ulong _my_cache_w_requests,_my_cache_write,_my_cache_r_requests, _my_cache_read; -extern ulong _my_blocks_used,_my_blocks_changed; +extern ulong _my_blocks_used,_my_blocks_changed; +extern uint key_cache_block_size; extern ulong my_file_opened,my_stream_opened, my_tmp_file_created; -extern my_bool key_cache_inited; +extern my_bool key_cache_inited, my_init_done; /* Point to current my_message() */ extern void (*my_sigtstp_cleanup)(void), @@ -605,6 +607,7 @@ my_bool my_compress(byte *, ulong *, ulong *); my_bool my_uncompress(byte *, ulong *, ulong *); byte *my_compress_alloc(const byte *packet, ulong *len, ulong *complen); ulong checksum(const byte *mem, uint count); +uint my_bit_log2(ulong value); #if defined(_MSC_VER) && !defined(__WIN__) extern void sleep(int sec); diff --git a/include/myisam.h b/include/myisam.h index 78dbfd62cbe..36c0de5034f 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -46,6 +46,11 @@ extern "C" { /* Max extra space to use when sorting keys */ #define MI_MAX_TEMP_LENGTH 256*1024L*1024L +/* Possible values for myisam_block_size (must be power of 2) */ +#define MI_KEY_BLOCK_LENGTH 1024 /* default key block length */ +#define MI_MIN_KEY_BLOCK_LENGTH 1024 /* Min key block length */ +#define MI_MAX_KEY_BLOCK_LENGTH 16384 + #define mi_portable_sizeof_char_ptr 8 typedef uint32 ha_checksum; @@ -192,7 +197,7 @@ extern uint myisam_block_size; extern my_bool myisam_flush,myisam_delay_key_write,myisam_single_user; extern my_bool myisam_concurrent_insert; extern my_off_t myisam_max_temp_length,myisam_max_extra_temp_length; -extern uint myisam_bulk_insert_tree_size; +extern ulong myisam_bulk_insert_tree_size; /* Prototypes for myisam-functions */ diff --git a/include/mysql.h b/include/mysql.h index 09df0334a84..8b5fc22de8f 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -26,11 +26,9 @@ #undef __WIN__ #endif -#ifndef MYSQL_SERVER #ifdef __cplusplus extern "C" { #endif -#endif #ifndef _global_h /* If not standard header */ #include <sys/types.h> @@ -135,6 +133,7 @@ struct st_mysql_options { char *ssl_cert; /* PEM cert file */ char *ssl_ca; /* PEM CA file */ char *ssl_capath; /* PEM directory of CA-s? */ + char *ssl_cipher; /* cipher to use */ my_bool use_ssl; /* if to use SSL or not */ my_bool compress,named_pipe; /* @@ -252,7 +251,7 @@ typedef struct st_mysql_manager /* Set up and bring down the server; to ensure that applications will * work when linked against either the standard client library or the * embedded server library, these functions should be called. */ -void mysql_server_init(int argc, const char **argv, const char **groups); +int mysql_server_init(int argc, const char **argv, const char **groups); void mysql_server_end(); /* Set up and bring down a thread; these function should be called @@ -286,7 +285,7 @@ const char * STDCALL mysql_character_set_name(MYSQL *mysql); MYSQL * STDCALL mysql_init(MYSQL *mysql); int STDCALL mysql_ssl_set(MYSQL *mysql, const char *key, const char *cert, const char *ca, - const char *capath); + const char *capath, const char *cipher); int STDCALL mysql_ssl_clear(MYSQL *mysql); my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, const char *passwd, const char *db); @@ -416,10 +415,8 @@ int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB); #define HAVE_MYSQL_REAL_CONNECT -#ifndef MYSQL_SERVER #ifdef __cplusplus } #endif -#endif -#endif +#endif /* _mysql_h */ diff --git a/include/mysql_com.h b/include/mysql_com.h index 05a0e102bd1..708280176f1 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -104,6 +104,8 @@ enum enum_server_command {COM_SLEEP,COM_QUIT,COM_INIT_DB,COM_QUERY, struct st_vio; /* Only C */ typedef struct st_vio Vio; +#define MAX_BLOB_WIDTH 8192 // Default width for blob + typedef struct st_net { Vio* vio; my_socket fd; /* For Perl DBI/dbd */ diff --git a/include/mysqld_error.h b/include/mysqld_error.h index 8f78d6190b1..cb555eb8066 100644 --- a/include/mysqld_error.h +++ b/include/mysqld_error.h @@ -221,4 +221,7 @@ #define ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT 1218 #define ER_CANT_UPDATE_WITH_READLOCK 1219 #define ER_MIXING_NOT_ALLOWED 1220 -#define ER_ERROR_MESSAGES 221 +#define ER_GRANT_DUPL_SUBJECT 1221 +#define ER_GRANT_DUPL_ISSUER 1222 +#define ER_GRANT_DUPL_CIPHER 1223 +#define ER_ERROR_MESSAGES 224 diff --git a/include/sslopt-case.h b/include/sslopt-case.h index d995e31044e..b5720286778 100644 --- a/include/sslopt-case.h +++ b/include/sslopt-case.h @@ -39,4 +39,10 @@ my_free(opt_ssl_ca, MYF(MY_ALLOW_ZERO_PTR)); opt_ssl_ca = my_strdup(optarg, MYF(0)); break; + case OPT_SSL_CIPHER: + opt_use_ssl = 1; /* true */ + my_free(opt_ssl_cipher, MYF(MY_ALLOW_ZERO_PTR)); + opt_ssl_cipher = my_strdup(optarg, MYF(0)); + break; + #endif diff --git a/include/sslopt-longopts.h b/include/sslopt-longopts.h index 2f58f0e9265..697c2f647bf 100644 --- a/include/sslopt-longopts.h +++ b/include/sslopt-longopts.h @@ -22,10 +22,12 @@ #define OPT_SSL_CERT 202 #define OPT_SSL_CA 203 #define OPT_SSL_CAPATH 204 +#define OPT_SSL_CIPHER 205 {"ssl", no_argument, 0, OPT_SSL_SSL}, {"ssl-key", required_argument, 0, OPT_SSL_KEY}, {"ssl-cert", required_argument, 0, OPT_SSL_CERT}, {"ssl-ca", required_argument, 0, OPT_SSL_CA}, {"ssl-capath", required_argument, 0, OPT_SSL_CAPATH}, + {"ssl-cipher", required_argument, 0, OPT_SSL_CIPHER}, #endif /* HAVE_OPENSSL */ diff --git a/include/sslopt-usage.h b/include/sslopt-usage.h index 5b2b4a88709..cd6a06fb459 100644 --- a/include/sslopt-usage.h +++ b/include/sslopt-usage.h @@ -21,5 +21,6 @@ --ssl-key X509 key in PEM format (implies --ssl)\n\ --ssl-cert X509 cert in PEM format (implies --ssl)\n\ --ssl-ca CA file in PEM format (check OpenSSL docs, implies --ssl)\n\ - --ssl-capath CA directory (check OpenSSL docs, implies --ssl)"); + --ssl-capath CA directory (check OpenSSL docs, implies --ssl)\n\ + --ssl-cipher SSL cipher to use (implies --ssl)"); #endif diff --git a/include/sslopt-vars.h b/include/sslopt-vars.h index 597ab4d9fa6..756a35589aa 100644 --- a/include/sslopt-vars.h +++ b/include/sslopt-vars.h @@ -21,4 +21,5 @@ static char *opt_ssl_key = 0; static char *opt_ssl_cert = 0; static char *opt_ssl_ca = 0; static char *opt_ssl_capath = 0; +static char *opt_ssl_cipher = 0; #endif diff --git a/include/violite.h b/include/violite.h index 947b874c46a..d5f697b26c4 100644 --- a/include/violite.h +++ b/include/violite.h @@ -108,7 +108,6 @@ my_bool vio_poll_read(Vio *vio,uint timeout); #ifdef __cplusplus } #endif -#endif /* vio_violite_h_ */ #if defined(HAVE_VIO) && !defined(DONT_MAP_VIO) #define vio_delete(vio) (vio)->viodelete(vio) @@ -169,9 +168,6 @@ struct st_VioSSLAcceptorFd state_connect = 1, state_accept = 2 }; -// BIO* bio_; -// char desc_[100]; -// Vio* sd_; /* function pointers which are only once for SSL server Vio*(*sslaccept)(struct st_VioSSLAcceptorFd*,Vio*); */ @@ -184,15 +180,17 @@ struct st_VioSSLConnectorFd SSL_METHOD* ssl_method_; /* function pointers which are only once for SSL client */ }; -void sslaccept(struct st_VioSSLAcceptorFd*, Vio*); -void sslconnect(struct st_VioSSLConnectorFd*, Vio*); +void sslaccept(struct st_VioSSLAcceptorFd*, Vio*, long timeout); +void sslconnect(struct st_VioSSLConnectorFd*, Vio*, long timeout); struct st_VioSSLConnectorFd *new_VioSSLConnectorFd(const char* key_file, const char* cert_file, - const char* ca_file, const char* ca_path); + const char* ca_file, const char* ca_path, + const char* cipher); struct st_VioSSLAcceptorFd *new_VioSSLAcceptorFd(const char* key_file, const char* cert_file, - const char* ca_file,const char* ca_path); + const char* ca_file,const char* ca_path, + const char* cipher); Vio* new_VioSSL(struct st_VioSSLAcceptorFd* fd, Vio* sd,int state); #ifdef __cplusplus @@ -200,6 +198,9 @@ Vio* new_VioSSL(struct st_VioSSLAcceptorFd* fd, Vio* sd,int state); #endif #endif /* HAVE_OPENSSL */ +/* This enumerator is used in parser - should be always visible */ +enum SSL_type {SSL_TYPE_NONE, SSL_TYPE_ANY, SSL_TYPE_X509, SSL_TYPE_SPECIFIED}; + #ifndef EMBEDDED_LIBRARY /* This structure is for every connection on both sides */ struct st_vio @@ -229,11 +230,10 @@ struct st_vio my_bool (*poll_read)(Vio*,uint); #ifdef HAVE_OPENSSL - BIO* bio_; SSL* ssl_; my_bool open_; - char *ssl_cip_; #endif /* HAVE_OPENSSL */ #endif /* HAVE_VIO */ }; #endif /* EMBEDDED_LIBRARY */ +#endif /* vio_violite_h_ */ |