diff options
author | unknown <monty@mysql.com> | 2004-07-07 11:29:39 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-07-07 11:29:39 +0300 |
commit | 11b8987313aab1eb8d9f829731fa0dcd83bf62f5 (patch) | |
tree | ca8974710746bb69b04a49bc64f938d0b1a8420a /include | |
parent | c92670d80b3674fa025e373e0498eccbb407f873 (diff) | |
parent | 9890cd9a9eb37083d13370947fa50d64e21e54ff (diff) | |
download | mariadb-git-11b8987313aab1eb8d9f829731fa0dcd83bf62f5.tar.gz |
Merge with 4.1.3-beta
BitKeeper/etc/ignore:
auto-union
BitKeeper/etc/logging_ok:
auto-union
VC++Files/libmysqld/libmysqld.dsp:
Auto merged
VC++Files/sql/mysqld.dsp:
Auto merged
client/mysql.cc:
Auto merged
client/mysqlbinlog.cc:
Auto merged
client/mysqltest.c:
Auto merged
include/config-netware.h:
Auto merged
include/my_base.h:
Auto merged
include/my_global.h:
Auto merged
include/my_sys.h:
Auto merged
include/mysql_com.h:
Auto merged
include/sql_state.h:
Auto merged
innobase/include/row0mysql.h:
Auto merged
innobase/row/row0sel.c:
Auto merged
libmysql/libmysql.c:
Auto merged
libmysqld/lib_sql.cc:
Auto merged
myisam/mi_check.c:
Auto merged
mysql-test/r/bdb.result:
Auto merged
mysql-test/r/connect.result:
Auto merged
mysql-test/r/ctype_ucs.result:
Auto merged
mysql-test/r/derived.result:
Auto merged
mysql-test/r/func_group.result:
Auto merged
mysql-test/r/func_like.result:
Auto merged
mysql-test/r/func_sapdb.result:
Auto merged
mysql-test/r/func_time.result:
Auto merged
mysql-test/r/insert.result:
Auto merged
mysql-test/r/insert_select.result:
Auto merged
mysql-test/r/join_outer.result:
Auto merged
mysql-test/r/key.result:
Auto merged
mysql-test/r/multi_update.result:
Auto merged
mysql-test/r/mysqldump.result:
Auto merged
mysql-test/r/null.result:
Auto merged
mysql-test/r/null_key.result:
Auto merged
mysql-test/r/query_cache.result:
Auto merged
mysql-test/r/rpl_rotate_logs.result:
Auto merged
mysql-test/r/rpl_server_id1.result:
Auto merged
mysql-test/r/rpl_until.result:
Auto merged
mysql-test/r/select.result:
Auto merged
mysql-test/r/show_check.result:
Auto merged
mysql-test/r/subselect.result:
Auto merged
mysql-test/r/system_mysql_db.result:
Auto merged
mysql-test/r/union.result:
Auto merged
mysql-test/r/variables.result:
Auto merged
mysql-test/t/multi_update.test:
Auto merged
mysql-test/t/mysqlbinlog.test:
Auto merged
mysql-test/t/rpl000015.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
mysql-test/t/variables.test:
Auto merged
mysys/mf_iocache2.c:
Auto merged
mysys/my_bitmap.c:
Auto merged
mysys/my_pthread.c:
Auto merged
netware/Makefile.am:
Auto merged
netware/my_manage.c:
Auto merged
netware/mysql_test_run.c:
Auto merged
netware/BUILD/compile-linux-tools:
Auto merged
netware/BUILD/compile-netware-standard:
Auto merged
netware/BUILD/mwenv:
Auto merged
netware/BUILD/nwbootstrap:
Auto merged
scripts/make_binary_distribution.sh:
Auto merged
scripts/mysql_install_db.sh:
Auto merged
sql/ha_berkeley.cc:
Auto merged
sql/ha_berkeley.h:
Auto merged
sql/ha_heap.h:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/item_create.cc:
Auto merged
sql/item_create.h:
Auto merged
sql/item_func.h:
Auto merged
sql/item_subselect.cc:
Auto merged
sql/item_sum.cc:
Auto merged
sql/item_sum.h:
Auto merged
sql/item_timefunc.h:
Auto merged
sql/lex.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/net_serv.cc:
Auto merged
sql/protocol.cc:
Auto merged
sql/protocol.h:
Auto merged
sql/records.cc:
Auto merged
sql/repl_failsafe.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_acl.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_cache.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_derived.cc:
Auto merged
sql/sql_load.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_string.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/structs.h:
Auto merged
sql-common/client.c:
Auto merged
configure.in:
Merge with 4.1
include/mysqld_error.h:
New errors from 4.1
libmysqld/Makefile.am:
Merge with 4.1
myisam/myisamchk.c:
Merge with 4.1
myisam/myisamdef.h:
Merge with 4.1
myisam/sort.c:
Merge with 4.1
mysql-test/r/mysqlbinlog.result:
Merge with 4.1
mysql-test/r/range.result:
Merge with 4.1
mysql-test/r/rpl_flush_log_loop.result:
Merge with 4.1
mysql-test/r/rpl_replicate_do.result:
Merge with 4.1
mysql-test/r/rpl_temporary.result:
Merge with 4.1
mysql-test/r/rpl_user_variables.result:
Merge with 4.1
mysql-test/t/func_time.test:
Merge with 4.1
scripts/mysql_create_system_tables.sh:
Merge with 4.1
scripts/mysql_fix_privilege_tables.sql:
Merge with 4.1
sql/Makefile.am:
Merge with 4.1
sql/filesort.cc:
Merge with 4.1
sql/ha_innodb.cc:
Merge with 4.1
sql/ha_innodb.h:
Merge with 4.1
sql/ha_myisam.cc:
Merge with 4.1
sql/handler.cc:
Merge with 4.1
sql/handler.h:
Merge with 4.1
sql/item_func.cc:
Merge with 4.1
sql/item_timefunc.cc:
Merge with 4.1
sql/log.cc:
Merge with 4.1
sql/log_event.cc:
Merge with 4.1
sql/mysqld.cc:
Merge with 4.1
sql/opt_range.cc:
Merge with 4.1
sql/opt_range.h:
Merge with 4.1
sql/share/czech/errmsg.txt:
Merge with 4.1
Updated english error messages
sql/share/danish/errmsg.txt:
Merge with 4.1
sql/share/dutch/errmsg.txt:
Merge with 4.1
sql/share/english/errmsg.txt:
Merge with 4.1
sql/share/estonian/errmsg.txt:
Merge with 4.1
sql/share/french/errmsg.txt:
Merge with 4.1
sql/share/german/errmsg.txt:
Merge with 4.1
sql/share/greek/errmsg.txt:
Merge with 4.1
sql/share/hungarian/errmsg.txt:
Merge with 4.1
sql/share/italian/errmsg.txt:
Merge with 4.1
sql/share/japanese/errmsg.txt:
Merge with 4.1
sql/share/korean/errmsg.txt:
Merge with 4.1
sql/share/norwegian-ny/errmsg.txt:
Merge with 4.1
sql/share/norwegian/errmsg.txt:
Merge with 4.1
sql/share/polish/errmsg.txt:
Merge with 4.1
sql/share/portuguese/errmsg.txt:
Merge with 4.1
sql/share/romanian/errmsg.txt:
Merge with 4.1
sql/share/russian/errmsg.txt:
Merge with 4.1
sql/share/serbian/errmsg.txt:
Merge with 4.1
sql/share/slovak/errmsg.txt:
Merge with 4.1
sql/share/spanish/errmsg.txt:
Merge with 4.1
sql/share/swedish/errmsg.txt:
Merge with 4.1
sql/share/ukrainian/errmsg.txt:
Merge with 4.1
sql/slave.cc:
Merge with 4.1
sql/sql_class.cc:
Merge with 4.1
sql/sql_class.h:
Merge with 4.1
sql/sql_db.cc:
Merge with 4.1
sql/sql_insert.cc:
Merge with 4.1
sql/sql_lex.cc:
Merge with 4.1
sql/sql_lex.h:
Merge with 4.1
sql/sql_parse.cc:
Merge with 4.1 tree
Changed // comments to /* */
sql/sql_prepare.cc:
Merge with 4.1
sql/sql_select.cc:
Merge with 4.1
sql/sql_table.cc:
Merge with 4.1
sql/sql_yacc.yy:
Merge with 4.1
sql/table.h:
Merge with 4.1
tests/client_test.c:
Merge with 4.1
Diffstat (limited to 'include')
-rw-r--r-- | include/Makefile.am | 6 | ||||
-rw-r--r-- | include/config-netware.h | 4 | ||||
-rw-r--r-- | include/errmsg.h | 8 | ||||
-rw-r--r-- | include/m_ctype.h | 17 | ||||
-rw-r--r-- | include/m_string.h | 16 | ||||
-rw-r--r-- | include/my_base.h | 3 | ||||
-rw-r--r-- | include/my_dbug.h | 1 | ||||
-rw-r--r-- | include/my_global.h | 90 | ||||
-rw-r--r-- | include/my_time.h | 46 | ||||
-rw-r--r-- | include/myisam.h | 2 | ||||
-rw-r--r-- | include/myisampack.h | 7 | ||||
-rw-r--r-- | include/mysql.h | 42 | ||||
-rw-r--r-- | include/mysql_com.h | 35 | ||||
-rw-r--r-- | include/mysql_time.h | 37 | ||||
-rw-r--r-- | include/mysqld_error.h | 90 | ||||
-rw-r--r-- | include/sql_state.h | 6 | ||||
-rw-r--r-- | include/violite.h | 8 |
17 files changed, 270 insertions, 148 deletions
diff --git a/include/Makefile.am b/include/Makefile.am index 01b8f295be4..0c845900a4f 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -22,15 +22,15 @@ pkginclude_HEADERS = my_dbug.h m_string.h my_sys.h my_list.h my_xml.h \ errmsg.h my_global.h my_net.h my_alloc.h \ my_getopt.h sslopt-longopts.h my_dir.h typelib.h \ sslopt-vars.h sslopt-case.h sql_common.h keycache.h \ - sql_state.h $(BUILT_SOURCES) + sql_state.h mysql_time.h $(BUILT_SOURCES) noinst_HEADERS = config-win.h config-os2.h config-netware.h \ nisam.h heap.h merge.h my_bitmap.h\ myisam.h myisampack.h myisammrg.h ft_global.h\ - mysys_err.h my_base.h \ + mysys_err.h my_base.h help_start.h help_end.h \ my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \ my_aes.h my_tree.h hash.h thr_alarm.h \ thr_lock.h t_ctype.h violite.h md5.h \ - mysql_version.h.in my_handler.h + mysql_version.h.in my_handler.h my_time.h # mysql_version.h are generated SUPERCLEANFILES = mysql_version.h my_config.h diff --git a/include/config-netware.h b/include/config-netware.h index c4e63056353..3e145f566a1 100644 --- a/include/config-netware.h +++ b/include/config-netware.h @@ -57,6 +57,10 @@ extern "C" { #undef HAVE_CRYPT #endif /* HAVE_OPENSSL */ +/* Configure can't detect this because it uses AC_TRY_RUN */ +#undef HAVE_COMPRESS +#define HAVE_COMPRESS + /* include the old function apis */ #define USE_OLD_FUNCTIONS 1 diff --git a/include/errmsg.h b/include/errmsg.h index 140ff531248..6115b24a3d8 100644 --- a/include/errmsg.h +++ b/include/errmsg.h @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* Error messages for mysql clients */ -/* error messages for the demon is in share/language/errmsg.sys */ +/* Error messages for MySQL clients */ +/* (Error messages for the daemon are in share/language/errmsg.sys) */ #ifdef __cplusplus extern "C" { @@ -83,10 +83,10 @@ extern const char *client_errors[]; /* Error messages */ #define CR_SHARED_MEMORY_FILE_MAP_ERROR 2042 #define CR_SHARED_MEMORY_MAP_ERROR 2043 #define CR_SHARED_MEMORY_EVENT_ERROR 2044 -#define CR_SHARED_MEMORY_CONNECT_ABANDODED_ERROR 2045 +#define CR_SHARED_MEMORY_CONNECT_ABANDONED_ERROR 2045 #define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2046 #define CR_CONN_UNKNOW_PROTOCOL 2047 #define CR_INVALID_CONN_HANDLE 2048 #define CR_SECURE_AUTH 2049 -#define CR_FETCH_CANCELLED 2050 +#define CR_FETCH_CANCELED 2050 #define CR_NO_DATA 2051 diff --git a/include/m_ctype.h b/include/m_ctype.h index 9502805b017..785fa431385 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -53,7 +53,6 @@ typedef struct unicase_info_st #define MY_SEQ_SPACES 2 /* My charsets_list flags */ -#define MY_NO_SETS 0 #define MY_CS_COMPILED 1 /* compiled-in sets */ #define MY_CS_CONFIG 2 /* sets that have a *.conf file */ #define MY_CS_INDEX 4 /* sets listed in the Index file */ @@ -62,7 +61,7 @@ typedef struct unicase_info_st #define MY_CS_PRIMARY 32 /* if primary collation */ #define MY_CS_STRNXFRM 64 /* if strnxfrm is used for sort */ #define MY_CS_UNICODE 128 /* is a charset is full unicode */ -#define MY_CS_NONTEXT 256 /* if a charset is not sprintf() compatible */ +#define MY_CS_READY 256 /* if a charset is initialized */ #define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/ #define MY_CHARSET_UNDEFINED 0 @@ -102,9 +101,10 @@ struct charset_info_st; typedef struct my_collation_handler_st { + my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint)); /* Collation routines */ int (*strnncoll)(struct charset_info_st *, - const uchar *, uint, const uchar *, uint); + const uchar *, uint, const uchar *, uint, my_bool); int (*strnncollsp)(struct charset_info_st *, const uchar *, uint, const uchar *, uint); int (*strnxfrm)(struct charset_info_st *, @@ -140,6 +140,7 @@ extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler; typedef struct my_charset_handler_st { + my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint)); /* Multibyte routines */ int (*ismbchar)(struct charset_info_st *, const char *, const char *); int (*mbcharlen)(struct charset_info_st *, uint); @@ -200,15 +201,17 @@ typedef struct charset_info_st const char *csname; const char *name; const char *comment; + const char *tailoring; uchar *ctype; uchar *to_lower; uchar *to_upper; uchar *sort_order; + uint16 *contractions; uint16 **sort_order_big; uint16 *tab_to_uni; MY_UNI_IDX *tab_from_uni; - uchar state_map[256]; - uchar ident_map[256]; + uchar *state_map; + uchar *ident_map; uint strxfrm_multiply; uint mbminlen; uint mbmaxlen; @@ -251,7 +254,7 @@ extern CHARSET_INFO my_charset_cp1250_czech_ci; extern int my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar *, uint); extern int my_strnncoll_simple(CHARSET_INFO *, const uchar *, uint, - const uchar *, uint); + const uchar *, uint, my_bool); extern int my_strnncollsp_simple(CHARSET_INFO *, const uchar *, uint, const uchar *, uint); @@ -385,7 +388,7 @@ extern my_bool my_parse_charset_xml(const char *bug, uint len, #define my_binary_compare(s) ((s)->state & MY_CS_BINSORT) #define use_strnxfrm(s) ((s)->state & MY_CS_STRNXFRM) #define my_strnxfrm(s, a, b, c, d) ((s)->coll->strnxfrm((s), (a), (b), (c), (d))) -#define my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c), (d))) +#define my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c), (d), 0)) #define my_like_range(s, a, b, c, d, e, f, g, h, i, j) \ ((s)->coll->like_range((s), (a), (b), (c), (d), (e), (f), (g), (h), (i), (j))) #define my_wildcmp(cs,s,se,w,we,e,o,m) ((cs)->coll->wildcmp((cs),(s),(se),(w),(we),(e),(o),(m))) diff --git a/include/m_string.h b/include/m_string.h index 371e20d130f..0709dbaffb4 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -95,7 +95,9 @@ extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 */ #endif #endif -extern char NEAR _dig_vec[]; /* Declared in int2str() */ +/* Declared in int2str() */ +extern char NEAR _dig_vec_upper[]; +extern char NEAR _dig_vec_lower[]; #ifdef BAD_STRING_COMPILER #define strmov(A,B) (memccpy(A,B,0,INT_MAX)-1) @@ -113,8 +115,6 @@ extern char NEAR _dig_vec[]; /* Declared in int2str() */ #ifdef MSDOS #undef bmove_align #define bmove512(A,B,C) bmove_align(A,B,C) -#define my_itoa(A,B,C) itoa(A,B,C) -#define my_ltoa(A,B,C) ltoa(A,B,C) extern void bmove_align(gptr dst,const gptr src,uint len); #endif @@ -123,7 +123,6 @@ extern void bmove_align(gptr dst,const gptr src,uint len); #endif #ifdef HAVE_purify -#include <assert.h> #define memcpy_overlap(A,B,C) \ DBUG_ASSERT((A) <= (B) || ((B)+(C)) <= (A)); \ bmove((byte*) (A),(byte*) (B),(size_t) (C)); @@ -219,24 +218,19 @@ extern int is_prefix(const char *, const char *); double my_strtod(const char *str, char **end); double my_atof(const char *nptr); -#ifdef USE_MY_ITOA -extern char *my_itoa(int val,char *dst,int radix); -extern char *my_ltoa(long val,char *dst,int radix); -#endif - extern char *llstr(longlong value,char *buff); #ifndef HAVE_STRTOUL extern long strtol(const char *str, char **ptr, int base); extern ulong strtoul(const char *str, char **ptr, int base); #endif -extern char *int2str(long val,char *dst,int radix); +extern char *int2str(long val, char *dst, int radix, int upcase); extern char *int10_to_str(long val,char *dst,int radix); extern char *str2int(const char *src,int radix,long lower,long upper, long *val); longlong my_strtoll10(const char *nptr, char **endptr, int *error); #if SIZEOF_LONG == SIZEOF_LONG_LONG -#define longlong2str(A,B,C) int2str((A),(B),(C)) +#define longlong2str(A,B,C) int2str((A),(B),(C),1) #define longlong10_to_str(A,B,C) int10_to_str((A),(B),(C)) #undef strtoll #define strtoll(A,B,C) strtol((A),(B),(C)) diff --git a/include/my_base.h b/include/my_base.h index dd8918da858..583cd473936 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -383,7 +383,4 @@ typedef ulong ha_rows; #define MAX_FILE_SIZE LONGLONG_MAX #endif -/* Currently used for saying which interfaces a Storage Engine implements */ -#define HA_ERR_NOT_IMPLEMENTED -1 - #endif /* _my_base_h */ diff --git a/include/my_dbug.h b/include/my_dbug.h index 5c88e2e42db..9174a8b1ef9 100644 --- a/include/my_dbug.h +++ b/include/my_dbug.h @@ -16,6 +16,7 @@ #ifndef _dbug_h #define _dbug_h + #ifdef __cplusplus extern "C" { #endif diff --git a/include/my_global.h b/include/my_global.h index af58139fb29..6490a775e7c 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -178,7 +178,11 @@ C_MODE_END #ifdef HAVE_BROKEN_SNPRINTF /* HPUX 10.20 don't have this defined */ #undef HAVE_SNPRINTF #endif -#ifdef HAVE_BROKEN_PREAD /* These doesn't work on HPUX 11.x */ +#ifdef HAVE_BROKEN_PREAD +/* + pread()/pwrite() are not 64 bit safe on HP-UX 11.0 without + installing the kernel patch PHKL_20349 or greater +*/ #undef HAVE_PREAD #undef HAVE_PWRITE #endif @@ -309,6 +313,13 @@ C_MODE_END #include <crypt.h> #endif +/* + A lot of our programs uses asserts, so better to always include it + This also fixes a problem when people uses DBUG_ASSERT without including + assert.h +*/ +#include <assert.h> + /* Go around some bugs in different OS and compilers */ #if defined(_HPUX_SOURCE) && defined(HAVE_SYS_STREAM_H) #include <sys/stream.h> /* HPUX 10.20 defines ulong here. UGLY !!! */ @@ -587,12 +598,6 @@ typedef SOCKET_SIZE_TYPE size_socket; #define USE_MY_STAT_STRUCT /* For my_lib */ #endif -/* Some things that this system does have */ - -#ifndef HAVE_ITOA -#define USE_MY_ITOA /* There is no itoa */ -#endif - /* Some defines of functions for portability */ #undef remove /* Crashes MySQL on SCO 5.0.0 */ @@ -1033,22 +1038,22 @@ do { doubleget_union _tmp; \ 32)) #define int2store(T,A) do { uint def_temp= (uint) (A) ;\ *((uchar*) (T))= (uchar)(def_temp); \ - *((uchar*) (T+1))=(uchar)((def_temp >> 8)); \ + *((uchar*) (T)+1)=(uchar)((def_temp >> 8)); \ } while(0) #define int3store(T,A) do { /*lint -save -e734 */\ *((uchar*)(T))=(uchar) ((A));\ *((uchar*) (T)+1)=(uchar) (((A) >> 8));\ *((uchar*)(T)+2)=(uchar) (((A) >> 16)); \ /*lint -restore */} while(0) -#define int4store(T,A) do { *(T)=(char) ((A));\ - *((T)+1)=(char) (((A) >> 8));\ - *((T)+2)=(char) (((A) >> 16));\ - *((T)+3)=(char) (((A) >> 24)); } while(0) -#define int5store(T,A) do { *(T)=((A));\ - *((T)+1)=(((A) >> 8));\ - *((T)+2)=(((A) >> 16));\ - *((T)+3)=(((A) >> 24)); \ - *((T)+4)=(((A) >> 32)); } while(0) +#define int4store(T,A) do { *((char *)(T))=(char) ((A));\ + *(((char *)(T))+1)=(char) (((A) >> 8));\ + *(((char *)(T))+2)=(char) (((A) >> 16));\ + *(((char *)(T))+3)=(char) (((A) >> 24)); } while(0) +#define int5store(T,A) do { *((char *)(T))=((A));\ + *(((char *)(T))+1)=(((A) >> 8));\ + *(((char *)(T))+2)=(((A) >> 16));\ + *(((char *)(T))+3)=(((A) >> 24)); \ + *(((char *)(T))+4)=(((A) >> 32)); } while(0) #define int8store(T,A) do { uint def_temp= (uint) (A), def_temp2= (uint) ((A) >> 32); \ int4store((T),def_temp); \ int4store((T+4),def_temp2); } while(0) @@ -1089,13 +1094,14 @@ do { doubleget_union _tmp; \ #if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN) #define doublestore(T,V) do { *(T)= ((byte *) &V)[4];\ - *((T)+1)=(char) ((byte *) &V)[5];\ - *((T)+2)=(char) ((byte *) &V)[6];\ - *((T)+3)=(char) ((byte *) &V)[7];\ - *((T)+4)=(char) ((byte *) &V)[0];\ - *((T)+5)=(char) ((byte *) &V)[1];\ - *((T)+6)=(char) ((byte *) &V)[2];\ - *((T)+7)=(char) ((byte *) &V)[3]; } while(0) + *(((char*)T)+1)=(char) ((byte *) &V)[5];\ + *(((char*)T)+2)=(char) ((byte *) &V)[6];\ + *(((char*)T)+3)=(char) ((byte *) &V)[7];\ + *(((char*)T)+4)=(char) ((byte *) &V)[0];\ + *(((char*)T)+5)=(char) ((byte *) &V)[1];\ + *(((char*)T)+6)=(char) ((byte *) &V)[2];\ + *(((char*)T)+7)=(char) ((byte *) &V)[3]; }\ + while(0) #define doubleget(V,M) do { double def_temp;\ ((byte*) &def_temp)[0]=(M)[4];\ ((byte*) &def_temp)[1]=(M)[5];\ @@ -1115,6 +1121,14 @@ do { doubleget_union _tmp; \ #endif /* sint2korr */ /* + Macro for reading 32-bit integer from network byte order (big-endian) + from unaligned memory location. +*/ +#define int4net(A) (int32) (((uint32) ((uchar) (A)[3])) |\ + (((uint32) ((uchar) (A)[2])) << 8) |\ + (((uint32) ((uchar) (A)[1])) << 16) |\ + (((uint32) ((uchar) (A)[0])) << 24)) +/* Define-funktions for reading and storing in machine format from/to short/long to/from some place in memory V should be a (not register) variable, M is a pointer to byte @@ -1139,12 +1153,12 @@ do { doubleget_union _tmp; \ ((byte*) &def_temp)[3]=(M)[3];\ (V)=def_temp; } while(0) #define shortstore(T,A) do { uint def_temp=(uint) (A) ;\ - *(T+1)=(char)(def_temp); \ - *(T+0)=(char)(def_temp >> 8); } while(0) -#define longstore(T,A) do { *((T)+3)=((A));\ - *((T)+2)=(((A) >> 8));\ - *((T)+1)=(((A) >> 16));\ - *((T)+0)=(((A) >> 24)); } while(0) + *(((char*)T)+1)=(char)(def_temp); \ + *(((char*)T)+0)=(char)(def_temp >> 8); } while(0) +#define longstore(T,A) do { *(((char*)T)+3)=((A));\ + *(((char*)T)+2)=(((A) >> 8));\ + *(((char*)T)+1)=(((A) >> 16));\ + *(((char*)T)+0)=(((A) >> 24)); } while(0) #define floatstore(T,V) memcpy_fixed((byte*)(T), (byte*)(&V), sizeof(float)) #define doubleget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(double)) @@ -1191,22 +1205,14 @@ do { doubleget_union _tmp; \ #define statistic_add(V,C,L) (V)+=(C) #endif -#ifdef HAVE_OPENSSL -#include <openssl/opensslv.h> -#if OPENSSL_VERSION_NUMBER < 0x0090700f -#define DES_cblock des_cblock -#define DES_key_schedule des_key_schedule -#define DES_set_key_unchecked(k,ks) des_set_key_unchecked((k),*(ks)) -#define DES_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e) des_ede3_cbc_encrypt((i),(o),(l),*(k1),*(k2),*(k3),(iv),(e)) -#endif -#endif - #ifdef HAVE_CHARSET_utf8 #define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8" #else #define MYSQL_UNIVERSAL_CLIENT_CHARSET MYSQL_DEFAULT_CHARSET_NAME #endif -#define HAVE_SPATIAL -#define HAVE_RTREE_KEYS +#if defined(EMBEDDED_LIBRARY) && !defined(HAVE_EMBEDDED_PRIVILEGE_CONTROL) +#define NO_EMBEDDED_ACCESS_CHECKS +#endif + #endif /* my_global_h */ diff --git a/include/my_time.h b/include/my_time.h new file mode 100644 index 00000000000..e42f7e9e402 --- /dev/null +++ b/include/my_time.h @@ -0,0 +1,46 @@ +/* Copyright (C) 2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB + + 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; either version 2 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + 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 */ + +/* + This is a private header of sql-common library, containing + declarations for my_time.c +*/ + +#ifndef _my_time_h_ +#define _my_time_h_ +#include "my_global.h" +#include "mysql_time.h" + +C_MODE_START + +extern ulonglong log_10_int[20]; + +#define YY_PART_YEAR 70 + +/* Flags to str_to_datetime */ +#define TIME_FUZZY_DATE 1 +#define TIME_DATETIME_ONLY 2 + +enum enum_mysql_timestamp_type +str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, + uint flags, int *was_cut); + +bool str_to_time(const char *str,uint length, MYSQL_TIME *l_time, + int *was_cut); + +C_MODE_END + +#endif /* _my_time_h_ */ diff --git a/include/myisam.h b/include/myisam.h index c99e9a30b08..02c56115dfd 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -47,7 +47,7 @@ extern "C" { #define MI_NAME_IEXT ".MYI" #define MI_NAME_DEXT ".MYD" /* Max extra space to use when sorting keys */ -#define MI_MAX_TEMP_LENGTH 256*1024L*1024L +#define MI_MAX_TEMP_LENGTH 2*1024L*1024L*1024L /* Possible values for myisam_block_size (must be power of 2) */ #define MI_KEY_BLOCK_LENGTH 1024 /* default key block length */ diff --git a/include/myisampack.h b/include/myisampack.h index 95793e2aaeb..06c94fea75f 100644 --- a/include/myisampack.h +++ b/include/myisampack.h @@ -21,6 +21,10 @@ better compression */ +/* these two are for uniformity */ +#define mi_sint1korr(A) (int8)(*A) +#define mi_uint1korr(A) (uint8)(*A) + #define mi_sint2korr(A) (int16) (((int16) ((uchar) (A)[1])) +\ ((int16) ((int16) (A)[0]) << 8)) #define mi_sint3korr(A) ((int32) ((((uchar) (A)[0]) & 128) ? \ @@ -75,6 +79,9 @@ (((uint32) ((uchar) (A)[0])) << 24))) <<\ 32)) +/* This one is for uniformity */ +#define mi_int1store(T,A) *((uchar*)(T))= (uchar) (A) + #define mi_int2store(T,A) { uint def_temp= (uint) (A) ;\ *((uchar*) ((T)+1))= (uchar)(def_temp); \ *((uchar*) ((T)+0))= (uchar)(def_temp >> 8); } diff --git a/include/mysql.h b/include/mysql.h index 51540a7d89f..0f3fdc90548 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -55,6 +55,7 @@ typedef int my_socket; #endif /* _global_h */ #include "mysql_com.h" +#include "mysql_time.h" #include "mysql_version.h" #include "typelib.h" @@ -77,7 +78,6 @@ extern char *mysql_unix_port; #define IS_NUM_FIELD(f) ((f)->flags & NUM_FLAG) #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) -#define HAVE_DEPRECATED_411_API 1 typedef struct st_mysql_field { char *name; /* Name of column */ @@ -302,7 +302,6 @@ typedef struct st_mysql_res { #endif - typedef struct st_mysql_manager { NET net; @@ -317,6 +316,17 @@ typedef struct st_mysql_manager char last_error[MAX_MYSQL_MANAGER_ERR]; } MYSQL_MANAGER; +typedef struct st_mysql_parameters +{ + unsigned long *p_max_allowed_packet; + unsigned long *p_net_buffer_length; +} MYSQL_PARAMETERS; + +#if !defined(MYSQL_SERVER) && !defined(EMBEDDED_LIBRARY) +#define max_allowed_packet (*mysql_get_parameters()->p_max_allowed_packet) +#define net_buffer_length (*mysql_get_parameters()->p_net_buffer_length) +#endif + /* Set up and bring down the server; to ensure that applications will work when linked against either the standard client library or the @@ -325,6 +335,8 @@ typedef struct st_mysql_manager int STDCALL mysql_server_init(int argc, char **argv, char **groups); void STDCALL mysql_server_end(void); +MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void); + /* Set up and bring down a thread; these function should be called for each thread in an application which opens at least one MySQL @@ -441,7 +453,9 @@ int STDCALL mysql_add_slave(MYSQL* mysql, const char* host, const char* user, const char* passwd); -int STDCALL mysql_shutdown(MYSQL *mysql); +int STDCALL mysql_shutdown(MYSQL *mysql, + enum enum_shutdown_level + shutdown_level); int STDCALL mysql_dump_debug_info(MYSQL *mysql); int STDCALL mysql_refresh(MYSQL *mysql, unsigned int refresh_options); @@ -519,34 +533,17 @@ enum enum_mysql_stmt_state MYSQL_STMT_FETCH_DONE }; -/* - client TIME structure to handle TIME, DATE and TIMESTAMP directly in - binary protocol -*/ -enum mysql_st_timestamp_type { MYSQL_TIMESTAMP_NONE, MYSQL_TIMESTAMP_DATE, - MYSQL_TIMESTAMP_FULL, MYSQL_TIMESTAMP_TIME }; - -typedef struct mysql_st_time -{ - unsigned int year,month,day,hour,minute,second; - unsigned long second_part; - my_bool neg; - - enum mysql_st_timestamp_type time_type; - -} MYSQL_TIME; - /* bind structure */ typedef struct st_mysql_bind { unsigned long *length; /* output length pointer */ my_bool *is_null; /* Pointer to null indicators */ - char *buffer; /* buffer to get/put data */ + void *buffer; /* buffer to get/put data */ enum enum_field_types buffer_type; /* buffer type */ unsigned long buffer_length; /* buffer length, must be set for str/binary */ - /* Following are for internal use. Set by mysql_bind_param */ + /* Following are for internal use. Set by mysql_stmt_bind_param */ unsigned char *inter_buffer; /* for the current data position */ unsigned long offset; /* offset position for char/binary fetch */ unsigned long internal_length; /* Used if length is 0 */ @@ -698,6 +695,7 @@ void STDCALL mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong offset); my_ulonglong STDCALL mysql_stmt_num_rows(MYSQL_STMT *stmt); my_ulonglong STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt); my_ulonglong STDCALL mysql_stmt_insert_id(MYSQL_STMT *stmt); +unsigned int STDCALL mysql_stmt_field_count(MYSQL_STMT *stmt); my_bool STDCALL mysql_commit(MYSQL * mysql); my_bool STDCALL mysql_rollback(MYSQL * mysql); diff --git a/include/mysql_com.h b/include/mysql_com.h index b4947a64236..ea375128455 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -36,12 +36,6 @@ #define MYSQL_SERVICENAME "MySQL" #endif /* __WIN__ */ -#if defined(__WIN__) && !defined(MYSQL_SERVER) && !defined(MYSQL_CLIENT) && !defined(EMBEDDED_LIBRARY) -#define dll_import_spec __declspec( dllimport ) -#else -#define dll_import_spec -#endif - enum enum_server_command { COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST, @@ -232,6 +226,32 @@ enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY, #define FIELD_TYPE_INTERVAL MYSQL_TYPE_ENUM #define FIELD_TYPE_GEOMETRY MYSQL_TYPE_GEOMETRY +enum enum_shutdown_level { + /* + We want levels to be in growing order of hardness. So we leave room + for future intermediate levels. For now, escalating one level is += 10; + later if we insert new levels in between we will need a function + next_shutdown_level(level). Note that DEFAULT does not respect the + growing property. + */ + SHUTDOWN_DEFAULT= 0, /* mapped to WAIT_ALL_BUFFERS for now */ + /* + Here is the list in growing order (the next does the previous plus + something). WAIT_ALL_BUFFERS is what we have now. Others are "this MySQL + server does not support this shutdown level yet". + */ + SHUTDOWN_WAIT_CONNECTIONS= 10, /* wait for existing connections to finish */ + SHUTDOWN_WAIT_TRANSACTIONS= 20, /* wait for existing trans to finish */ + SHUTDOWN_WAIT_STATEMENTS= 30, /* wait for existing updating stmts to finish */ + SHUTDOWN_WAIT_ALL_BUFFERS= 40, /* flush InnoDB buffers */ + SHUTDOWN_WAIT_CRITICAL_BUFFERS= 50, /* flush MyISAM buffs (no corruption) */ + /* Now the 2 levels of the KILL command */ +#if MYSQL_VERSION_ID >= 50000 + KILL_QUERY= 254, +#endif + KILL_CONNECTION= 255 +}; + /* options for mysql_set_option */ enum enum_mysql_set_option { @@ -317,9 +337,6 @@ typedef struct st_udf_init extern "C" { #endif -dll_import_spec extern unsigned long max_allowed_packet; -dll_import_spec extern unsigned long net_buffer_length; - /* These functions are used for authentication by client and server and implemented in sql/password.c diff --git a/include/mysql_time.h b/include/mysql_time.h new file mode 100644 index 00000000000..943d018fc14 --- /dev/null +++ b/include/mysql_time.h @@ -0,0 +1,37 @@ +/* Copyright (C) 2004 MySQL AB & MySQL Finland AB & TCX DataKonsult AB + + 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; either version 2 of the License, or + (at your option) any later version. + + 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 General Public License for more details. + + 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 _mysql_time_h_ +#define _mysql_time_h_ + +/* Time declarations shared between server and client library */ + +enum enum_mysql_timestamp_type +{ + MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1, + MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2 +}; + + +typedef struct st_mysql_time +{ + unsigned int year, month, day, hour, minute, second; + unsigned long second_part; + my_bool neg; + enum enum_mysql_timestamp_type time_type; +} MYSQL_TIME; + +#endif /* _mysql_time_h_ */ diff --git a/include/mysqld_error.h b/include/mysqld_error.h index b5ea5b911c1..840b9c7f42a 100644 --- a/include/mysqld_error.h +++ b/include/mysqld_error.h @@ -312,46 +312,50 @@ #define ER_TOO_MUCH_AUTO_TIMESTAMP_COLS 1293 #define ER_INVALID_ON_UPDATE 1294 #define ER_UNSUPPORTED_PS 1295 -#define ER_SP_NO_RECURSIVE_CREATE 1296 -#define ER_SP_ALREADY_EXISTS 1297 -#define ER_SP_DOES_NOT_EXIST 1298 -#define ER_SP_DROP_FAILED 1299 -#define ER_SP_STORE_FAILED 1300 -#define ER_SP_LILABEL_MISMATCH 1301 -#define ER_SP_LABEL_REDEFINE 1302 -#define ER_SP_LABEL_MISMATCH 1303 -#define ER_SP_UNINIT_VAR 1304 -#define ER_SP_BADSELECT 1305 -#define ER_SP_BADRETURN 1306 -#define ER_SP_BADSTATEMENT 1307 -#define ER_UPDATE_LOG_DEPRECATED_IGNORED 1308 -#define ER_UPDATE_LOG_DEPRECATED_TRANSLATED 1309 -#define ER_QUERY_INTERRUPTED 1310 -#define ER_SP_WRONG_NO_OF_ARGS 1311 -#define ER_SP_COND_MISMATCH 1312 -#define ER_SP_NORETURN 1313 -#define ER_SP_NORETURNEND 1314 -#define ER_SP_BAD_CURSOR_QUERY 1315 -#define ER_SP_BAD_CURSOR_SELECT 1316 -#define ER_SP_CURSOR_MISMATCH 1317 -#define ER_SP_CURSOR_ALREADY_OPEN 1318 -#define ER_SP_CURSOR_NOT_OPEN 1319 -#define ER_SP_UNDECLARED_VAR 1320 -#define ER_SP_WRONG_NO_OF_FETCH_ARGS 1321 -#define ER_SP_FETCH_NO_DATA 1322 -#define ER_SP_DUP_PARAM 1323 -#define ER_SP_DUP_VAR 1324 -#define ER_SP_DUP_COND 1325 -#define ER_SP_DUP_CURS 1326 -#define ER_SP_CANT_ALTER 1327 -#define ER_SP_SUBSELECT_NYI 1328 -#define ER_SP_NO_USE 1329 -#define ER_SP_VARCOND_AFTER_CURSHNDLR 1330 -#define ER_SP_CURSOR_AFTER_HANDLER 1331 -#define ER_SP_CASE_NOT_FOUND 1332 -#define ER_FPARSER_TOO_BIG_FILE 1333 -#define ER_FPARSER_BAD_HEADER 1334 -#define ER_FPARSER_EOF_IN_COMMENT 1335 -#define ER_FPARSER_ERROR_IN_PARAMETER 1336 -#define ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER 1337 -#define ER_ERROR_MESSAGES 338 +#define ER_GET_ERRMSG 1296 +#define ER_GET_TEMPORARY_ERRMSG 1297 +#define ER_UNKNOWN_TIME_ZONE 1298 +#define ER_WARN_INVALID_TIMESTAMP 1299 +#define ER_SP_NO_RECURSIVE_CREATE 1300 +#define ER_SP_ALREADY_EXISTS 1301 +#define ER_SP_DOES_NOT_EXIST 1302 +#define ER_SP_DROP_FAILED 1303 +#define ER_SP_STORE_FAILED 1304 +#define ER_SP_LILABEL_MISMATCH 1305 +#define ER_SP_LABEL_REDEFINE 1306 +#define ER_SP_LABEL_MISMATCH 1307 +#define ER_SP_UNINIT_VAR 1308 +#define ER_SP_BADSELECT 1309 +#define ER_SP_BADRETURN 1310 +#define ER_SP_BADSTATEMENT 1311 +#define ER_UPDATE_LOG_DEPRECATED_IGNORED 1312 +#define ER_UPDATE_LOG_DEPRECATED_TRANSLATED 1313 +#define ER_QUERY_INTERRUPTED 1314 +#define ER_SP_WRONG_NO_OF_ARGS 1315 +#define ER_SP_COND_MISMATCH 1316 +#define ER_SP_NORETURN 1317 +#define ER_SP_NORETURNEND 1318 +#define ER_SP_BAD_CURSOR_QUERY 1319 +#define ER_SP_BAD_CURSOR_SELECT 1320 +#define ER_SP_CURSOR_MISMATCH 1321 +#define ER_SP_CURSOR_ALREADY_OPEN 1322 +#define ER_SP_CURSOR_NOT_OPEN 1323 +#define ER_SP_UNDECLARED_VAR 1324 +#define ER_SP_WRONG_NO_OF_FETCH_ARGS 1325 +#define ER_SP_FETCH_NO_DATA 1326 +#define ER_SP_DUP_PARAM 1327 +#define ER_SP_DUP_VAR 1328 +#define ER_SP_DUP_COND 1329 +#define ER_SP_DUP_CURS 1330 +#define ER_SP_CANT_ALTER 1331 +#define ER_SP_SUBSELECT_NYI 1332 +#define ER_SP_NO_USE 1333 +#define ER_SP_VARCOND_AFTER_CURSHNDLR 1334 +#define ER_SP_CURSOR_AFTER_HANDLER 1335 +#define ER_SP_CASE_NOT_FOUND 1336 +#define ER_FPARSER_TOO_BIG_FILE 1337 +#define ER_FPARSER_BAD_HEADER 1338 +#define ER_FPARSER_EOF_IN_COMMENT 1339 +#define ER_FPARSER_ERROR_IN_PARAMETER 1340 +#define ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER 1341 +#define ER_ERROR_MESSAGES 342 diff --git a/include/sql_state.h b/include/sql_state.h index 9eff300d494..7bf05203463 100644 --- a/include/sql_state.h +++ b/include/sql_state.h @@ -23,10 +23,10 @@ the second column is the ODBC state (which the 4.1 server sends out by default) and the last is the state used by the JDBC driver. If the last column is "" then it means that the JDBC driver is using the - ODBC state + ODBC state. - The errors in this file is sorted in the same order as in mysqld_error.h - to allow on to do binary searches for the sqlstate. + The errors in this file are sorted in the same order as in mysqld_error.h + to allow one to do binary searches for the sqlstate. */ ER_DUP_KEY, "23000", "", diff --git a/include/violite.h b/include/violite.h index b4b9f724d89..ba7de3ee175 100644 --- a/include/violite.h +++ b/include/violite.h @@ -83,6 +83,14 @@ my_bool vio_poll_read(Vio *vio,uint timeout); void vio_timeout(Vio *vio,uint timeout); #ifdef HAVE_OPENSSL +#include <openssl/opensslv.h> +#if OPENSSL_VERSION_NUMBER < 0x0090700f +#define DES_cblock des_cblock +#define DES_key_schedule des_key_schedule +#define DES_set_key_unchecked(k,ks) des_set_key_unchecked((k),*(ks)) +#define DES_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e) des_ede3_cbc_encrypt((i),(o),(l),*(k1),*(k2),*(k3),(iv),(e)) +#endif + #define HEADER_DES_LOCL_H dummy_something #include <openssl/ssl.h> #include <openssl/err.h> |