diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/config-win.h | 8 | ||||
-rw-r--r-- | include/hash.h | 1 | ||||
-rw-r--r-- | include/m_ctype.h | 20 | ||||
-rw-r--r-- | include/my_base.h | 3 | ||||
-rw-r--r-- | include/my_global.h | 10 | ||||
-rw-r--r-- | include/my_pthread.h | 1 | ||||
-rw-r--r-- | include/my_sys.h | 3 | ||||
-rw-r--r-- | include/my_time.h | 14 | ||||
-rw-r--r-- | include/myisam.h | 1 | ||||
-rw-r--r-- | include/mysql.h | 1 | ||||
-rw-r--r-- | include/mysql_com.h | 12 | ||||
-rw-r--r-- | include/sql_common.h | 1 | ||||
-rw-r--r-- | include/typelib.h | 1 |
13 files changed, 66 insertions, 10 deletions
diff --git a/include/config-win.h b/include/config-win.h index 0ba8dd2cf43..d28bb25cd09 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -229,7 +229,13 @@ inline double ulonglong2double(ulonglong value) ((uint32) (uchar) (A)[0]))) #define sint4korr(A) (*((long *) (A))) #define uint2korr(A) (*((uint16 *) (A))) -#define uint3korr(A) (long) (*((unsigned long *) (A)) & 0xFFFFFF) +/* + ATTENTION ! + + Please, note, uint3korr reads 4 bytes (not 3) ! + It means, that you have to provide enough allocated space ! +*/ +#define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF) #define uint4korr(A) (*((unsigned long *) (A))) #define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\ (((uint32) ((uchar) (A)[1])) << 8) +\ diff --git a/include/hash.h b/include/hash.h index c7cc118b7bd..cd7210a290c 100644 --- a/include/hash.h +++ b/include/hash.h @@ -47,6 +47,7 @@ my_bool _hash_init(HASH *hash, CHARSET_INFO *charset, uint key_length, hash_get_key get_key, void (*free_element)(void*), uint flags CALLER_INFO_PROTO); void hash_free(HASH *tree); +void hash_reset(HASH *hash); byte *hash_element(HASH *hash,uint idx); gptr hash_search(HASH *info,const byte *key,uint length); gptr hash_next(HASH *info,const byte *key,uint length); diff --git a/include/m_ctype.h b/include/m_ctype.h index 65b11f4c06a..ddc21070547 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -184,7 +184,8 @@ typedef struct my_charset_handler_st int base, char **e, int *err); double (*strntod)(struct charset_info_st *, char *s, uint l, char **e, int *err); - + longlong (*my_strtoll10)(struct charset_info_st *cs, + const char *nptr, char **endptr, int *error); ulong (*scan)(struct charset_info_st *, const char *b, const char *e, int sq); } MY_CHARSET_HANDLER; @@ -303,6 +304,11 @@ int my_long10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix, int my_longlong10_to_str_8bit(CHARSET_INFO *, char *to, uint l, int radix, longlong val); +longlong my_strtoll10_8bit(CHARSET_INFO *cs, + const char *nptr, char **endptr, int *error); +longlong my_strtoll10_ucs2(CHARSET_INFO *cs, + const char *nptr, char **endptr, int *error); + void my_fill_8bit(CHARSET_INFO *cs, char* to, uint l, int fill); my_bool my_like_range_simple(CHARSET_INFO *cs, @@ -312,6 +318,13 @@ my_bool my_like_range_simple(CHARSET_INFO *cs, char *min_str, char *max_str, uint *min_length, uint *max_length); +my_bool my_like_range_mb(CHARSET_INFO *cs, + const char *ptr, uint ptr_length, + pbool escape, pbool w_one, pbool w_many, + uint res_length, + char *min_str, char *max_str, + uint *min_length, uint *max_length); + my_bool my_like_range_ucs2(CHARSET_INFO *cs, const char *ptr, uint ptr_length, pbool escape, pbool w_one, pbool w_many, @@ -352,6 +365,11 @@ uint my_instr_mb(struct charset_info_st *, const char *s, uint s_length, my_match_t *match, uint nmatch); +int my_wildcmp_unicode(CHARSET_INFO *cs, + const char *str, const char *str_end, + const char *wildstr, const char *wildend, + int escape, int w_one, int w_many, + MY_UNICASE_INFO **weights); extern my_bool my_parse_charset_xml(const char *bug, uint len, int (*add)(CHARSET_INFO *cs)); diff --git a/include/my_base.h b/include/my_base.h index 583cd473936..815a1c76c0e 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -247,6 +247,7 @@ enum ha_base_keytype { #define HA_CREATE_TMP_TABLE 4 #define HA_CREATE_CHECKSUM 8 #define HA_CREATE_DELAY_KEY_WRITE 64 +#define HA_CREATE_FROM_ENGINE 128 /* Bits in flag to _status */ @@ -293,7 +294,7 @@ enum ha_base_keytype { #define HA_ERR_ROW_IS_REFERENCED 152 /* Cannot delete a parent row */ #define HA_ERR_NO_SAVEPOINT 153 /* No savepoint with that name */ #define HA_ERR_NON_UNIQUE_BLOCK_SIZE 154 /* Non unique key block size */ -#define HA_ERR_OLD_METADATA 155 /* The frm file on disk is old */ +#define HA_ERR_NO_SUCH_TABLE 155 /* The table does not exist in engine */ #define HA_ERR_TABLE_EXIST 156 /* The table existed in storage engine */ #define HA_ERR_NO_CONNECTION 157 /* Could not connect to storage engine */ diff --git a/include/my_global.h b/include/my_global.h index 684617695a7..0ace3123fae 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -724,7 +724,7 @@ typedef void *gptr; /* Generic pointer */ typedef char *gptr; /* Generic pointer */ #endif #ifndef HAVE_INT_8_16_32 -typedef char int8; /* Signed integer >= 8 bits */ +typedef signed char int8; /* Signed integer >= 8 bits */ typedef short int16; /* Signed integer >= 16 bits */ #endif #ifndef HAVE_UCHAR @@ -930,7 +930,13 @@ typedef char bool; /* Ordinary boolean values 0 1 */ (((uint32) ((uchar) (A)[1])) << 8) +\ (((uint32) ((uchar) (A)[2])) << 16)) #else -#define uint3korr(A) (long) (*((unsigned long *) (A)) & 0xFFFFFF) +/* + ATTENTION ! + + Please, note, uint3korr reads 4 bytes (not 3) ! + It means, that you have to provide enough allocated space ! +*/ +#define uint3korr(A) (long) (*((unsigned int *) (A)) & 0xFFFFFF) #endif #define uint4korr(A) (*((unsigned long *) (A))) #define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\ diff --git a/include/my_pthread.h b/include/my_pthread.h index 602a4439575..cd0cf49a891 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -234,7 +234,6 @@ extern int my_sigwait(const sigset_t *set,int *sig); #include <signal.h> #undef sigwait #endif -#undef _REENTRANT /* Fix if _REENTRANT is in pthread.h */ #include <pthread.h> #ifndef _REENTRANT #define _REENTRANT diff --git a/include/my_sys.h b/include/my_sys.h index cc40b7a7693..e99b2d343ff 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -738,7 +738,8 @@ extern void my_free_lock(byte *ptr,myf flags); #define my_free_lock(A,B) my_free((A),(B)) #endif #define alloc_root_inited(A) ((A)->min_malloc != 0) -#define clear_alloc_root(A) bzero((void *) (A), sizeof(MEM_ROOT)) +#define ALLOC_ROOT_MIN_BLOCK_SIZE (MALLOC_OVERHEAD + sizeof(USED_MEM) + 8) +#define clear_alloc_root(A) do { (A)->free= (A)->used= (A)->pre_alloc= 0; (A)->min_malloc=0;} while(0) extern void init_alloc_root(MEM_ROOT *mem_root, uint block_size, uint pre_alloc_size); extern gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size); diff --git a/include/my_time.h b/include/my_time.h index 332b26a15eb..c55eb051a1a 100644 --- a/include/my_time.h +++ b/include/my_time.h @@ -66,6 +66,20 @@ my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap) void set_zero_time(MYSQL_TIME *tm); +/* + Required buffer length for my_time_to_str, my_date_to_str, + my_datetime_to_str and TIME_to_string functions. Note, that the + caller is still responsible to check that given TIME structure + has values in valid ranges, otherwise size of the buffer could + be not enough. +*/ +#define MAX_DATE_STRING_REP_LENGTH 30 + +int my_time_to_str(const MYSQL_TIME *l_time, char *to); +int my_date_to_str(const MYSQL_TIME *l_time, char *to); +int my_datetime_to_str(const MYSQL_TIME *l_time, char *to); +int my_TIME_to_str(const MYSQL_TIME *l_time, char *to); + C_MODE_END #endif /* _my_time_h_ */ diff --git a/include/myisam.h b/include/myisam.h index 02c56115dfd..6d097770646 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -98,6 +98,7 @@ typedef struct st_mi_create_info ha_rows reloc_rows; ulonglong auto_increment; ulonglong data_file_length; + ulonglong key_file_length; uint raid_type,raid_chunks; ulong raid_chunksize; uint old_options; diff --git a/include/mysql.h b/include/mysql.h index 9d08bf5aa57..87c01c9903f 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -506,6 +506,7 @@ char * STDCALL mysql_odbc_escape_string(MYSQL *mysql, unsigned long *length)); void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name); unsigned int STDCALL mysql_thread_safe(void); +my_bool STDCALL mysql_embedded(void); MYSQL_MANAGER* STDCALL mysql_manager_init(MYSQL_MANAGER* con); MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con, const char* host, diff --git a/include/mysql_com.h b/include/mysql_com.h index 16a1581a6c9..09ee5b22286 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -50,13 +50,16 @@ enum enum_server_command COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE, COM_PREPARE, COM_EXECUTE, COM_LONG_DATA, COM_CLOSE_STMT, COM_RESET_STMT, COM_SET_OPTION, COM_FETCH, - COM_END /* Must be last */ + /* don't forget to update const char *command_name[] in sql_parse.cc */ + + /* Must be last */ + COM_END }; /* Length of random string sent by server on handshake; this is also length of - obfuscated password, recieved from client + obfuscated password, recieved from client */ #define SCRAMBLE_LENGTH 20 #define SCRAMBLE_LENGTH_323 8 @@ -155,6 +158,11 @@ enum enum_server_command struct st_vio; /* Only C */ typedef struct st_vio Vio; +#define MAX_TINYINT_WIDTH 3 /* Max width for a TINY w.o. sign */ +#define MAX_SMALLINT_WIDTH 5 /* Max width for a SHORT w.o. sign */ +#define MAX_MEDIUMINT_WIDTH 8 /* Max width for a INT24 w.o. sign */ +#define MAX_INT_WIDTH 10 /* Max width for a LONG w.o. sign */ +#define MAX_BIGINT_WIDTH 20 /* Max width for a LONGLONG */ #define MAX_CHAR_WIDTH 255 /* Max length for a CHAR colum */ #define MAX_BLOB_WIDTH 8192 /* Default width for blob */ diff --git a/include/sql_common.h b/include/sql_common.h index cde53786f83..c07a4a831bb 100644 --- a/include/sql_common.h +++ b/include/sql_common.h @@ -25,7 +25,6 @@ extern "C" { MYSQL_FIELD *unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, my_bool default_value, uint server_capabilities); void free_rows(MYSQL_DATA *cur); -my_bool mysql_autenticate(MYSQL *mysql, const char *passwd); void free_old_query(MYSQL *mysql); void end_server(MYSQL *mysql); my_bool mysql_reconnect(MYSQL *mysql); diff --git a/include/typelib.h b/include/typelib.h index 1b049d19a11..4d6a90ad51e 100644 --- a/include/typelib.h +++ b/include/typelib.h @@ -22,6 +22,7 @@ typedef struct st_typelib { /* Different types saved here */ unsigned int count; /* How many types */ const char *name; /* Name of typelib */ const char **type_names; + unsigned int *type_lengths; } TYPELIB; extern int find_type(char *x,TYPELIB *typelib,unsigned int full_name); |