diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/config-win.h | 2 | ||||
-rw-r--r-- | include/hash.h | 9 | ||||
-rw-r--r-- | include/m_ctype.h | 23 | ||||
-rw-r--r-- | include/my_base.h | 8 | ||||
-rw-r--r-- | include/my_getopt.h | 17 | ||||
-rw-r--r-- | include/my_global.h | 17 | ||||
-rw-r--r-- | include/my_pthread.h | 5 | ||||
-rw-r--r-- | include/my_sys.h | 21 | ||||
-rw-r--r-- | include/myisam.h | 80 | ||||
-rw-r--r-- | include/mysql.h | 19 | ||||
-rw-r--r-- | include/mysql_com.h | 7 | ||||
-rw-r--r-- | include/sslopt-case.h | 4 | ||||
-rw-r--r-- | include/sslopt-longopts.h | 33 |
13 files changed, 153 insertions, 92 deletions
diff --git a/include/config-win.h b/include/config-win.h index a3770cd68ad..12a89bec21b 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -31,7 +31,7 @@ #define SYSTEM_TYPE "Win95/Win98" #endif -#ifdef _WIN64 +#if defined(_WIN64) || defined(WIN64) #define MACHINE_TYPE "ia64" /* Define to machine type name */ #else #define MACHINE_TYPE "i32" /* Define to machine type name */ diff --git a/include/hash.h b/include/hash.h index 49a75d98dcb..a4afe03fb59 100644 --- a/include/hash.h +++ b/include/hash.h @@ -44,10 +44,11 @@ typedef struct st_hash { CHARSET_INFO *charset; } HASH; -my_bool hash_init(HASH *hash,CHARSET_INFO *charset, - uint default_array_elements, uint key_offset, - uint key_length, hash_get_key get_key, - void (*free_element)(void*), uint flags); +#define hash_init(A,B,C,D,E,F,G) _hash_init(A,B,C,D,E,F,G, H CALLER_INFO) +my_bool _hash_init(HASH *hash, CHARSET_INFO *charset, + uint default_array_elements, uint key_offset, + uint key_length, hash_get_key get_key, + void (*free_element)(void*), uint flags CALLER_INFO_PROTO); void hash_free(HASH *tree); byte *hash_element(HASH *hash,uint idx); gptr hash_search(HASH *info,const byte *key,uint length); diff --git a/include/m_ctype.h b/include/m_ctype.h index 33afd610cf4..3b095b41d4f 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -264,10 +264,10 @@ int my_uni_utf8 (CHARSET_INFO *cs, my_wc_t wc, uchar *b, uchar *e); #define _U 01 /* Upper case */ #define _L 02 /* Lower case */ -#define _N 04 /* Numeral (digit) */ -#define _S 010 /* Spacing character */ -#define _P 020 /* Punctuation */ -#define _C 040 /* Control character */ +#define _NMR 04 /* Numeral (digit) */ +#define _SPC 010 /* Spacing character */ +#define _PNT 020 /* Punctuation */ +#define _CTR 040 /* Control character */ #define _B 0100 /* Blank */ #define _X 0200 /* heXadecimal digit */ @@ -276,20 +276,19 @@ int my_uni_utf8 (CHARSET_INFO *cs, my_wc_t wc, uchar *b, uchar *e); #define my_toascii(c) ((c) & 0177) #define my_tocntrl(c) ((c) & 31) #define my_toprint(c) ((c) | 64) - #define my_toupper(s,c) (char) ((s)->to_upper[(uchar) (c)]) #define my_tolower(s,c) (char) ((s)->to_lower[(uchar) (c)]) #define my_isalpha(s, c) (((s)->ctype+1)[(uchar) (c)] & (_U | _L)) #define my_isupper(s, c) (((s)->ctype+1)[(uchar) (c)] & _U) #define my_islower(s, c) (((s)->ctype+1)[(uchar) (c)] & _L) -#define my_isdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _N) +#define my_isdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _NMR) #define my_isxdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _X) -#define my_isalnum(s, c) (((s)->ctype+1)[(uchar) (c)] & (_U | _L | _N)) -#define my_isspace(s, c) (((s)->ctype+1)[(uchar) (c)] & _S) -#define my_ispunct(s, c) (((s)->ctype+1)[(uchar) (c)] & _P) -#define my_isprint(s, c) (((s)->ctype+1)[(uchar) (c)] & (_P | _U | _L | _N | _B)) -#define my_isgraph(s, c) (((s)->ctype+1)[(uchar) (c)] & (_P | _U | _L | _N)) -#define my_iscntrl(s, c) (((s)->ctype+1)[(uchar) (c)] & _C) +#define my_isalnum(s, c) (((s)->ctype+1)[(uchar) (c)] & (_U | _L | _NMR)) +#define my_isspace(s, c) (((s)->ctype+1)[(uchar) (c)] & _SPC) +#define my_ispunct(s, c) (((s)->ctype+1)[(uchar) (c)] & _PNT) +#define my_isprint(s, c) (((s)->ctype+1)[(uchar) (c)] & (_PNT | _U | _L | _NMR | _B)) +#define my_isgraph(s, c) (((s)->ctype+1)[(uchar) (c)] & (_PNT | _U | _L | _NMR)) +#define my_iscntrl(s, c) (((s)->ctype+1)[(uchar) (c)] & _CTR) /* Some macros that should be cleaned up a little */ #define my_isvar(s,c) (my_isalnum(s,c) || (c) == '_') diff --git a/include/my_base.h b/include/my_base.h index 68f33147145..ae8fc2204d5 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -67,9 +67,11 @@ enum ha_rkey_function { /* Key algorithm types */ enum ha_key_alg { - HA_KEY_ALG_BTREE=0, /* B-tree, default one */ - HA_KEY_ALG_RTREE=1, /* R-tree, for spatial searches */ - HA_KEY_ALG_HASH=2 /* HASH keys (HEAP tables) */ + HA_KEY_ALG_UNDEF= 0, /* Not specified (old file) */ + HA_KEY_ALG_BTREE= 1, /* B-tree, default one */ + HA_KEY_ALG_RTREE= 2, /* R-tree, for spatial searches */ + HA_KEY_ALG_HASH= 3, /* HASH keys (HEAP tables) */ + HA_KEY_ALG_FULLTEXT= 4 /* FULLTEXT (MyISAM tables) */ }; /* The following is parameter to ha_extra() */ diff --git a/include/my_getopt.h b/include/my_getopt.h index 2e40fb8ffaa..b3b3ee2f785 100644 --- a/include/my_getopt.h +++ b/include/my_getopt.h @@ -14,28 +14,21 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -struct my_optarg -{ - char *arg; /* option argument */ - int pos; /* next element in ARGV */ - int verbose; /* 0 = inhibit warnings of unrecognized options */ - int unrecognized; /* position of the unrecognized option */ -}; +C_MODE_START - -enum get_opt_var_type { GET_NO_ARG, GET_LONG, GET_LL, GET_STR }; +enum get_opt_var_type { GET_NO_ARG, GET_BOOL, GET_LONG, GET_LL, GET_STR }; enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG }; struct my_option { const char *name; /* Name of the option */ + int id; /* unique id or short option */ const char *comment; /* option comment, for autom. --help */ gptr *value; /* The variable value */ gptr *u_max_value; /* The user def. max variable value */ const char **str_values; /* Pointer to possible values */ enum get_opt_var_type var_type; enum get_opt_arg_type arg_type; - int id; /* unique id or short option */ longlong def_value; /* Default value */ longlong min_value; /* Min allowed value */ longlong max_value; /* Max allowed value */ @@ -44,6 +37,8 @@ struct my_option int app_type; /* To be used by an application */ }; +extern char *disabled_my_option; + extern int handle_options (int *argc, char ***argv, const struct my_option *longopts, my_bool (*get_one_option)(int, @@ -51,3 +46,5 @@ extern int handle_options (int *argc, char ***argv, char *)); extern void my_print_help(const struct my_option *options); extern void my_print_variables(const struct my_option *options); + +C_MODE_END diff --git a/include/my_global.h b/include/my_global.h index 6a7385e18a2..2b5c6915ad9 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -132,6 +132,14 @@ /* #define _AIX32_CURSES */ /* XXX: this breaks AIX 4.3.3 (others?). */ #endif +#ifdef __QNXNTO__ +#define HAVE_ERRNO_AS_DEFINE +#define HAVE_FCNTL_LOCK +#undef HAVE_SYS_UN_H +#undef HAVE_FINITE +#undef HAVE_RINT +#endif + #ifdef HAVE_BROKEN_SNPRINTF /* HPUX 10.20 don't have this defined */ #undef HAVE_SNPRINTF #endif @@ -314,6 +322,7 @@ typedef unsigned short ushort; #define set_if_bigger(a,b) { if ((a) < (b)) (a)=(b); } #define set_if_smaller(a,b) { if ((a) > (b)) (a)=(b); } #define test_all_bits(a,b) (((a) & (b)) == (b)) +#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1)) #define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0]))) #ifndef HAVE_RINT #define rint(A) floor((A)+0.5) @@ -1014,4 +1023,12 @@ typedef union { #define C_MODE_END #endif +/* + Now if query is taken off then tests with query cache fails + SANJA TODO: remove this when problem with mysql-test will be solved +*/ +#if defined(MYSQL_SERVER) && !defined(HAVE_QUERY_CACHE) +#define HAVE_QUERY_CACHE +#endif + #endif /* _global_h */ diff --git a/include/my_pthread.h b/include/my_pthread.h index 4ca42339897..cfc1ea326f4 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -602,6 +602,11 @@ struct st_my_thread_var extern struct st_my_thread_var *_my_thread_var(void) __attribute__ ((const)); #define my_thread_var (_my_thread_var()) #define my_errno my_thread_var->thr_errno +/* + Keep track of shutdown,signal, and main threads so that my_end() will not + report errors with them +*/ +extern pthread_t shutdown_th, main_th, signal_th; /* statistics_xxx functions are for not essential statistic */ diff --git a/include/my_sys.h b/include/my_sys.h index ab6ae170651..3b69092d5ae 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -127,6 +127,7 @@ extern int NEAR my_errno; /* Last error in mysys */ #ifdef SAFEMALLOC #define my_malloc(SZ,FLAG) _mymalloc( SZ, __FILE__, __LINE__, FLAG ) +#define my_malloc_ci(SZ,FLAG) _mymalloc( SZ, sFile, uLine, FLAG ) #define my_realloc(PTR,SZ,FLAG) _myrealloc( PTR, SZ, __FILE__, __LINE__, FLAG ) #define my_checkmalloc() _sanity( __FILE__, __LINE__ ) #define my_free(PTR,FLAG) _myfree( PTR, __FILE__, __LINE__,FLAG) @@ -136,6 +137,10 @@ extern int NEAR my_errno; /* Last error in mysys */ #define NORMAL_SAFEMALLOC sf_malloc_quick=0 extern uint sf_malloc_prehunc,sf_malloc_endhunc,sf_malloc_quick; extern ulonglong safemalloc_mem_limit; + +#define CALLER_INFO_PROTO , const char *sFile, uint uLine +#define CALLER_INFO , __FILE__, __LINE__ +#define ORIG_CALLER_INFO , sFile, uLine #else #define my_checkmalloc() (0) #undef TERMINATE @@ -143,11 +148,15 @@ extern ulonglong safemalloc_mem_limit; #define QUICK_SAFEMALLOC #define NORMAL_SAFEMALLOC extern gptr my_malloc(uint Size,myf MyFlags); +#define my_malloc_ci(SZ,FLAG) my_malloc( SZ, FLAG ) extern gptr my_realloc(gptr oldpoint,uint Size,myf MyFlags); extern void my_no_flags_free(gptr ptr); extern gptr my_memdup(const byte *from,uint length,myf MyFlags); extern my_string my_strdup(const char *from,myf MyFlags); #define my_free(PTR,FG) my_no_flags_free(PTR) +#define CALLER_INFO_PROTO /* nothing */ +#define CALLER_INFO /* nothing */ +#define ORIG_CALLER_INFO /* nothing */ #endif #ifdef HAVE_ALLOCA #define my_alloca(SZ) alloca((size_t) (SZ)) @@ -653,8 +662,10 @@ extern my_bool real_open_cached_file(IO_CACHE *cache); extern void close_cached_file(IO_CACHE *cache); File create_temp_file(char *to, const char *dir, const char *pfx, int mode, myf MyFlags); -extern my_bool init_dynamic_array(DYNAMIC_ARRAY *array,uint element_size, - uint init_alloc,uint alloc_increment); +#define init_dynamic_array(A,B,C,D) _init_dynamic_array(A,B,C,D CALLER_INFO) +#define init_dynamic_array_ci(A,B,C,D) _init_dynamic_array(A,B,C,D ORIG_CALLER_INFO) +extern my_bool _init_dynamic_array(DYNAMIC_ARRAY *array,uint element_size, + uint init_alloc,uint alloc_increment CALLER_INFO_PROTO); extern my_bool insert_dynamic(DYNAMIC_ARRAY *array,gptr element); extern byte *alloc_dynamic(DYNAMIC_ARRAY *array); extern byte *pop_dynamic(DYNAMIC_ARRAY*); @@ -707,6 +718,12 @@ 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(SAFE_MUTEX) && !defined(DBUG_OFF) +#define DBUG_ASSERT_LOCK(lock) DBUG_ASSERT((lock)->count == 1 && \ + (lock)->thread == pthread_self()) +#else +#define DBUG_ASSERT_LOCK(lock) +#endif #if defined(_MSC_VER) && !defined(__WIN__) extern void sleep(int sec); diff --git a/include/myisam.h b/include/myisam.h index 5325f06ec71..ecf34a7e156 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -257,36 +257,51 @@ extern uint mi_get_pointer_length(ulonglong file_length, uint def); /* definitions needed for myisamchk.c -- by Sasha Pachev */ -#define T_VERBOSE 1 -#define T_SILENT 2 -#define T_DESCRIPT 4 -#define T_EXTEND 8 -#define T_INFO 16 -#define T_REP 32 -#define T_OPT 64 /* Not currently used */ -#define T_FORCE_CREATE 128 -#define T_WRITE_LOOP 256 -#define T_UNPACK 512 -#define T_STATISTICS 1024 -#define T_VERY_SILENT 2048 -#define T_SORT_RECORDS 4096 -#define T_SORT_INDEX 8192 -#define T_WAIT_FOREVER 16384 -#define T_REP_BY_SORT 32768L -#define T_FAST 65536L -#define T_READONLY 131072L -#define T_MEDIUM T_READONLY*2 -#define T_AUTO_INC T_MEDIUM*2 -#define T_CHECK T_AUTO_INC*2 -#define T_UPDATE_STATE T_CHECK*2 -#define T_CHECK_ONLY_CHANGED T_UPDATE_STATE*2 -#define T_DONT_CHECK_CHECKSUM T_CHECK_ONLY_CHANGED*2 -#define T_TRUST_HEADER T_DONT_CHECK_CHECKSUM*2 -#define T_CREATE_MISSING_KEYS T_TRUST_HEADER*2 -#define T_SAFE_REPAIR T_CREATE_MISSING_KEYS*2 -#define T_AUTO_REPAIR T_SAFE_REPAIR*2 -#define T_BACKUP_DATA T_AUTO_REPAIR*2 -#define T_CALC_CHECKSUM T_BACKUP_DATA*2 +/* entries marked as "QQ to be removed" are NOT used to + * pass check/repair options to mi_check.c. They are used + * internally by myisamchk.c or/and ha_myisam.cc and should NOT + * be stored together with other flags. They should be removed + * from the following list to make adding of new flags possible. + * -- Sergei */ + +#define T_VERBOSE 1 +#define T_SILENT 2 +#define T_DESCRIPT 4 +#define T_EXTEND 8 +#define T_INFO 16 +#define T_REP 32 +#define T_FORCE_UNIQUENESS 64 +#define T_FORCE_CREATE 128 +#define T_WRITE_LOOP 256 +#define T_UNPACK 512 +#define T_STATISTICS (1L << 10) +#define T_VERY_SILENT (1L << 11) +#define T_SORT_RECORDS (1L << 12) /* QQ to be removed */ +#define T_SORT_INDEX (1L << 13) /* QQ to be removed */ +#define T_WAIT_FOREVER (1L << 14) +#define T_REP_BY_SORT (1L << 15) +#define T_FAST (1L << 16) /* QQ to be removed */ +#define T_READONLY (1L << 17) /* QQ to be removed */ +#define T_MEDIUM (1L << 18) +#define T_AUTO_INC (1L << 19) +#define T_CHECK (1L << 20) /* QQ to be removed */ +#define T_UPDATE_STATE (1L << 21) +#define T_CHECK_ONLY_CHANGED (1L << 22) /* QQ to be removed */ +#define T_DONT_CHECK_CHECKSUM (1L << 23) +#define T_TRUST_HEADER (1L << 24) +#define T_CREATE_MISSING_KEYS (1L << 25) +#define T_SAFE_REPAIR (1L << 26) +#define T_AUTO_REPAIR (1L << 27) /* QQ to be removed */ +#define T_BACKUP_DATA (1L << 28) +#define T_CALC_CHECKSUM (1L << 29) +#define T_QUICK (1L << 30) +#define T_RETRY_WITHOUT_QUICK (1L << 31) + +/* flags used by myisamchk.c or/and ha_myisam.cc that are NOT passed + * to mi_check.c follows: + * */ + +#define TT_USEFRM 1 #define O_NEW_INDEX 1 /* Bits set in out_flag */ #define O_NEW_DATA 2 @@ -331,13 +346,12 @@ typedef struct st_mi_check_param ha_checksum record_checksum,glob_crc; ulong use_buffers,read_buffer_length,write_buffer_length, sort_buffer_length,sort_key_blocks; - uint out_flag,warning_printed,error_printed, - opt_rep_quick,verbose; + uint out_flag,warning_printed,error_printed,verbose; uint opt_sort_key,total_files,max_level; uint testflag; uint8 language; my_bool using_global_keycache, opt_lock_memory, opt_follow_links; - my_bool retry_repair,retry_without_quick, force_sort, calc_checksum; + my_bool retry_repair, force_sort, calc_checksum; char temp_filename[FN_REFLEN],*isam_file_name,*tmpdir; int tmpfile_createflag; myf myf_rw; diff --git a/include/mysql.h b/include/mysql.h index 074ea0a1876..7a16cbbe1d2 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -272,15 +272,15 @@ my_bool STDCALL mysql_eof(MYSQL_RES *res); MYSQL_FIELD *STDCALL mysql_fetch_field_direct(MYSQL_RES *res, unsigned int fieldnr); MYSQL_FIELD * STDCALL mysql_fetch_fields(MYSQL_RES *res); -MYSQL_ROWS * STDCALL mysql_row_tell(MYSQL_RES *res); -unsigned int STDCALL mysql_field_tell(MYSQL_RES *res); +MYSQL_ROW_OFFSET STDCALL mysql_row_tell(MYSQL_RES *res); +MYSQL_FIELD_OFFSET STDCALL mysql_field_tell(MYSQL_RES *res); unsigned int STDCALL mysql_field_count(MYSQL *mysql); my_ulonglong STDCALL mysql_affected_rows(MYSQL *mysql); my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql); unsigned int STDCALL mysql_errno(MYSQL *mysql); -char * STDCALL mysql_error(MYSQL *mysql); -char * STDCALL mysql_info(MYSQL *mysql); +const char * STDCALL mysql_error(MYSQL *mysql); +const char * STDCALL mysql_info(MYSQL *mysql); unsigned long STDCALL mysql_thread_id(MYSQL *mysql); const char * STDCALL mysql_character_set_name(MYSQL *mysql); @@ -353,10 +353,10 @@ int STDCALL mysql_refresh(MYSQL *mysql, unsigned int refresh_options); int STDCALL mysql_kill(MYSQL *mysql,unsigned long pid); int STDCALL mysql_ping(MYSQL *mysql); -char * STDCALL mysql_stat(MYSQL *mysql); -char * STDCALL mysql_get_server_info(MYSQL *mysql); -char * STDCALL mysql_get_client_info(void); -char * STDCALL mysql_get_host_info(MYSQL *mysql); +const char * STDCALL mysql_stat(MYSQL *mysql); +const char * STDCALL mysql_get_server_info(MYSQL *mysql); +const char * STDCALL mysql_get_client_info(void); +const char * STDCALL mysql_get_host_info(MYSQL *mysql); unsigned int STDCALL mysql_get_proto_info(MYSQL *mysql); MYSQL_RES * STDCALL mysql_list_dbs(MYSQL *mysql,const char *wild); MYSQL_RES * STDCALL mysql_list_tables(MYSQL *mysql,const char *wild); @@ -370,7 +370,8 @@ int STDCALL mysql_options(MYSQL *mysql,enum mysql_option option, void STDCALL mysql_free_result(MYSQL_RES *result); void STDCALL mysql_data_seek(MYSQL_RES *result, my_ulonglong offset); -MYSQL_ROW_OFFSET STDCALL mysql_row_seek(MYSQL_RES *result, MYSQL_ROW_OFFSET); +MYSQL_ROW_OFFSET STDCALL mysql_row_seek(MYSQL_RES *result, + MYSQL_ROW_OFFSET offset); MYSQL_FIELD_OFFSET STDCALL mysql_field_seek(MYSQL_RES *result, MYSQL_FIELD_OFFSET offset); MYSQL_ROW STDCALL mysql_fetch_row(MYSQL_RES *result); diff --git a/include/mysql_com.h b/include/mysql_com.h index cc887cc7c83..0e54c0e992b 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -67,7 +67,7 @@ enum enum_server_command {COM_SLEEP,COM_QUIT,COM_INIT_DB,COM_QUERY, #define REFRESH_TABLES 4 /* close all tables */ #define REFRESH_HOSTS 8 /* Flush host cache */ #define REFRESH_STATUS 16 /* Flush status variables */ -#define REFRESH_THREADS 32 /* Flush status variables */ +#define REFRESH_THREADS 32 /* Flush thread cache */ #define REFRESH_SLAVE 64 /* Reset master info and restart slave thread */ #define REFRESH_MASTER 128 /* Remove all bin logs in the index @@ -91,7 +91,6 @@ enum enum_server_command {COM_SLEEP,COM_QUIT,COM_INIT_DB,COM_QUERY, #define CLIENT_ODBC 64 /* Odbc client */ #define CLIENT_LOCAL_FILES 128 /* Can use LOAD DATA LOCAL */ #define CLIENT_IGNORE_SPACE 256 /* Ignore spaces before '(' */ -#define CLIENT_CHANGE_USER 512 /* Support the mysql_change_user() */ #define CLIENT_INTERACTIVE 1024 /* This is an interactive client */ #define CLIENT_SSL 2048 /* Switch to SSL after handshake */ #define CLIENT_IGNORE_SIGPIPE 4096 /* IGNORE sigpipes */ @@ -108,8 +107,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_CHAR_WIDTH 255 // Max length for a CHAR colum -#define MAX_BLOB_WIDTH 8192 // Default width for blob +#define MAX_CHAR_WIDTH 255 /* Max length for a CHAR colum */ +#define MAX_BLOB_WIDTH 8192 /* Default width for blob */ typedef struct st_net { Vio* vio; diff --git a/include/sslopt-case.h b/include/sslopt-case.h index ae6026f9136..e6e3a416bb0 100644 --- a/include/sslopt-case.h +++ b/include/sslopt-case.h @@ -20,8 +20,8 @@ break; case OPT_SSL_KEY: opt_use_ssl = 1; /* true */ - my_free(opt_ssl_key, MYF(MY_ALLOW_ZERO_PTR)); - opt_ssl_key = my_strdup(optarg, MYF(0)); +//QQ to be removed??? my_free(opt_ssl_key, MYF(MY_ALLOW_ZERO_PTR)); +//QQ to be removed??? opt_ssl_key = my_strdup(optarg, MYF(0)); break; case OPT_SSL_CERT: opt_use_ssl = 1; /* true */ diff --git a/include/sslopt-longopts.h b/include/sslopt-longopts.h index 2a0f27f3235..d82c833c439 100644 --- a/include/sslopt-longopts.h +++ b/include/sslopt-longopts.h @@ -16,17 +16,26 @@ #ifdef HAVE_OPENSSL -#define OPT_SSL_SSL 200 -#define OPT_SSL_KEY 201 -#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}, + {"ssl", OPT_SSL_SSL, + "Use SSL for connection (automatically set with other flags)", + (gptr*) &opt_use_ssl, (gptr*) &opt_use_ssl, 0, GET_BOOL, NO_ARG, 0, 0, 0, + 0, 0, 0}, + {"ssl-key", OPT_SSL_KEY, "X509 key in PEM format (implies --ssl)", + (gptr*) &opt_ssl_key, (gptr*) &opt_ssl_key, 0, GET_STR, REQUIRED_ARG, + 0, 0, 0, 0, 0, 0}, + {"ssl-cert", OPT_SSL_CERT, "X509 cert in PEM format (implies --ssl)", + (gptr*) &opt_ssl_cert, (gptr*) &opt_ssl_cert, 0, GET_STR, REQUIRED_ARG, + 0, 0, 0, 0, 0, 0}, + {"ssl-ca", OPT_SSL_CA, + "CA file in PEM format (check OpenSSL docs, implies --ssl)", + (gptr*) &opt_ssl_ca, (gptr*) &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG, + 0, 0, 0, 0, 0, 0}, + {"ssl-capath", OPT_SSL_CAPATH, + "CA directory (check OpenSSL docs, implies --ssl)", + (gptr*) &opt_ssl_capath, (gptr*) &opt_ssl_capath, 0, GET_STR, REQUIRED_ARG, + 0, 0, 0, 0, 0, 0}, + {"ssl-cipher", OPT_SSL_CAPATH, "SSL cipher to use (implies --ssl)", + (gptr*) &opt_ssl_cipher, (gptr*) &opt_ssl_cipher, 0, GET_STR, REQUIRED_ARG, + 0, 0, 0, 0, 0, 0}, #endif /* HAVE_OPENSSL */ |