diff options
author | Mikael Ronström <mikael@dator9> | 2011-04-15 15:46:11 +0200 |
---|---|---|
committer | Mikael Ronström <mikael@dator9> | 2011-04-15 15:46:11 +0200 |
commit | 70ed67e1ccf8b1696e0c11aa6fb1e5fdb28875fb (patch) | |
tree | a3b95707a820bf6af5adbb68c73f6f51dbf5b473 /include | |
parent | 55557e223f6c89b16cbed2fecd90c26b519b6b92 (diff) | |
parent | 060541c02e6c332db0f08fa3b861cb2de305c71f (diff) | |
download | mariadb-git-70ed67e1ccf8b1696e0c11aa6fb1e5fdb28875fb.tar.gz |
Merge 5.5
Diffstat (limited to 'include')
-rw-r--r-- | include/decimal.h | 22 | ||||
-rw-r--r-- | include/heap.h | 2 | ||||
-rw-r--r-- | include/my_compare.h (renamed from include/my_handler.h) | 29 | ||||
-rw-r--r-- | include/my_global.h | 7 | ||||
-rw-r--r-- | include/my_net.h | 34 | ||||
-rw-r--r-- | include/myisam.h | 5 | ||||
-rw-r--r-- | include/mysql.h.pp | 2 | ||||
-rw-r--r-- | include/mysql_com.h | 4 | ||||
-rw-r--r-- | include/typelib.h | 14 | ||||
-rw-r--r-- | include/violite.h | 4 |
10 files changed, 50 insertions, 73 deletions
diff --git a/include/decimal.h b/include/decimal.h index 530ed9e1757..90946f65ac6 100644 --- a/include/decimal.h +++ b/include/decimal.h @@ -29,14 +29,14 @@ typedef struct st_decimal_t { int internal_str2dec(const char *from, decimal_t *to, char **end, my_bool fixed); -int decimal2string(decimal_t *from, char *to, int *to_len, +int decimal2string(const decimal_t *from, char *to, int *to_len, int fixed_precision, int fixed_decimals, char filler); int decimal2ulonglong(decimal_t *from, ulonglong *to); int ulonglong2decimal(ulonglong from, decimal_t *to); int decimal2longlong(decimal_t *from, longlong *to); int longlong2decimal(longlong from, decimal_t *to); -int decimal2double(decimal_t *from, double *to); +int decimal2double(const decimal_t *from, double *to); int double2decimal(double from, decimal_t *to); int decimal_actual_fraction(decimal_t *from); int decimal2bin(decimal_t *from, uchar *to, int precision, int scale); @@ -47,17 +47,17 @@ int decimal_bin_size(int precision, int scale); int decimal_result_size(decimal_t *from1, decimal_t *from2, char op, int param); -int decimal_intg(decimal_t *from); -int decimal_add(decimal_t *from1, decimal_t *from2, decimal_t *to); -int decimal_sub(decimal_t *from1, decimal_t *from2, decimal_t *to); -int decimal_cmp(decimal_t *from1, decimal_t *from2); -int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to); -int decimal_div(decimal_t *from1, decimal_t *from2, decimal_t *to, +int decimal_intg(const decimal_t *from); +int decimal_add(const decimal_t *from1, const decimal_t *from2, decimal_t *to); +int decimal_sub(const decimal_t *from1, const decimal_t *from2, decimal_t *to); +int decimal_cmp(const decimal_t *from1, const decimal_t *from2); +int decimal_mul(const decimal_t *from1, const decimal_t *from2, decimal_t *to); +int decimal_div(const decimal_t *from1, const decimal_t *from2, decimal_t *to, int scale_incr); -int decimal_mod(decimal_t *from1, decimal_t *from2, decimal_t *to); -int decimal_round(decimal_t *from, decimal_t *to, int new_scale, +int decimal_mod(const decimal_t *from1, const decimal_t *from2, decimal_t *to); +int decimal_round(const decimal_t *from, decimal_t *to, int new_scale, decimal_round_mode mode); -int decimal_is_zero(decimal_t *from); +int decimal_is_zero(const decimal_t *from); void max_decimal(int precision, int frac, decimal_t *to); #define string2decimal(A,B,C) internal_str2dec((A), (B), (C), 0) diff --git a/include/heap.h b/include/heap.h index 755a1aa3fed..74851c7b454 100644 --- a/include/heap.h +++ b/include/heap.h @@ -30,7 +30,7 @@ extern "C" { #include <my_pthread.h> #include <thr_lock.h> -#include "my_handler.h" +#include "my_compare.h" #include "my_tree.h" /* defines used by heap-funktions */ diff --git a/include/my_handler.h b/include/my_compare.h index ba0d3fc313f..ebc91a912cd 100644 --- a/include/my_handler.h +++ b/include/my_compare.h @@ -1,22 +1,20 @@ -/* Copyright (C) 2002-2006 MySQL AB +/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; version 2 - of the License. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _my_handler_h -#define _my_handler_h +#ifndef _my_compare_h +#define _my_compare_h #include "myisampack.h" #ifdef __cplusplus @@ -114,9 +112,6 @@ extern int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a, register uchar *b, uint key_length, uint nextflag, uint *diff_pos); -extern HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a); -extern void my_handler_error_register(void); -extern void my_handler_error_unregister(void); /* Inside an in-memory data record, memory pointers to pieces of the record (like BLOBs) are stored in their native byte order and in @@ -127,4 +122,4 @@ extern void my_handler_error_unregister(void); } #endif -#endif /* _my_handler_h */ +#endif /* _my_compare_h */ diff --git a/include/my_global.h b/include/my_global.h index 02f4eb596d0..0ff4ea5484b 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB, 2009 Sun Microsystems, Inc +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -285,7 +285,7 @@ C_MODE_END #define ulonglong2double(A) my_ulonglong2double(A) #define my_off_t2double(A) my_ulonglong2double(A) C_MODE_START -double my_ulonglong2double(unsigned long long A); +inline double my_ulonglong2double(unsigned long long A) { return (double A); } C_MODE_END #endif /* _AIX */ @@ -301,9 +301,6 @@ C_MODE_END #undef HAVE_PWRITE #endif -#ifdef UNDEF_HAVE_GETHOSTBYNAME_R /* For OSF4.x */ -#undef HAVE_GETHOSTBYNAME_R -#endif #ifdef UNDEF_HAVE_INITGROUPS /* For AIX 4.3 */ #undef HAVE_INITGROUPS #endif diff --git a/include/my_net.h b/include/my_net.h index 5762f5da06e..ce2ee6ce8ca 100644 --- a/include/my_net.h +++ b/include/my_net.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -73,38 +73,6 @@ C_MODE_START #define in_addr_t uint32 #endif -/* - Handling of gethostbyname_r() -*/ - -#if !defined(HAVE_GETHOSTBYNAME_R) -struct hostent *my_gethostbyname_r(const char *name, - struct hostent *result, char *buffer, - int buflen, int *h_errnop); -void my_gethostbyname_r_free(); -#elif defined(HAVE_PTHREAD_ATTR_CREATE) || defined(_AIX) || defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) -struct hostent *my_gethostbyname_r(const char *name, - struct hostent *result, char *buffer, - int buflen, int *h_errnop); -#define my_gethostbyname_r_free() -#if !defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) && !defined(HPUX10) -#define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent_data) -#endif /* !defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) */ - -#elif defined(HAVE_GETHOSTBYNAME_R_RETURN_INT) -#define GETHOSTBYNAME_BUFF_SIZE sizeof(struct hostent_data) -struct hostent *my_gethostbyname_r(const char *name, - struct hostent *result, char *buffer, - int buflen, int *h_errnop); -#define my_gethostbyname_r_free() -#else -#define my_gethostbyname_r(A,B,C,D,E) gethostbyname_r((A),(B),(C),(D),(E)) -#define my_gethostbyname_r_free() -#endif /* !defined(HAVE_GETHOSTBYNAME_R) */ - -#ifndef GETHOSTBYNAME_BUFF_SIZE -#define GETHOSTBYNAME_BUFF_SIZE 2048 -#endif C_MODE_END #endif diff --git a/include/myisam.h b/include/myisam.h index cb641e12e8e..839bea1d18b 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc +/* Copyright (C) 2000, 2011, Oracle and/or its affiliates. All rights + reserved This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,7 +31,7 @@ extern "C" { #ifndef _keycache_h #include "keycache.h" #endif -#include "my_handler.h" +#include "my_compare.h" #include <mysql/plugin.h> /* diff --git a/include/mysql.h.pp b/include/mysql.h.pp index 0a5c3d83148..169a8b30e2b 100644 --- a/include/mysql.h.pp +++ b/include/mysql.h.pp @@ -227,7 +227,7 @@ typedef struct st_typelib { extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_position); extern int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option); -extern int find_type(char *x, const TYPELIB *typelib, unsigned int full_name); +extern int find_type(const char *x, const TYPELIB *typelib, unsigned int flags); extern void make_type(char *to,unsigned int nr,TYPELIB *typelib); extern const char *get_type(TYPELIB *typelib,unsigned int nr); extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); diff --git a/include/mysql_com.h b/include/mysql_com.h index f4c023721de..c35a604781d 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -114,6 +114,10 @@ enum enum_server_command #define FIELD_IN_PART_FUNC_FLAG (1 << 19)/* Field part of partition func */ #define FIELD_IN_ADD_INDEX (1<< 20) /* Intern: Field used in ADD INDEX */ #define FIELD_IS_RENAMED (1<< 21) /* Intern: Field is being renamed */ +#define FIELD_FLAGS_STORAGE_MEDIA 22 /* Field storage media, bit 22-23, + reserved by MySQL Cluster */ +#define FIELD_FLAGS_COLUMN_FORMAT 24 /* Field column format, bit 24-25, + reserved by MySQL Cluster */ #define REFRESH_GRANT 1 /* Refresh grant tables */ #define REFRESH_LOG 2 /* Start on new log file */ diff --git a/include/typelib.h b/include/typelib.h index 3badb14c96e..00dbafea34e 100644 --- a/include/typelib.h +++ b/include/typelib.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,7 +29,17 @@ typedef struct st_typelib { /* Different types saved here */ extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_position); extern int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option); -extern int find_type(char *x, const TYPELIB *typelib, unsigned int full_name); +#define FIND_TYPE_BASIC 0 +/** makes @c find_type() require the whole name, no prefix */ +#define FIND_TYPE_NO_PREFIX (1 << 0) +/** always implicitely on, so unused, but old code may pass it */ +#define FIND_TYPE_NO_OVERWRITE (1 << 1) +/** makes @c find_type() accept a number */ +#define FIND_TYPE_ALLOW_NUMBER (1 << 2) +/** makes @c find_type() treat ',' as terminator */ +#define FIND_TYPE_COMMA_TERM (1 << 3) + +extern int find_type(const char *x, const TYPELIB *typelib, unsigned int flags); extern void make_type(char *to,unsigned int nr,TYPELIB *typelib); extern const char *get_type(TYPELIB *typelib,unsigned int nr); extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); diff --git a/include/violite.h b/include/violite.h index f4083216894..140f021ebb4 100644 --- a/include/violite.h +++ b/include/violite.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -93,6 +93,8 @@ ssize_t vio_pending(Vio *vio); my_bool vio_get_normalized_ip_string(const struct sockaddr *addr, int addr_length, char *ip_string, size_t ip_string_size); +my_bool vio_is_no_name_error(int err_code); + int vio_getnameinfo(const struct sockaddr *sa, char *hostname, size_t hostname_size, char *port, size_t port_size, |