Below is the list of changes that have just been committed into a local
5.0 repository of guilhem. When guilhem does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1964 05/05/10 15:14:01 guilhem@stripped +58 -0
Merge
sql/unireg.h
1.40 05/05/10 15:13:51 guilhem@stripped +0 -0
SCCS merged
sql/table.cc
1.162 05/05/10 15:13:36 guilhem@stripped +0 -4
SCCS merged
sql/sql_table.cc
1.243 05/05/10 15:12:12 guilhem@stripped +0 -0
SCCS merged
sql/sql_show.cc
1.244 05/05/10 15:11:40 guilhem@stripped +13 -9
SCCS merged
sql/sql_parse.cc
1.450 05/05/10 15:06:12 guilhem@stripped +0 -2
SCCS merged
sql/sql_map.cc
1.9 05/05/10 15:05:41 guilhem@stripped +1 -1
merge
sql/sql_db.cc
1.109 05/05/10 15:03:15 guilhem@stripped +0 -1
merge
sql/sql_acl.cc
1.151 05/05/10 15:02:24 guilhem@stripped +0 -0
SCCS merged
sql/slave.cc
1.246 05/05/10 15:02:09 guilhem@stripped +2 -3
merge
sql/mysqld.cc
1.466 05/05/10 15:01:27 guilhem@stripped +1 -2
merge
sql/mysql_priv.h
1.296 05/05/10 14:59:38 guilhem@stripped +1 -1
merge
sql/handler.cc
1.168 05/05/10 14:58:48 guilhem@stripped +0 -0
SCCS merged
sql/derror.cc
1.21 05/05/10 14:58:32 guilhem@stripped +0 -0
SCCS merged
sql/Makefile.am
1.106 05/05/10 14:58:11 guilhem@stripped +2 -2
merge
server-tools/instance-manager/mysqlmanager.cc
1.11 05/05/10 14:57:43 guilhem@stripped +4 -3
merge
netware/BUILD/compile-netware-START
1.6 05/05/10 14:56:45 guilhem@stripped +0 -0
SCCS merged
myisam/mi_open.c
1.91 05/05/10 14:56:19 guilhem@stripped +2 -2
merge
innobase/srv/srv0srv.c
1.90 05/05/10 14:41:57 guilhem@stripped +12 -0
merge
innobase/os/os0file.c
1.104 05/05/10 14:41:37 guilhem@stripped +2 -2
merge
innobase/include/trx0xa.h
1.4 05/05/10 14:40:50 guilhem@stripped +0 -2
merge
include/my_sys.h
1.139 05/05/10 14:40:23 guilhem@stripped +9 -0
to be fixed
BUILD/compile-pentium-valgrind-max
1.14 05/05/10 14:39:28 guilhem@stripped +0 -1
SCCS merged
configure.in
1.310 05/05/10 14:39:07 guilhem@stripped +51 -0
to be fixed
sql/unireg.cc
1.57 05/05/10 11:12:42 guilhem@stripped +0 -0
Auto merged
sql/sql_rename.cc
1.28 05/05/10 11:12:42 guilhem@stripped +0 -0
Auto merged
sql/sql_class.cc
1.161 05/05/10 11:12:41 guilhem@stripped +0 -0
Auto merged
sql/set_var.h
1.58 05/05/10 11:12:41 guilhem@stripped +0 -0
Auto merged
sql/set_var.cc
1.110 05/05/10 11:12:41 guilhem@stripped +0 -0
Auto merged
sql/protocol.h
1.26 05/05/10 11:12:40 guilhem@stripped +0 -0
Auto merged
sql/protocol.cc
1.103 05/05/10 11:12:40 guilhem@stripped +0 -0
Auto merged
sql/log.cc
1.162 05/05/10 11:12:40 guilhem@stripped +0 -0
Auto merged
sql/ha_myisam.cc
1.149 05/05/10 11:12:39 guilhem@stripped +0 -0
Auto merged
sql/ha_innodb.h
1.95 05/05/10 11:12:39 guilhem@stripped +0 -0
Auto merged
sql/ha_innodb.cc
1.208 05/05/10 11:12:39 guilhem@stripped +0 -0
Auto merged
netware/mysql_test_run.c
1.11 05/05/10 11:12:39 guilhem@stripped +0 -0
Auto merged
netware/my_manage.c
1.8 05/05/10 11:12:39 guilhem@stripped +0 -2
Auto merged
mysys/my_write.c
1.12 05/05/10 11:12:39 guilhem@stripped +0 -0
Auto merged
mysys/my_sync.c
1.5 05/05/10 11:12:39 guilhem@stripped +0 -0
Auto merged
mysys/my_symlink2.c
1.11 05/05/10 11:12:38 guilhem@stripped +0 -0
Auto merged
mysys/my_rename.c
1.8 05/05/10 11:12:38 guilhem@stripped +0 -0
Auto merged
mysys/my_open.c
1.20 05/05/10 11:12:38 guilhem@stripped +0 -0
Auto merged
mysys/Makefile.am
1.58 05/05/10 11:12:38 guilhem@stripped +0 -0
Auto merged
myisam/mi_create.c
1.46 05/05/10 11:12:38 guilhem@stripped +0 -0
Auto merged
myisam/Makefile.am
1.31 05/05/10 11:12:38 guilhem@stripped +0 -0
Auto merged
libmysql/Makefile.am
1.42 05/05/10 11:12:38 guilhem@stripped +0 -0
Auto merged
innobase/srv/srv0start.c
1.75 05/05/10 11:12:38 guilhem@stripped +0 -0
Auto merged
innobase/include/srv0start.h
1.14 05/05/10 11:12:38 guilhem@stripped +0 -0
Auto merged
innobase/include/srv0srv.h
1.55 05/05/10 11:12:38 guilhem@stripped +0 -0
Auto merged
innobase/include/os0file.h
1.35 05/05/10 11:12:38 guilhem@stripped +0 -0
Auto merged
innobase/buf/buf0flu.c
1.29 05/05/10 11:12:38 guilhem@stripped +0 -0
Auto merged
innobase/configure.in
1.31 05/05/10 11:12:37 guilhem@stripped +0 -0
Auto merged
include/mysql_embed.h
1.14 05/05/10 11:12:37 guilhem@stripped +0 -0
Auto merged
include/my_global.h
1.67 05/05/10 11:12:37 guilhem@stripped +0 -0
Auto merged
include/config-netware.h
1.8 05/05/10 11:12:37 guilhem@stripped +0 -0
Auto merged
BitKeeper/deleted/.del-mysqld_error.h~9dac75782467aab7
1.120 05/05/10 11:12:37 guilhem@stripped +0 -0
Auto merged
BitKeeper/deleted/.del-errmsg.txt~f96b7055cac394e
1.139 05/05/10 11:12:37 guilhem@stripped +0 -0
Auto merged
BitKeeper/deleted/.del-errmsg.txt~f96b7055cac394e
1.131.1.2 05/05/10 11:12:36 guilhem@stripped +0 -0
Merge rename: sql/share/english/errmsg.txt ->
BitKeeper/deleted/.del-errmsg.txt~f96b7055cac394e
BitKeeper/deleted/.del-mysqld_error.h~9dac75782467aab7
1.119 05/05/10 11:12:33 guilhem@stripped +0 -0
Merge rename: include/mysqld_error.h ->
BitKeeper/deleted/.del-mysqld_error.h~9dac75782467aab7
BitKeeper/etc/logging_ok
1.324 05/05/10 11:11:32 guilhem@stripped +0 -0
auto-union
BitKeeper/etc/ignore
1.200 05/05/10 11:11:31 guilhem@stripped +16 -16
auto-union
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: guilhem
# Host: gbichot2.local
# Root: /home/mysql_src/mysql-5.0-nov-backup/RESYNC
--- 1.309/configure.in 2005-05-09 18:40:30 +02:00
+++ 1.310/configure.in 2005-05-10 14:39:07 +02:00
@@ -56,6 +56,57 @@
italian japanese korean norwegian norwegian-ny polish portuguese \
romanian russian serbian slovak spanish swedish ukrainian"
+??????? gca configure.in 1.229
+# Generate make rules for all error messages
+AVAILABLE_LANGUAGES_ERRORS=
+AVAILABLE_LANGUAGES_ERRORS_RULES=$srcdir/ac_available_languages_fragment
+rm -f $AVAILABLE_LANGUAGES_ERRORS_RULES
+for i in $AVAILABLE_LANGUAGES
+do
+ AVAILABLE_LANGUAGES_ERRORS="$AVAILABLE_LANGUAGES_ERRORS $i/errmsg.sys"
+ case $host_os in
+ netware*)
+ echo "$i/errmsg.sys: $i/errmsg.txt
+ \$(top_builddir)/extra/comp_err.linux -C\$(srcdir)/charsets/ $i/errmsg.txt
$i/errmsg.sys" \
+ >> $AVAILABLE_LANGUAGES_ERRORS_RULES
+ ;;
+ *)
+ echo "$i/errmsg.sys: $i/errmsg.txt
+ \$(top_builddir)/extra/comp_err -C\$(srcdir)/charsets/ $i/errmsg.txt $i/errmsg.sys" \
+ >> $AVAILABLE_LANGUAGES_ERRORS_RULES
+ ;;
+ esac
+done
+
+??????? local configure.in 1.229.2.2
+# Generate make rules for all error messages
+AVAILABLE_LANGUAGES_ERRORS=
+AVAILABLE_LANGUAGES_ERRORS_RULES=$srcdir/ac_available_languages_fragment
+rm -f $AVAILABLE_LANGUAGES_ERRORS_RULES
+for i in $AVAILABLE_LANGUAGES
+do
+ AVAILABLE_LANGUAGES_ERRORS="$AVAILABLE_LANGUAGES_ERRORS $i/errmsg.sys"
+ case $host_os in
+ netware*)
+ # Generate make rules for NetWare error messages
+ AVAILABLE_LANGUAGES_ERRORS="$AVAILABLE_LANGUAGES_ERRORS $i/nwerrmsg.sys"
+ echo "$i/errmsg.sys: $i/errmsg.txt
+ \$(top_builddir)/extra/comp_err.linux -C\$(srcdir)/charsets/ $i/errmsg.txt
$i/errmsg.sys" \
+ >> $AVAILABLE_LANGUAGES_ERRORS_RULES
+ echo "$i/nwerrmsg.sys: $i/nwerrmsg.txt
+ \$(top_builddir)/extra/comp_err.linux -C\$(srcdir)/charsets/ \$^ $i/nwerrmsg.sys" \
+ >> $AVAILABLE_LANGUAGES_ERRORS_RULES
+ ;;
+ *)
+ echo "$i/errmsg.sys: $i/errmsg.txt
+ \$(top_builddir)/extra/comp_err -C\$(srcdir)/charsets/ $i/errmsg.txt $i/errmsg.sys" \
+ >> $AVAILABLE_LANGUAGES_ERRORS_RULES
+ ;;
+ esac
+done
+
+??????? remote configure.in 1.309
+>>>>>>>
#####
#####
@@ -1635,6 +1686,20 @@
DEBUG_OPTIMIZE_CXX="-DDEBUG"
OPTIMIZE_CFLAGS="-O3 -DNDEBUG"
OPTIMIZE_CXXFLAGS="-O3 -DNDEBUG"
+fi
+
+AC_MSG_CHECKING(if we should enable the snapshot online backup)
+AC_ARG_WITH(nwbackup,
+ [ --without-nwbackup Build a MySQL server without snapshot online backup ],
+ [ with_nwbackup=$withval ],
+ [ with_nwbackup=no ]
+ )
+if test "$with_nwbackup" = "yes"
+then
+ AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE_NETWARE_BACKUP], [1], [Enable snapshot online backup])
+else
+ AC_MSG_RESULT([no])
fi
AC_ARG_WITH(debug,
--- 1.138/include/my_sys.h 2005-03-16 08:06:10 +01:00
+++ 1.139/include/my_sys.h 2005-05-10 14:40:23 +02:00
@@ -43,6 +43,10 @@
#define MYSYS_PROGRAM_DONT_USE_CURSES() { error_handler_hook = my_message_no_curses;
mysys_uses_curses=0;}
#define MY_INIT(name); { my_progname= name; my_init(); }
+??????? gca include/my_sys.h 1.131
+#define MAXMAPS (4) /* Number of error message maps */
+#define ERRMOD (1000) /* Max number of errors in a map */
+??????? local include/my_sys.h 1.138
#ifdef __NETWARE__
#define MAXMAPS (5) /* Five because added one more map for NetWare error messages
Number of message maps for Netware is always 1 greater than number of message
maps for other platforms
@@ -51,6 +55,8 @@
#define MAXMAPS (4) /* Number of error message maps */
#endif
#define ERRMOD (1000) /* Max number of errors in a map */
+??????? remote include/my_sys.h 1.131.1.21
+>>>>>>>
#define ERRMSGSIZE (SC_MAXWIDTH) /* Max length of a error message */
#define NRERRBUFFS (2) /* Buffers for parameters */
#define MY_FILE_ERROR ((uint) ~0)
@@ -62,11 +68,10 @@
#define MY_FAE 8 /* Fatal if any error */
#define MY_WME 16 /* Write message on error */
#define MY_WAIT_IF_FULL 32 /* Wait and try again if disk full error */
-#define MY_RAID 64 /* Support for RAID (not the "Johnson&Johnson"-s one
;) */
-#define MY_FULL_IO 512 /* For my_read - loop intil I/O
- is complete
- */
-#define MY_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */
+#define MY_IGNORE_BADFD 32 /* my_sync: ignore 'bad descriptor' errors */
+#define MY_RAID 64 /* Support for RAID */
+#define MY_FULL_IO 512 /* For my_read - loop intil I/O is complete */
+#define MY_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */
#define MY_LINK_WARNING 32 /* my_redel() gives warning if links */
#define MY_COPYTIME 64 /* my_redel() copys time */
#define MY_DELETE_OLD 256 /* my_create_with_symlink() */
@@ -80,7 +85,7 @@
#define MY_FREE_ON_ERROR 128 /* my_realloc() ; Free old ptr on error */
#define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */
#define MY_THREADSAFE 128 /* pread/pwrite: Don't allow interrupts */
-#define MY_DONT_OVERWRITE_FILE 1024 /* my_copy; Don't overwrite file */
+#define MY_DONT_OVERWRITE_FILE 1024 /* my_copy: Don't overwrite file */
#define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */
#define MY_GIVE_INFO 2 /* Give time info about process*/
@@ -174,10 +179,24 @@
#define TRASH(A,B) /* nothing */
#endif
+#ifdef HAVE_LARGE_PAGES
+extern uint my_get_large_page_size(void);
+extern gptr my_large_malloc(uint size, myf my_flags);
+extern void my_large_free(gptr ptr, myf my_flags);
+#else
+#define my_get_large_page_size() (0)
+#define my_large_malloc(A,B) my_malloc_lock((A),(B))
+#define my_large_free(A,B) my_free_lock((A),(B))
+#endif /* HAVE_LARGE_PAGES */
+
#ifdef HAVE_ALLOCA
#if defined(_AIX) && !defined(__GNUC__) && !defined(_AIX43)
#pragma alloca
#endif /* _AIX */
+#if defined(__MWERKS__)
+#undef alloca
+#define alloca __alloca
+#endif /* __MWERKS__ */
#if defined(__GNUC__) && !defined(HAVE_ALLOCA_H) && ! defined(alloca)
#define alloca __builtin_alloca
#endif /* GNUC */
@@ -204,12 +223,13 @@
#endif
#endif /* MSDOS */
+#ifndef errno /* did we already get it? */
#ifdef HAVE_ERRNO_AS_DEFINE
#include <errno.h> /* errno is a define */
#else
extern int errno; /* declare errno */
#endif
-extern const char ** NEAR my_errmsg[];
+#endif /* #ifndef errno */
extern char NEAR errbuff[NRERRBUFFS][ERRMSGSIZE];
extern char *home_dir; /* Home directory for user */
extern char *my_progname; /* program-name (printed in errors) */
@@ -219,6 +239,11 @@
myf MyFlags);
extern uint my_file_limit;
+#ifdef HAVE_LARGE_PAGES
+extern my_bool my_use_large_pages;
+extern uint my_large_page_size;
+#endif
+
/* charsets */
extern CHARSET_INFO *default_charset_info;
extern CHARSET_INFO *all_charsets[256];
@@ -253,6 +278,8 @@
extern const char *charsets_dir;
extern char *defaults_extra_file;
+extern my_bool timed_mutexes;
+
typedef struct wild_file_pack /* Struct to hold info when selecting files */
{
uint wilds; /* How many wildcards */
@@ -523,7 +550,7 @@
/* Define the type of function to be passed to process_default_option_files */
typedef int (*Process_option_func)(void *ctx, const char *group_name,
- const char *option);
+ const char *option);
#include <my_alloc.h>
@@ -631,6 +658,8 @@
extern int my_printf_error _VARARGS((uint my_err, const char *format,
myf MyFlags, ...)
__attribute__ ((format (printf, 2, 4))));
+extern int my_error_register(const char **errmsgs, int first, int last);
+extern const char **my_error_unregister(int first, int last);
extern int my_message(uint my_err, const char *str,myf MyFlags);
extern int my_message_no_curses(uint my_err, const char *str,myf MyFlags);
extern int my_message_curses(uint my_err, const char *str,myf MyFlags);
@@ -657,6 +686,7 @@
extern uint dirname_length(const char *name);
#define base_name(A) (A+dirname_length(A))
extern int test_if_hard_path(const char *dir_name);
+extern my_bool has_path(const char *name);
extern char *convert_dirname(char *to, const char *from, const char *from_end);
extern void to_unix_path(my_string name);
extern my_string fn_ext(const char *name);
@@ -710,6 +740,7 @@
extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type,
my_off_t seek_offset,pbool use_async_io,
pbool clear_cache);
+extern void setup_io_cache(IO_CACHE* info);
extern int _my_b_read(IO_CACHE *info,byte *Buffer,uint Count);
#ifdef THREAD
extern int _my_b_read_r(IO_CACHE *info,byte *Buffer,uint Count);
@@ -791,12 +822,15 @@
extern char *strdup_root(MEM_ROOT *root,const char *str);
extern char *strmake_root(MEM_ROOT *root,const char *str,uint len);
extern char *memdup_root(MEM_ROOT *root,const char *str,uint len);
+extern void get_defaults_files(int argc, char **argv,
+ char **defaults, char **extra_defaults);
extern int load_defaults(const char *conf_file, const char **groups,
int *argc, char ***argv);
-extern int process_default_option_files(const char *conf_file,
- Process_option_func func,
- void *func_ctx);
+extern int my_search_option_files(const char *conf_file, int *argc,
+ char ***argv, uint *args_used,
+ Process_option_func func, void *func_ctx);
extern void free_defaults(char **argv);
+extern void my_print_default_files(const char *conf_file);
extern void print_defaults(const char *conf_file, const char **groups);
extern my_bool my_compress(byte *, ulong *, ulong *);
extern my_bool my_uncompress(byte *, ulong *, ulong *);
@@ -813,7 +847,7 @@
ulonglong my_getsystime(void);
my_bool my_gethwaddr(uchar *to);
-#ifdef HAVE_MMAP
+#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#ifndef MAP_NOSYNC
@@ -821,16 +855,23 @@
#endif
#define my_mmap(a,b,c,d,e,f) mmap(a,b,c,d,e,f)
+#ifdef HAVE_GETPAGESIZE
#define my_getpagesize() getpagesize()
-#define my_munmap(a,b) munmap(a,b)
+#else
+/* qnx ? */
+#define my_getpagesize() 8192
+#endif
+#define my_munmap(a,b) munmap((a),(b))
#else
/* not a complete set of mmap() flags, but only those that nesessary */
#define PROT_READ 1
#define PROT_WRITE 2
-#define MAP_NOSYNC 0x800
+#define MAP_SHARED 0x0001
+#define MAP_NOSYNC 0x0800
#define MAP_FAILED ((void *)-1)
#define MS_SYNC 0x0000
+#define HAVE_MMAP
int my_getpagesize(void);
void *my_mmap(void *, size_t, int, int, int, my_off_t);
@@ -853,7 +894,8 @@
extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2);
extern my_bool init_compiled_charsets(myf flags);
extern void add_compiled_collation(CHARSET_INFO *cs);
-extern ulong escape_string_for_mysql(CHARSET_INFO *charset_info, char *to,
+extern ulong escape_string_for_mysql(CHARSET_INFO *charset_info,
+ char *to, ulong to_length,
const char *from, ulong length);
extern void thd_increment_bytes_sent(ulong length);
@@ -862,6 +904,14 @@
#ifdef __WIN__
extern my_bool have_tcpip; /* Is set if tcpip is used */
+
+/* implemented in my_windac.c */
+
+int my_security_attr_create(SECURITY_ATTRIBUTES **psa, const char **perror,
+ DWORD owner_rights, DWORD everybody_rights);
+
+void my_security_attr_free(SECURITY_ATTRIBUTES *sa);
+
#endif
#ifdef __NETWARE__
void netware_reg_user(const char *ip, const char *user,
--- 1.41/libmysql/Makefile.am 2004-12-13 14:21:16 +01:00
+++ 1.42/libmysql/Makefile.am 2005-05-10 11:12:38 +02:00
@@ -23,7 +23,8 @@
target = libmysqlclient.la
target_defs = -DUNDEF_THREADS_HACK -DDONT_USE_RAID @LIB_EXTRA_CCFLAGS@ -DMYSQL_CLIENT
LIBS = @CLIENT_LIBS@
-INCLUDES = -I$(top_srcdir)/include $(openssl_includes) @ZLIB_INCLUDES@
+INCLUDES = -I$(top_srcdir)/include $(openssl_includes) @ZLIB_INCLUDES@ \
+ -I$(top_builddir)/include
include $(srcdir)/Makefile.shared
--- 1.30/myisam/Makefile.am 2005-04-26 12:03:33 +02:00
+++ 1.31/myisam/Makefile.am 2005-05-10 11:12:38 +02:00
@@ -54,7 +54,7 @@
ft_update.c ft_boolean_search.c ft_nlq_search.c sort.c \
rt_index.c rt_key.c rt_mbr.c rt_split.c sp_key.c
CLEANFILES = test?.MY? FT?.MY? isam.log mi_test_all rt_test.MY? sp_test.MY?
-DEFS = -DMAP_TO_USE_RAID
+DEFS = -DMAP_TO_USE_RAID -DMYSQL_SERVER
# Move to automake rules ?
prolint:; plparse -b -u -hF1 "-width(0,0)" "-format=%f:%l:\s%t:%n\s%m" \
--- 1.90/myisam/mi_open.c 2005-03-19 01:12:20 +01:00
+++ 1.91/myisam/mi_open.c 2005-05-10 14:56:19 +02:00
@@ -148,8 +148,10 @@
goto err;
}
/* Don't call realpath() if the name can't be a link */
+#if 0 // added by Ram for the time being
if (!strcmp(name_buff, org_name) ||
my_readlink(index_name, org_name, MYF(0)) == -1)
+#endif
(void) strmov(index_name, org_name);
(void) fn_format(data_name,org_name,"",MI_NAME_DEXT,2+4+16);
--- 1.57/mysys/Makefile.am 2004-12-13 14:57:26 +01:00
+++ 1.58/mysys/Makefile.am 2005-05-10 11:12:38 +02:00
@@ -17,8 +17,7 @@
MYSQLDATAdir = $(localstatedir)
MYSQLSHAREdir = $(pkgdatadir)
MYSQLBASEdir= $(prefix)
-INCLUDES = @MT_INCLUDES@ \
- @ZLIB_INCLUDES@ -I$(top_srcdir)/include -I$(srcdir)
+INCLUDES = @ZLIB_INCLUDES@ -I$(top_srcdir)/include -I$(srcdir)
pkglib_LIBRARIES = libmysys.a
LDADD = libmysys.a ../dbug/libdbug.a \
../strings/libmystrings.a
@@ -54,7 +53,8 @@
my_net.c my_semaphore.c my_port.c my_sleep.c \
charset.c charset-def.c my_bitmap.c my_bit.c md5.c \
my_gethostbyname.c rijndael.c my_aes.c sha1.c \
- my_handler.c my_netware.c
+ my_handler.c my_netware.c my_largepage.c \
+ my_windac.c
EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \
thr_mutex.c thr_rwlock.c
libmysys_a_LIBADD = @THREAD_LOBJECTS@
@@ -67,6 +67,7 @@
-DDATADIR="\"$(MYSQLDATAdir)\"" \
-DDEFAULT_CHARSET_HOME="\"$(MYSQLBASEdir)\"" \
-DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
+ -DDEFAULT_HOME_ENV=MYSQL_HOME \
@DEFS@
libmysys_a_DEPENDENCIES= @THREAD_LOBJECTS@
--- 1.19/mysys/my_open.c 2005-01-11 00:14:39 +01:00
+++ 1.20/mysys/my_open.c 2005-05-10 11:12:38 +02:00
@@ -54,6 +54,7 @@
MY_S_IREAD | MY_S_IWRITE);
#elif !defined(NO_OPEN_3)
fd = open(FileName, Flags, my_umask); /* Normal unix */
+
#else
fd = open((my_string) FileName, Flags);
#endif
--- 1.7/mysys/my_rename.c 2005-04-06 20:02:19 +02:00
+++ 1.8/mysys/my_rename.c 2005-05-10 11:12:38 +02:00
@@ -51,7 +51,7 @@
Remove any conflicting files:
*/
(void) my_delete(to, MYF(0));
-#endif
+#endif
if (rename(from,to))
#else
if (link(from, to) || unlink(from))
--- 1.11/mysys/my_write.c 2005-01-06 21:31:45 +01:00
+++ 1.12/mysys/my_write.c 2005-05-10 11:12:39 +02:00
@@ -83,6 +83,8 @@
else
break; /* Return bytes written */
}
+ DBUG_PRINT("inside my_write",("Wrote %d bytes",
+ writenbytes));
if (MyFlags & (MY_NABP | MY_FNABP))
DBUG_RETURN(0); /* Want only errors */
DBUG_RETURN(writenbytes+written);
--- 1.105/sql/Makefile.am 2005-04-01 14:04:44 +02:00
+++ 1.106/sql/Makefile.am 2005-05-10 14:58:11 +02:00
@@ -22,7 +22,8 @@
INCLUDES = @ZLIB_INCLUDES@ \
@bdb_includes@ @innodb_includes@ @ndbcluster_includes@ \
-I$(top_srcdir)/include -I$(top_srcdir)/regex \
- -I$(srcdir) $(openssl_includes) -I$(top_builddir)/include
+ -I$(srcdir) $(openssl_includes) -I$(top_builddir)/include \
+ -I$(top_srcdir)/netware
WRAPLIBS= @WRAPLIBS@
SUBDIRS = share
libexec_PROGRAMS = mysqld
@@ -56,7 +57,7 @@
sql_select.h structs.h table.h sql_udf.h hash_filo.h\
lex.h lex_symbol.h sql_acl.h sql_crypt.h \
log_event.h sql_repl.h slave.h \
- stacktrace.h sql_sort.h sql_cache.h set_var.h \
+ stacktrace.h sql_sort.h sql_cache.h set_var.h ../netware/neb_reg.h \
spatial.h gstream.h client_settings.h tzfile.h \
tztime.h my_decimal.h\
sp_head.h sp_pcontext.h sp_rcontext.h sp.h sp_cache.h \
@@ -73,7 +74,7 @@
net_serv.cc protocol.cc sql_state.c \
lock.cc my_lock.c \
sql_string.cc sql_manager.cc sql_map.cc \
- mysqld.cc password.c hash_filo.cc hostname.cc \
+ ../netware/neb_reg.cc mysqld.cc password.c hash_filo.cc hostname.cc \
set_var.cc sql_parse.cc sql_yacc.yy \
sql_base.cc table.cc sql_select.cc sql_insert.cc \
sql_prepare.cc sql_error.cc \
--- 1.20/sql/derror.cc 2004-12-13 14:21:16 +01:00
+++ 1.21/sql/derror.cc 2005-05-10 14:58:32 +02:00
@@ -36,15 +36,43 @@
DBUG_RETURN(FALSE);
}
#endif
- /* Read messages from errorfile */
+/*
+ Read messages from errorfile.
+
+ SYNOPSIS
+ init_errmessage()
+
+ DESCRIPTION
+ This function can be called multiple times to reload the messages.
+
+ RETURN
+ FALSE OK
+ TRUE Error
+*/
bool init_errmessage(void)
{
+ const char **errmsgs;
DBUG_ENTER("init_errmessage");
- if (read_texts(ERRMSG_FILE,&my_errmsg[ERRMAPP],ER_ERROR_MESSAGES))
+ /*
+ Get a pointer to the old error messages pointer array.
+ read_texts() tries to free it.
+ */
+ errmsgs= my_error_unregister(ER_ERROR_FIRST, ER_ERROR_LAST);
+
+ /* Read messages from file. */
+ if (read_texts(ERRMSG_FILE, &errmsgs, ER_ERROR_LAST - ER_ERROR_FIRST + 1))
DBUG_RETURN(TRUE);
- errmesg=my_errmsg[ERRMAPP]; /* Init global variabel */
+
+ /* Register messages for use with my_error(). */
+ if (my_error_register(errmsgs, ER_ERROR_FIRST, ER_ERROR_LAST))
+ {
+ x_free((gptr) errmsgs);
+ DBUG_RETURN(TRUE);
+ }
+
+ errmesg= errmsgs; /* Init global variabel */
init_myfunc_errs(); /* Init myfunc messages */
#ifdef __NETWARE__
if(init_netware_errmessage())
@@ -66,7 +94,6 @@
char name[FN_REFLEN];
const char *buff;
uchar head[32],*pos;
- CHARSET_INFO *cset; // For future
DBUG_ENTER("read_texts");
*point=0; // If something goes wrong
@@ -92,7 +119,7 @@
}
/* TODO: Convert the character set to server system character set */
- if (!(cset= get_charset(head[30],MYF(MY_WME))))
+ if (!get_charset(head[30],MYF(MY_WME)))
{
sql_print_error("Character set #%d is not supported for messagefile '%s'",
(int)head[30],name);
@@ -164,20 +191,20 @@
init_glob_errs(); /* Initiate english errors */
if (!(specialflag & SPECIAL_ENGLISH))
{
- globerrs[EE_FILENOTFOUND % ERRMOD] = ER(ER_FILE_NOT_FOUND);
- globerrs[EE_CANTCREATEFILE % ERRMOD]= ER(ER_CANT_CREATE_FILE);
- globerrs[EE_READ % ERRMOD] = ER(ER_ERROR_ON_READ);
- globerrs[EE_WRITE % ERRMOD] = ER(ER_ERROR_ON_WRITE);
- globerrs[EE_BADCLOSE % ERRMOD] = ER(ER_ERROR_ON_CLOSE);
- globerrs[EE_OUTOFMEMORY % ERRMOD] = ER(ER_OUTOFMEMORY);
- globerrs[EE_DELETE % ERRMOD] = ER(ER_CANT_DELETE_FILE);
- globerrs[EE_LINK % ERRMOD] = ER(ER_ERROR_ON_RENAME);
- globerrs[EE_EOFERR % ERRMOD] = ER(ER_UNEXPECTED_EOF);
- globerrs[EE_CANTLOCK % ERRMOD] = ER(ER_CANT_LOCK);
- globerrs[EE_DIR % ERRMOD] = ER(ER_CANT_READ_DIR);
- globerrs[EE_STAT % ERRMOD] = ER(ER_CANT_GET_STAT);
- globerrs[EE_GETWD % ERRMOD] = ER(ER_CANT_GET_WD);
- globerrs[EE_SETWD % ERRMOD] = ER(ER_CANT_SET_WD);
- globerrs[EE_DISK_FULL % ERRMOD] = ER(ER_DISK_FULL);
+ EE(EE_FILENOTFOUND) = ER(ER_FILE_NOT_FOUND);
+ EE(EE_CANTCREATEFILE) = ER(ER_CANT_CREATE_FILE);
+ EE(EE_READ) = ER(ER_ERROR_ON_READ);
+ EE(EE_WRITE) = ER(ER_ERROR_ON_WRITE);
+ EE(EE_BADCLOSE) = ER(ER_ERROR_ON_CLOSE);
+ EE(EE_OUTOFMEMORY) = ER(ER_OUTOFMEMORY);
+ EE(EE_DELETE) = ER(ER_CANT_DELETE_FILE);
+ EE(EE_LINK) = ER(ER_ERROR_ON_RENAME);
+ EE(EE_EOFERR) = ER(ER_UNEXPECTED_EOF);
+ EE(EE_CANTLOCK) = ER(ER_CANT_LOCK);
+ EE(EE_DIR) = ER(ER_CANT_READ_DIR);
+ EE(EE_STAT) = ER(ER_CANT_GET_STAT);
+ EE(EE_GETWD) = ER(ER_CANT_GET_WD);
+ EE(EE_SETWD) = ER(ER_CANT_SET_WD);
+ EE(EE_DISK_FULL) = ER(ER_DISK_FULL);
}
}
--- 1.148/sql/ha_myisam.cc 2005-04-27 11:25:04 +02:00
+++ 1.149/sql/ha_myisam.cc 2005-05-10 11:12:39 +02:00
@@ -18,7 +18,6 @@
#ifdef __GNUC__
#pragma implementation // gcc: Class implementation
#endif
-
#include "mysql_priv.h"
#include <m_ctype.h>
#include <myisampack.h>
@@ -31,6 +30,11 @@
#include "../myisam/rt_index.h"
#endif
+#ifdef HAVE_NETWARE_BACKUP
+#define my_write my_fs_write
+#endif
+
+
ulong myisam_recover_options= HA_RECOVER_NONE;
/* bits in myisam_recover_options */
@@ -1271,6 +1275,7 @@
Set data_file_name and index_file_name to point at the symlink value
if table is symlinked (Ie; Real name is not same as generated name)
*/
+
data_file_name=index_file_name=0;
fn_format(name_buff, file->filename, "", MI_NAME_DEXT, 2);
if (strcmp(name_buff, info.data_file_name))
--- 1.167/sql/handler.cc 2005-05-06 10:39:14 +02:00
+++ 1.168/sql/handler.cc 2005-05-10 14:58:48 +02:00
@@ -1933,6 +1933,7 @@
DBUG_RETURN(error);
}
+
void st_ha_check_opt::init()
{
flags= sql_flags= 0;
--- 1.161/sql/log.cc 2005-05-06 10:39:15 +02:00
+++ 1.162/sql/log.cc 2005-05-10 11:12:40 +02:00
@@ -33,6 +33,7 @@
#include "message.h"
#endif
+
MYSQL_LOG mysql_log, mysql_slow_log, mysql_bin_log;
ulong sync_binlog_counter= 0;
@@ -533,13 +534,14 @@
db[0]=0;
open_count++;
+
if ((file=my_open(log_file_name,open_flags,
MYF(MY_WME | ME_WAITTANG))) < 0 ||
init_io_cache(&log_file, file, IO_SIZE, io_cache_type,
my_tell(file,MYF(MY_WME)), 0,
MYF(MY_WME | MY_NABP |
((log_type == LOG_BIN) ? MY_WAIT_IF_FULL : 0))))
- goto err;
+ goto err;
switch (log_type) {
case LOG_NORMAL:
@@ -2175,6 +2177,18 @@
fflush(stderr);
+ #ifdef __NETWARE__
+ fprintf(stdout,"%02d%02d%02d %2d:%02d:%02d ",
+ start->tm_year % 100,
+ start->tm_mon+1,
+ start->tm_mday,
+ start->tm_hour,
+ start->tm_min,
+ start->tm_sec);
+ //(void) vfprintf(stdout,format,args);
+ (void) fputc('\n',stdout);
+ fflush(stdout);
+ #endif
VOID(pthread_mutex_unlock(&LOCK_error_log));
DBUG_VOID_RETURN;
}
--- 1.295/sql/mysql_priv.h 2005-05-09 18:44:21 +02:00
+++ 1.296/sql/mysql_priv.h 2005-05-10 14:59:38 +02:00
@@ -1028,6 +1028,10 @@
/*
External variables
*/
+#ifdef HAVE_NETWARE_BACKUP
+extern char *mysql_backup_updates_path;
+extern char mysql_real_backup_updates_path[FN_REFLEN];
+#endif
extern time_t start_time;
extern char *mysql_data_home,server_version[SERVER_VERSION_LENGTH],
@@ -1150,6 +1154,7 @@
extern SHOW_COMP_OPTION have_geometry, have_rtree_keys;
extern SHOW_COMP_OPTION have_crypt;
extern SHOW_COMP_OPTION have_compress;
+extern SHOW_COMP_OPTION have_nw_backup;
#ifndef __WIN__
extern pthread_t signal_thread;
--- 1.465/sql/mysqld.cc 2005-05-06 12:46:04 +02:00
+++ 1.466/sql/mysqld.cc 2005-05-10 15:01:27 +02:00
@@ -59,6 +59,9 @@
#include <thr_alarm.h>
#include <ft_global.h>
#include <errmsg.h>
+#ifdef HAVE_NETWARE_BACKUP
+#include <mysql_fs.h>
+#endif
#include "sp_rcontext.h"
#include "sp_cache.h"
@@ -201,6 +204,11 @@
} /* cplusplus */
+// plz don't club this one with the above ifdef __NETWARE__ IT DOESN'T work because it
is in the extern c block
+#ifdef __NETWARE__
+#include "neb_reg.h" // This header is defined in ../netware folder but double quotes
(") is used to include it so that to identify that this is not
+ // exposed by platform services instead we created it.
+#endif
#if defined(HAVE_LINUXTHREADS)
#define THR_KILL_SIGNAL SIGINT
@@ -296,6 +304,9 @@
ulong opt_ndb_nodeid;
#endif
my_bool opt_readonly, use_temp_pool, relay_log_purge;
+#ifdef HAVE_NETWARE_BACKUP
+my_bool opt_backupmode = 0;
+#endif
my_bool opt_sync_bdb_logs, opt_sync_frm, opt_allow_suspicious_udfs;
my_bool opt_secure_auth= 0;
my_bool opt_short_log_format= 0;
@@ -364,11 +375,19 @@
char *language_ptr, *default_collation_name, *default_character_set_name;
char mysql_data_home_buff[2], *mysql_data_home=mysql_real_data_home;
+#ifdef HAVE_NETWARE_BACKUP
+char mysql_real_backup_updates_path[FN_REFLEN];
+char *mysql_backup_updates_path = mysql_real_backup_updates_path;
+my_bool opt_backup_recovery = FALSE, opt_nw_backup = TRUE;
+#endif
struct passwd *user_info;
char server_version[SERVER_VERSION_LENGTH];
char *mysqld_unix_port, *opt_mysql_tmpdir;
char *my_bind_addr_str;
const char **errmesg; /* Error messages */
+#ifdef __NETWARE__
+const char **nwerrmesg;
+#endif
const char *myisam_recover_options_str="OFF";
const char *sql_mode_str="OFF";
/* name of reference on left espression in rewritten IN subquery */
@@ -408,7 +427,7 @@
SHOW_COMP_OPTION have_berkeley_db, have_innodb, have_isam, have_ndbcluster,
have_example_db, have_archive_db, have_csv_db;
SHOW_COMP_OPTION have_federated_db;
-SHOW_COMP_OPTION have_raid, have_openssl, have_symlink, have_query_cache;
+SHOW_COMP_OPTION have_raid, have_openssl, have_symlink, have_query_cache,have_nwbackup;
SHOW_COMP_OPTION have_geometry, have_rtree_keys;
SHOW_COMP_OPTION have_crypt, have_compress;
SHOW_COMP_OPTION have_blackhole_db;
@@ -935,12 +954,31 @@
extern "C" void unireg_abort(int exit_code)
{
DBUG_ENTER("unireg_abort");
+ #ifdef HAVE_NETWARE_BACKUP
+ if (!opt_bootstrap)
+ {
+ if (my_fs_get_backup_mode())
+ {
+ bool is_warnings;
+ int errcode;
+ errcode = my_fs_reset_backup_mode(&is_warnings);
+ if (errcode )
+ fprintf(stderr,"merging of the backup updates has failed with error code = %d\n",
errcode);
+ else if(is_warnings)
+ fprintf(stderr,"There were some problems in merging\n");
+ }
+ }
+ #endif
if (exit_code)
sql_print_error("Aborting\n");
clean_up(exit_code || !opt_bootstrap); /* purecov: inspected */
DBUG_PRINT("quit",("done with cleanup in unireg_abort"));
wait_for_signal_thread_to_end();
clean_up_mutexes();
+ #ifdef HAVE_NETWARE_BACKUP
+ if (opt_nw_backup)
+ my_fs_cleanup();
+ #endif
my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
exit(exit_code); /* purecov: inspected */
}
@@ -2472,6 +2510,62 @@
DBUG_PRINT("info",("%s Ver %s for %s on %s\n",my_progname,
server_version, SYSTEM_TYPE,MACHINE_TYPE));
+ #ifdef HAVE_NETWARE_BACKUP
+ if (!opt_bootstrap)
+ {
+ char **consistent_files = NULL, **consistentdummyfiles, *mysqldatadir = NULL;
+ int errcode = 0, n_consistent_files, n_dummy, i;
+
+ if(mysql_real_data_home == NULL || mysql_backup_updates_path == NULL)
+ {
+ printf("NULLED...\n");
+ exit(1);
+ }
+
+ if (user_info)
+ set_user(mysqld_user, user_info);
+
+ /*Since innobase_data_home_dir can be relative to the data dir */
+ if (my_setwd(mysql_real_data_home,MYF(MY_WME)))
+ {
+ sql_print_error("%s: Error : Problem in setting the cwd", **argv);
+ exit(1);
+ }
+
+ if(innobase_data_home_dir)
+ {
+ if (my_setwd(innobase_data_home_dir, MYF(MY_WME)))
+ {
+ sql_print_error("%s: Error : Problem in setting the cwd");
+ exit(1);
+ }
+ }
+
+ errcode = innobase_get_consistent_dirs(&consistent_files, &n_consistent_files);
+ if(errcode)
+ {
+ sql_print_error("Error : in getting the consistent directories ");
+ exit(1);
+ }
+
+ /* If the --skip-netware-backup is given my_fs_init will not be initialized.. */
+
+ if(opt_nw_backup == TRUE && (errcode =my_fs_init (consistent_files,
n_consistent_files, mysql_backup_updates_path,mysql_real_data_home,
opt_backup_recovery)))
+ {
+ sql_print_error("Error : MBFS Initialization failed with error code = %d ", errcode
);
+ exit(1);
+ }
+
+
+ strcpy(mysql_real_backup_updates_path, mysql_backup_updates_path);
+
+ for(i=0;i<n_consistent_files;i++)
+ my_free(consistent_files[i], MYF(0));
+
+ my_free((char *)consistent_files, MYF(0));
+ }
+
+ #endif
#ifdef HAVE_LARGE_PAGES
/* Initialize large page size */
@@ -2832,7 +2926,9 @@
/* call ha_init_key_cache() on all key caches to init them */
process_key_caches(&ha_init_key_cache);
-
+#ifdef __NETWARE__
+#undef HAVE_MLOCKALL
+#endif
#if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT) &&
!defined(EMBEDDED_LIBRARY)
if (locked_in_memory && !getuid())
{
@@ -3169,6 +3265,18 @@
}
}
+ #ifdef HAVE_NETWARE_BACKUP
+ if (!opt_bootstrap)
+ {
+ if(opt_backupmode )
+ {
+ int errcode = 0;
+ errcode = my_fs_set_backup_mode(FAST_INSERT_BACKUP_MODE);
+ if(errcode)
+ fprintf(stderr,"set backup mode failed with error code = %d\n", errcode);
+ }
+ }
+ #endif
create_shutdown_thread();
create_maintenance_thread();
@@ -3191,7 +3299,22 @@
handle_connections_sockets(0);
#endif /* __NT__ */
- /* (void) pthread_attr_destroy(&connection_attrib); */
+#ifdef HAVE_NETWARE_BACKUP
+ if (!opt_bootstrap)
+ {
+ if (my_fs_get_backup_mode() )
+ {
+ bool is_warnings;
+ int errcode;
+
+ errcode = my_fs_reset_backup_mode(&is_warnings);
+ if (errcode )
+ fprintf(stderr,"merging of the backup updates has failed with error code = %d\n",
errcode);
+ else if(is_warnings)
+ fprintf(stderr,"There were some problems in merging\n");
+ }
+ }
+ #endif
DBUG_PRINT("quit",("Exiting main thread"));
@@ -3227,6 +3350,10 @@
#endif
wait_for_signal_thread_to_end();
clean_up_mutexes();
+ #ifdef HAVE_NETWARE_BACKUP
+ if (!opt_bootstrap)
+ my_fs_cleanup();
+ #endif
my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
exit(0);
@@ -4287,7 +4414,11 @@
OPT_AUTO_INCREMENT, OPT_AUTO_INCREMENT_OFFSET,
OPT_ENABLE_LARGE_PAGES,
OPT_TIMED_MUTEXES,
- OPT_OLD_STYLE_USER_LIMITS
+ OPT_OLD_STYLE_USER_LIMITS,
+ OPT_BACKUP_UPDATES_PATH,
+ OPT_BACKUP_RECOVERY,
+ OPT_BACKUP_MODE,
+ OPT_NW_BAKCUP
};
@@ -4399,6 +4530,21 @@
NO_ARG, 0, 0, 0, 0, 0, 0},
{"datadir", 'h', "Path to the database root.", (gptr*) &mysql_data_home,
(gptr*) &mysql_data_home, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+#ifdef HAVE_NETWARE_BACKUP
+ {"backup-updates-path", OPT_BACKUP_UPDATES_PATH,
+ "Directory that contains the updates on the data directory during the backup mode",
(gptr*) &mysql_backup_updates_path,
+ (gptr*) &mysql_backup_updates_path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"recovery", OPT_BACKUP_RECOVERY,
+ "Perform backup recovery", (gptr*) &opt_backup_recovery,
+ (gptr*) &opt_backup_recovery, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"backup_mode", OPT_BACKUP_MODE, "Set the backup_mode immediately when the server
comes up",
+ (gptr*) &opt_backupmode, (gptr*) &opt_backupmode, 0, GET_BOOL, OPT_ARG, 0, 0,
+ 0, 0, 0, 0},
+ {"netware-backup", OPT_NW_BAKCUP, "Enable Snapshot backup (if this version of MySQL
supports it). \
+Disable with --skip-netware-backup.",
+ (gptr*) &opt_nw_backup, (gptr*) &opt_nw_backup, 0, GET_BOOL, NO_ARG, 1, 0, 0,
+ 0, 0, 0},
+#endif
#ifndef DBUG_OFF
{"debug", '#', "Debug log.", (gptr*) &default_dbug_option,
(gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
@@ -6009,6 +6155,11 @@
#else
have_blackhole_db= SHOW_OPTION_NO;
#endif
+#ifdef HAVE_NETWARE_BACKUP
+ have_nwbackup = SHOW_OPTION_YES;
+#else
+ have_nwbackup = SHOW_OPTION_NO;
+#endif
#ifdef HAVE_FEDERATED_DB
have_federated_db= SHOW_OPTION_YES;
#else
@@ -6875,6 +7026,12 @@
exit(1);
}
#endif /* HAVE_REPLICATION */
+#ifdef HAVE_NETWARE_BACKUP
+ if (!mysql_backup_updates_path &&
+ !(mysql_backup_updates_path=
+ (char*) my_strdup(mysql_tmpdir, MYF(MY_FAE))))
+ exit(1);
+#endif
}
--- 1.102/sql/protocol.cc 2005-05-01 17:07:00 +02:00
+++ 1.103/sql/protocol.cc 2005-05-10 11:12:40 +02:00
@@ -147,6 +147,14 @@
DBUG_VOID_RETURN;
}
+#ifdef __NETWARE__
+/* Send a NetWare error string to client */
+
+void send_nw_error(THD *thd, uint sql_errno)
+{
+//send_error(thd,sql_errno,NW_ERR(sql_errno));
+}
+#endif
/*
Write error package and flush to client
It's a little too low level, but I don't want to use another buffer for
--- 1.131.1.1/sql/share/english/errmsg.txt 2005-03-26 09:24:41 +01:00
+++ 1.139/BitKeeper/deleted/.del-errmsg.txt~f96b7055cac394e 2005-05-10 11:12:37 +02:00
@@ -67,7 +67,7 @@
"Column '%-.64s' cannot be null",
"Unknown database '%-.64s'",
"Table '%-.64s' already exists",
-"Unknown table '%-.64s'",
+"Unknown table '%-.100s'",
"Column '%-.64s' in %-.64s is ambiguous",
"Server shutdown in progress",
"Unknown column '%-.64s' in '%-.64s'",
@@ -90,7 +90,7 @@
"Specified key was too long; max key length is %d bytes",
"Key column '%-.64s' doesn't exist in table",
"BLOB column '%-.64s' can't be used in key specification with the used table type",
-"Column length too big for column '%-.64s' (max = %d); use BLOB instead",
+"Column length too big for column '%-.64s' (max = %d); use BLOB or TEXT instead",
"Incorrect table definition; there can be only one auto column and it must be defined as
a key",
"%s: ready for connections.\nVersion: '%s' socket: '%s' port: %d",
"%s: Normal shutdown\n",
@@ -143,7 +143,7 @@
"No paths allowed for shared library",
"Function '%-.64s' already exists",
"Can't open shared library '%-.64s' (errno: %d %-.64s)",
-"Can't find function '%-.64s' in library'",
+"Can't find function '%-.64s' in library",
"Function '%-.64s' is not defined",
"Host '%-.64s' is blocked because of many connection errors; unblock with 'mysqladmin
flush-hosts'",
"Host '%-.64s' is not allowed to connect to this MySQL server",
--- 1.245/sql/slave.cc 2005-05-05 14:20:46 +02:00
+++ 1.246/sql/slave.cc 2005-05-10 15:02:09 +02:00
@@ -26,6 +26,9 @@
#include <thr_alarm.h>
#include <my_dir.h>
#include <sql_common.h>
+#ifdef HAVE_NETWARE_BACKUP
+#include "mysql_fs.h"
+#endif
#define MAX_SLAVE_RETRY_PAUSE 5
bool use_slave_mask = 0;
@@ -1748,7 +1751,11 @@
}
/* if file does not exist */
+ #if !defined(MYSQL_CLIENT) && defined(HAVE_NETWARE_BACKUP)
+ if (my_fs_access(fname,F_OK))
+ #else
if (access(fname,F_OK))
+ #endif
{
/*
If someone removed the file from underneath our feet, just close
@@ -2049,8 +2056,11 @@
fd = mi->fd;
/* does master.info exist ? */
-
+ #if !defined(MYSQL_CLIENT) && defined(HAVE_NETWARE_BACKUP)
+ if (my_fs_access(fname,F_OK))
+ #else
if (access(fname,F_OK))
+ #endif
{
if (abort_if_no_master_info_file)
{
--- 1.150/sql/sql_acl.cc 2005-05-07 15:55:41 +02:00
+++ 1.151/sql/sql_acl.cc 2005-05-10 15:02:24 +02:00
@@ -34,6 +34,9 @@
#include <stdarg.h>
#include "sp_head.h"
#include "sp.h"
+#ifdef HAVE_NETWARE_BACKUP
+#include "mysql_fs.h"
+#endif
#ifndef NO_EMBEDDED_ACCESS_CHECKS
--- 1.160/sql/sql_class.cc 2004-12-13 14:21:17 +01:00
+++ 1.161/sql/sql_class.cc 2005-05-10 11:12:41 +02:00
@@ -27,7 +27,6 @@
#endif
#include "mysql_priv.h"
-#include "sql_acl.h"
#include <m_ctype.h>
#include <sys/stat.h>
#include <thr_alarm.h>
@@ -165,7 +164,8 @@
:user_time(0), global_read_lock(0), is_fatal_error(0),
rand_used(0), time_zone_used(0),
last_insert_id_used(0), insert_id_used(0), clear_next_insert_id(0),
- in_lock_tables(0), bootstrap(0), spcont(NULL)
+ in_lock_tables(0), bootstrap(0), derived_tables_processing(FALSE),
+ spcont(NULL)
{
current_arena= this;
#ifndef DBUG_OFF
@@ -187,6 +187,7 @@
lock=locked_tables=0;
used_tables=0;
cuted_fields= sent_row_count= 0L;
+ limit_found_rows= 0;
statement_id_counter= 0UL;
// Must be reset to handle error with THD's created for init of mysqld
lex->current_select= 0;
@@ -196,26 +197,28 @@
variables.pseudo_thread_id= 0;
one_shot_set= 0;
file_id = 0;
+ query_id= 0;
warn_id= 0;
db_charset= global_system_variables.collation_database;
+ bzero(ha_data, sizeof(ha_data));
mysys_var=0;
#ifndef DBUG_OFF
dbug_sentry=THD_SENTRY_MAGIC;
#endif
-#ifndef EMBEDDED_LIBRARY
+#ifndef EMBEDDED_LIBRARY
net.vio=0;
#endif
- net.last_error[0]=0; // If error on boot
+ net.last_error[0]=0; // If error on boot
+ net.query_cache_query=0; // If error on boot
ull=0;
- system_thread= cleanup_done= abort_on_warning= 0;
+ system_thread= cleanup_done= abort_on_warning= no_warnings_for_error= 0;
peer_port= 0; // For SHOW PROCESSLIST
- transaction.changed_tables = 0;
#ifdef __WIN__
real_id = 0;
#endif
#ifdef SIGNAL_WITH_VIO_CLOSE
active_vio = 0;
-#endif
+#endif
pthread_mutex_init(&LOCK_delete, MY_MUTEX_INIT_FAST);
/* Variables with default values */
@@ -244,9 +247,7 @@
/* For user vars replication*/
if (opt_bin_log)
my_init_dynamic_array(&user_var_events,
- sizeof(BINLOG_USER_VAR_EVENT *),
- 16,
- 16);
+ sizeof(BINLOG_USER_VAR_EVENT *), 16, 16);
else
bzero((char*) &user_var_events, sizeof(user_var_events));
@@ -256,26 +257,9 @@
protocol_prep.init(this);
tablespace_op=FALSE;
-#ifdef USING_TRANSACTIONS
- bzero((char*) &transaction,sizeof(transaction));
- /*
- Binlog is always open (if needed) before a THD is created (including
- bootstrap).
- */
- if (opt_using_transactions && mysql_bin_log.is_open())
- {
- if (open_cached_file(&transaction.trans_log,
- mysql_tmpdir, LOG_PREFIX, binlog_cache_size,
- MYF(MY_WME)))
- killed= KILL_CONNECTION;
- transaction.trans_log.end_of_file= max_binlog_cache_size;
- }
-#endif
- init_sql_alloc(&transaction.mem_root, ALLOC_ROOT_MIN_BLOCK_SIZE, 0);
- {
- ulong tmp=sql_rnd_with_mutex();
- randominit(&rand, tmp + (ulong) &rand, tmp + (ulong) ::query_id);
- }
+ ulong tmp=sql_rnd_with_mutex();
+ randominit(&rand, tmp + (ulong) &rand, tmp + (ulong) ::query_id);
+ prelocked_mode= NON_PRELOCKED;
}
@@ -324,9 +308,12 @@
reset_root_defaults(mem_root, variables.query_alloc_block_size,
variables.query_prealloc_size);
+#ifdef USING_TRANSACTIONS
reset_root_defaults(&transaction.mem_root,
variables.trans_alloc_block_size,
variables.trans_prealloc_size);
+#endif
+ transaction.xid.null();
}
@@ -360,7 +347,10 @@
void THD::cleanup(void)
{
DBUG_ENTER("THD::cleanup");
- ha_rollback(this);
+#ifdef ENABLE_WHEN_BINLOG_WILL_BE_ABLE_TO_PREPARE
+ if (transaction.xa_state != XA_PREPARED)
+#endif
+ ha_rollback(this);
if (locked_tables)
{
lock=locked_tables; locked_tables=0;
@@ -402,22 +392,17 @@
add_to_status(&global_status_var, &status_var);
/* Close connection */
-#ifndef EMBEDDED_LIBRARY
+#ifndef EMBEDDED_LIBRARY
if (net.vio)
{
vio_delete(net.vio);
- net_end(&net);
+ net_end(&net);
}
#endif
if (!cleanup_done)
cleanup();
-#ifdef USING_TRANSACTIONS
- if (opt_using_transactions)
- {
- close_cached_file(&transaction.trans_log);
- ha_close_connection(this);
- }
-#endif
+
+ ha_close_connection(this);
sp_cache_clear(&sp_proc_cache);
sp_cache_clear(&sp_func_cache);
@@ -430,7 +415,9 @@
safeFree(ip);
safeFree(db);
free_root(&warn_root,MYF(0));
+#ifdef USING_TRANSACTIONS
free_root(&transaction.mem_root,MYF(0));
+#endif
mysys_var=0; // Safety (shouldn't be needed)
pthread_mutex_destroy(&LOCK_delete);
#ifndef DBUG_OFF
@@ -654,7 +641,7 @@
DBUG_ASSERT((options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) &&
table->file->has_transactions());
- add_changed_table(table->table_cache_key, table->key_length);
+ add_changed_table(table->s->table_cache_key, table->s->key_length);
DBUG_VOID_RETURN;
}
@@ -771,6 +758,8 @@
Item *old_value;
/* Placement new was hidden by `new' in ilink (TODO: check): */
static void *operator new(size_t size, void *mem) { return mem; }
+ static void operator delete(void *ptr, size_t size) {}
+ static void operator delete(void *ptr, void *mem) { /* never called */ }
};
@@ -870,7 +859,6 @@
InnoDB adaptive hash S-latch to avoid thread deadlocks if it was reserved
by thd
*/
- if (thd->transaction.all.innobase_tid)
ha_release_temporary_latches(thd);
#endif
@@ -905,7 +893,6 @@
/* We may be passing the control from mysqld to the client: release the
InnoDB adaptive hash S-latch to avoid thread deadlocks if it was reserved
by thd */
- if (thd->transaction.all.innobase_tid)
ha_release_temporary_latches(thd);
#endif
@@ -1032,7 +1019,7 @@
return -1;
}
/* Create the file world readable */
- if ((file= my_create(path, 0666, O_WRONLY, MYF(MY_WME))) < 0)
+ if ((file= my_create(path, 0666, O_WRONLY|O_EXCL, MYF(MY_WME))) < 0)
return file;
#ifdef HAVE_FCHMOD
(void) fchmod(file, 0666); // Because of umask()
@@ -1311,12 +1298,21 @@
}
+void select_max_min_finder_subselect::cleanup()
+{
+ DBUG_ENTER("select_max_min_finder_subselect::cleanup");
+ cache= 0;
+ DBUG_VOID_RETURN;
+}
+
+
bool select_max_min_finder_subselect::send_data(List<Item> &items)
{
DBUG_ENTER("select_max_min_finder_subselect::send_data");
- Item_singlerow_subselect *it= (Item_singlerow_subselect *)item;
+ Item_maxmin_subselect *it= (Item_maxmin_subselect *)item;
List_iterator_fast<Item> li(items);
Item *val_item= li++;
+ it->register_value();
if (it->assigned())
{
cache->store(val_item);
@@ -1339,6 +1335,9 @@
case STRING_RESULT:
op= &select_max_min_finder_subselect::cmp_str;
break;
+ case DECIMAL_RESULT:
+ op= &select_max_min_finder_subselect::cmp_decimal;
+ break;
case ROW_RESULT:
// This case should never be choosen
DBUG_ASSERT(0);
@@ -1360,10 +1359,9 @@
return (cache->null_value && !maxmin->null_value) ||
(!cache->null_value && !maxmin->null_value &&
val1 > val2);
- else
- return (maxmin->null_value && !cache->null_value) ||
- (!cache->null_value && !maxmin->null_value &&
- val1 < val2);
+ return (maxmin->null_value && !cache->null_value) ||
+ (!cache->null_value && !maxmin->null_value &&
+ val1 < val2);
}
bool select_max_min_finder_subselect::cmp_int()
@@ -1374,10 +1372,23 @@
return (cache->null_value && !maxmin->null_value) ||
(!cache->null_value && !maxmin->null_value &&
val1 > val2);
- else
- return (maxmin->null_value && !cache->null_value) ||
+ return (maxmin->null_value && !cache->null_value) ||
+ (!cache->null_value && !maxmin->null_value &&
+ val1 < val2);
+}
+
+bool select_max_min_finder_subselect::cmp_decimal()
+{
+ Item *maxmin= ((Item_singlerow_subselect *)item)->el(0);
+ my_decimal cval, *cvalue= cache->val_decimal(&cval);
+ my_decimal mval, *mvalue= maxmin->val_decimal(&mval);
+ if (fmax)
+ return (cache->null_value && !maxmin->null_value) ||
(!cache->null_value && !maxmin->null_value &&
- val1 < val2);
+ my_decimal_cmp(cvalue, mvalue) > 0) ;
+ return (maxmin->null_value && !cache->null_value) ||
+ (!cache->null_value && !maxmin->null_value &&
+ my_decimal_cmp(cvalue,mvalue) < 0);
}
bool select_max_min_finder_subselect::cmp_str()
@@ -1394,10 +1405,9 @@
return (cache->null_value && !maxmin->null_value) ||
(!cache->null_value && !maxmin->null_value &&
sortcmp(val1, val2, cache->collation.collation) > 0) ;
- else
- return (maxmin->null_value && !cache->null_value) ||
- (!cache->null_value && !maxmin->null_value &&
- sortcmp(val1, val2, cache->collation.collation) < 0);
+ return (maxmin->null_value && !cache->null_value) ||
+ (!cache->null_value && !maxmin->null_value &&
+ sortcmp(val1, val2, cache->collation.collation) < 0);
}
bool select_exists_subselect::send_data(List<Item> &items)
@@ -1446,6 +1456,8 @@
/*
Item_func_set_user_var can't substitute something else on its place =>
0 can be passed as last argument (reference on item)
+ Item_func_set_user_var can't be fixed after creation, so we do not
+ check xx->fixed
*/
xx->fix_fields(thd, (TABLE_LIST*) thd->lex->select_lex.table_list.first,
0);
@@ -1782,7 +1794,11 @@
void thd_increment_bytes_sent(ulong length)
{
- current_thd->status_var.bytes_sent+= length;
+ THD *thd=current_thd;
+ if (likely(thd != 0))
+ { /* current_thd==0 when close_connection() calls net_send_error() */
+ thd->status_var.bytes_sent+= length;
+ }
}
--- 1.108/sql/sql_db.cc 2005-04-14 11:56:08 +02:00
+++ 1.109/sql/sql_db.cc 2005-05-10 15:03:15 +02:00
@@ -30,6 +30,9 @@
static TYPELIB deletable_extentions=
{array_elements(del_exts)-1,"del_exts", del_exts, NULL};
+#ifdef HAVE_NETWARE_BACKUP
+#include <mysql_fs.h>
+#endif
static long mysql_rm_known_files(THD *thd, MY_DIR *dirp,
const char *db, const char *path,
uint level);
@@ -849,7 +852,12 @@
else
{
/* Don't give errors if we can't delete 'RAID' directory */
+ #if !defined(MYSQL_CLIENT) && defined (HAVE_NETWARE_BACKUP)
+ // if (my_fs_rmdir(path) < 0 && !level)
+ if (my_fs_rmdir(org_path) < 0 && !level)
+ #else
if (rm_dir_w_symlink(org_path, level == 0))
+ #endif
DBUG_RETURN(-1);
}
@@ -1076,7 +1084,11 @@
length=unpack_dirname(path,path); // Convert if not unix
if (length && path[length-1] == FN_LIBCHAR)
path[length-1]=0; // remove ending '\'
+#if !defined(MYSQL_CLIENT) && defined(HAVE_NETWARE_BACKUP)
+ if (my_fs_access(path,F_OK))
+#else
if (access(path,F_OK))
+#endif
{
my_error(ER_BAD_DB_ERROR, MYF(0), dbname);
my_free(dbname,MYF(0));
--- 1.8/sql/sql_map.cc 2004-12-13 14:21:18 +01:00
+++ 1.9/sql/sql_map.cc 2005-05-10 15:05:41 +02:00
@@ -23,9 +23,9 @@
#ifdef __NETWARE__
#undef HAVE_MMAP
#endif
-#ifdef HAVE_MMAP
-#include <sys/mman.h>
#include <sys/stat.h>
+#ifdef HAVE_SYS_MMAN_H
+#include <sys/mman.h>
#endif
#ifndef MAP_NORESERVE
@@ -45,7 +45,7 @@
struct stat stat_buf;
if (!fstat(file,&stat_buf))
{
- if (!(map=(byte*) mmap(0,(size=(ulong) stat_buf.st_size),PROT_READ,
+ if (!(map=(byte*) my_mmap(0,(size=(ulong) stat_buf.st_size),PROT_READ,
MAP_SHARED | MAP_NORESERVE,file,
0L)))
{
@@ -56,7 +56,7 @@
if (map && memcmp(map,magic,magic_length))
{
my_error(ER_WRONG_MAGIC, MYF(0), name);
- VOID(munmap(map,size));
+ VOID(my_munmap(map,size));
map=0;
}
if (!map)
@@ -74,7 +74,7 @@
#ifdef HAVE_MMAP
if (file >= 0)
{
- VOID(munmap((caddr_t) map,size));
+ VOID(my_munmap(map,size));
VOID(my_close(file,MYF(0)));
file= -1; map=0;
}
--- 1.449/sql/sql_parse.cc 2005-05-09 13:25:29 +02:00
+++ 1.450/sql/sql_parse.cc 2005-05-10 15:06:12 +02:00
@@ -1680,7 +1680,7 @@
/* TODO: set thd->lex->sql_command to SQLCOM_END here */
VOID(pthread_mutex_unlock(&LOCK_thread_count));
#ifndef EMBEDDED_LIBRARY
- mysql_parse(thd, packet, length);
+ mysql_parse(thd, packet, length);
#else
/*
'packet' can point inside the query_rest's buffer
--- 1.243/sql/sql_show.cc 2005-05-07 16:22:26 +02:00
+++ 1.244/sql/sql_show.cc 2005-05-10 15:11:40 +02:00
@@ -25,6 +25,9 @@
#ifdef HAVE_BERKELEY_DB
#include "ha_berkeley.h" // For berkeley_show_logs
+#ifdef HAVE_NETWARE_BACKUP
+#include "mysql_fs.h"
+#endif
#endif
static const char *grant_names[]={
@@ -264,7 +267,6 @@
if (!(dirp = my_dir(path,MYF(MY_WME | (dir ? MY_WANT_STAT : 0)))))
DBUG_RETURN(-1);
-
for (i=0 ; i < (uint) dirp->number_off_files ; i++)
{
file=dirp->dir_entry+i;
@@ -456,7 +458,11 @@
found_libchar= 1;
path[length-1]=0; // remove ending '\'
}
+ #if !defined(MYSQL_CLIENT) && defined(HAVE_NETWARE_BACKUP)
+ if (my_fs_access(path,F_OK))
+ #else
if (access(path,F_OK))
+ #endif
{
my_error(ER_BAD_DB_ERROR, MYF(0), dbname);
DBUG_RETURN(TRUE);
@@ -1859,6 +1865,8 @@
LINT_INIT(end);
LINT_INIT(len);
+
+
if (lsel)
{
TABLE *old_open_tables= thd->open_tables;
@@ -1891,6 +1899,9 @@
if (mysql_find_files(thd, &bases, NullS, mysql_data_home,
idx_field_vals.db_value, 1))
goto err;
+ //ram added for debugging
+ DBUG_PRINT("Inside the get_all_tables",("No. of bases: %d",bases.elements));
+ int k= 0;
partial_cond= make_cond_for_info_schema(cond, tables);
it.rewind(); /* To get access to new elements in basis list */
@@ -1903,6 +1914,9 @@
lex->orig_sql_command == SQLCOM_SHOW_TABLE_STATUS) &&
(base_name= select_lex->db) && !bases.elements))
{
+ k++;
+ if ( k > 1)
+ break;
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (with_i_schema || // don't check the rights if information schema db
!check_access(thd,SELECT_ACL, base_name, &thd->col_access,0,1) ||
@@ -1926,7 +1940,6 @@
path, idx_field_vals.table_value, 0))
goto err;
}
-
List_iterator_fast<char> it_files(files);
while ((file_name= it_files++))
{
@@ -3448,6 +3461,7 @@
thd->no_warnings_for_error= 1;
for (JOIN_TAB *tab= join->join_tab; tab < tmp_join_tab; tab++)
{
+
if (!tab->table || !tab->table->pos_in_table_list)
break;
@@ -3472,7 +3486,7 @@
thd->derived_tables= 0;
thd->lock=0;
if (table_list->schema_table->fill_table(thd, table_list,
- tab->select_cond))
+ tab->select_cond))
result= 1;
thd->lock= sql_lock;
lex->sql_command= SQLCOM_SELECT;
--- 1.242/sql/sql_table.cc 2005-05-07 14:21:46 +02:00
+++ 1.243/sql/sql_table.cc 2005-05-10 15:12:12 +02:00
@@ -27,6 +27,9 @@
#ifdef __WIN__
#include <io.h>
#endif
+#ifdef HAVE_NETWARE_BACKUP
+#include <mysql_fs.h>
+#endif
const char *primary_key_name="PRIMARY";
@@ -226,10 +229,16 @@
strxmov(path, mysql_data_home, "/", db, "/", alias, reg_ext, NullS);
(void) unpack_filename(path,path);
}
+ #if !defined(MYSQL_CLIENT) && defined(HAVE_NETWARE_BACKUP)
+ if (drop_temporary ||
+ (my_fs_access(path,F_OK) &&
ha_create_table_from_engine(thd,db,alias,TRUE)) ||
+ (!drop_view && mysql_frm_type(path) != FRMTYPE_TABLE))
+#else
if (drop_temporary ||
(access(path,F_OK) &&
ha_create_table_from_engine(thd,db,alias,TRUE)) ||
(!drop_view && mysql_frm_type(path) != FRMTYPE_TABLE))
+#endif
{
if (if_exists)
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
@@ -1559,7 +1568,11 @@
VOID(pthread_mutex_lock(&LOCK_open));
if (!internal_tmp_table && !(create_info->options &
HA_LEX_CREATE_TMP_TABLE))
{
+ #if !defined(MYSQL_CLIENT) && defined(HAVE_NETWARE_BACKUP)
+ if (!my_fs_access(path,F_OK))
+ #else
if (!access(path,F_OK))
+ #endif
{
if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
{
@@ -2561,7 +2574,11 @@
fn_format(src_path, src_path, "", "", MYF(MY_UNPACK_FILENAME));
if (lower_case_table_names)
my_casedn_str(files_charset_info, src_path);
+ #if !defined(MYSQL_CLIENT) && defined(HAVE_NETWARE_BACKUP)
+ if (my_fs_access(src_path, F_OK))
+ #else
if (access(src_path, F_OK))
+ #endif
{
my_error(ER_BAD_TABLE_ERROR, MYF(0), src_table);
goto err;
@@ -2590,7 +2607,11 @@
strxmov(dst_path, mysql_data_home, "/", db, "/", table_name,
reg_ext, NullS);
fn_format(dst_path, dst_path, "", "", MYF(MY_UNPACK_FILENAME));
+ #if !defined(MYSQL_CLIENT) && defined(HAVE_NETWARE_BACKUP)
+ if (!my_fs_access(dst_path, F_OK))
+ #else
if (!access(dst_path, F_OK))
+ #endif
goto table_exists;
}
@@ -3039,8 +3060,13 @@
{
char dir_buff[FN_REFLEN];
strxnmov(dir_buff, FN_REFLEN, mysql_real_data_home, new_db, NullS);
+ #if !defined(MYSQL_CLIENT) && defined(HAVE_NETWARE_BACKUP)
+ if (!my_fs_access(fn_format(new_name_buff,new_name_buff,dir_buff,reg_ext,0),
+ F_OK))
+ #else
if (!access(fn_format(new_name_buff,new_name_buff,dir_buff,reg_ext,0),
F_OK))
+ #endif
{
/* Table will be closed in do_command() */
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), new_alias);
@@ -3082,7 +3108,11 @@
VOID(pthread_mutex_lock(&LOCK_open));
/* Then do a 'simple' rename of the table */
error=0;
+ #if !defined(MYSQL_CLIENT) && defined(HAVE_NETWARE_BACKUP)
+ if (!my_fs_access(new_name_buff,F_OK))
+ #else
if (!access(new_name_buff,F_OK))
+ #endif
{
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), new_name);
error= -1;
@@ -3584,7 +3614,11 @@
my_casedn_str(files_charset_info, old_name);
if (new_name != table_name || new_db != db)
{
+ #if !defined(MYSQL_CLIENT) && defined(HAVE_NETWARE_BACKUP)
+ if (!my_fs_access(new_name_buff,F_OK))
+ #else
if (!access(new_name_buff,F_OK))
+ #endif
{
error=1;
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), new_name_buff);
--- 1.161/sql/table.cc 2005-05-09 18:45:59 +02:00
+++ 1.162/sql/table.cc 2005-05-10 15:13:36 +02:00
@@ -109,6 +109,7 @@
error= 4;
if (my_read(file,(byte*) head,64,MYF(MY_NABP)))
goto err;
+ DBUG_PRINT("info in openfrm",("head[0]: %d head[1]: %d head[2]: %d ",
head[0],head[1], head[2]));
if (memcmp(head, "TYPE=", 5) == 0)
{
@@ -135,6 +136,7 @@
goto err;
*fn_ext(share->table_name)='\0'; // Remove extension
*fn_ext(share->path)='\0'; // Remove extension
+ DBUG_PRINT("info in openfrm",("head[0]: %d head[1]: %d head[2]: %d ",
head[0],head[1], head[2]));
if (head[0] != (uchar) 254 || head[1] != 1)
goto err; /* purecov: inspected */
@@ -148,6 +150,8 @@
new_frm_ver= (head[2] - FRM_VER);
field_pack_length= new_frm_ver < 2 ? 11 : 17;
+
+
error=3;
if (!(pos=get_form_pos(file,head,(TYPELIB*) 0)))
goto err; /* purecov: inspected */
@@ -1313,7 +1317,6 @@
problems with drop database
*/
set_if_smaller(create_info->raid_chunks, 255);
-
if ((file= my_create(name, CREATE_MODE, create_flags, MYF(MY_WME))) >= 0)
{
bzero((char*) fileinfo,64);
--- 1.56/sql/unireg.cc 2005-05-06 12:46:07 +02:00
+++ 1.57/sql/unireg.cc 2005-05-10 11:12:42 +02:00
@@ -114,8 +114,9 @@
keybuff=(uchar*) my_malloc(key_buff_length, MYF(0));
key_info_length=pack_keys(keybuff,keys,key_info);
VOID(get_form_pos(file,fileinfo,&formnames));
+
if (!(filepos=make_new_entry(file,fileinfo,&formnames,"")))
- goto err;
+ goto err;
maxlength=(uint) next_io_size((ulong) (uint2korr(forminfo)+1000));
int2store(forminfo+2,maxlength);
int4store(fileinfo+10,(ulong) (filepos+maxlength));
@@ -127,6 +128,7 @@
60);
forminfo[46]=(uchar) strlen((char*)forminfo+47); // Length of comment
+ //Ram --here is the problem
if (my_pwrite(file,(byte*) fileinfo,64,0L,MYF_RW) ||
my_pwrite(file,(byte*) keybuff,key_info_length,
(ulong) uint2korr(fileinfo+6),MYF_RW))
@@ -228,7 +230,7 @@
DBUG_RETURN(1);
if (!create_info->frm_only && ha_create_table(file_name,create_info,0))
{
- my_delete(file_name,MYF(0));
+ my_delete(file_name,MYF(0));
DBUG_RETURN(1);
}
DBUG_RETURN(0);
--- 1.39/sql/unireg.h 2005-02-07 18:38:45 +01:00
+++ 1.40/sql/unireg.h 2005-05-10 15:13:51 +02:00
@@ -37,6 +37,13 @@
#define SHAREDIR "share/"
#endif
+#ifdef __NETWARE__
+extern const char **nwerrmesg;
+#define NW_ERRMSG_FILE "nwerrmsg.sys"
+#define NW_ERR(X) nwerrmesg[(X)-ER_NW_ERROR_MESSAGES_START]
+#define NW_ERR_SAFE(X) (((X) >= ER_NW_ERROR_MESSAGES_START && (X) <
ER_NW_ERROR_MESSAGES + ER_NW_ERROR_MESSAGES_START) ? NW_ERR(X) : "Invalid error code")
+#define NW_ERRMAP MAXMAPS-1 // Always the myerrmsg[MAXMAPS-1] will contain netware error
messages.
+#endif
#define ER(X) errmesg[(X) - ER_ERROR_FIRST]
#define ER_SAFE(X) (((X) >= ER_ERROR_FIRST && (X) <= ER_ERROR_LAST) ? ER(X)
: "Invalid error code")
--- 1.323/BitKeeper/etc/logging_ok 2005-05-09 23:59:20 +02:00
+++ 1.324/BitKeeper/etc/logging_ok 2005-05-10 11:11:32 +02:00
@@ -220,6 +220,7 @@
pmartin@stripped
psergey@psergey-rh8.(none)
psergey@psergey.(none)
+ram@stripped
ram@deer.(none)
ram@stripped
ram@stripped
--- 1.5/netware/BUILD/compile-netware-START 2004-12-15 10:01:47 +01:00
+++ 1.6/netware/BUILD/compile-netware-START 2005-05-10 14:56:45 +02:00
@@ -22,6 +22,8 @@
--enable-local-infile \
--with-extra-charsets=all \
--prefix=N:/mysql \
+ --without-mysqlmanager \
+ --without-man \
--with-nwbackup \
"
--- 1.10/netware/mysql_test_run.c 2004-12-13 14:21:16 +01:00
+++ 1.11/netware/mysql_test_run.c 2005-05-10 11:12:39 +02:00
@@ -193,7 +193,7 @@
char error[PATH_MAX];
// input file
- snprintf(input, PATH_MAX, "%s/bin/init_db.sql", base_dir);
+ snprintf(input, PATH_MAX, "%s/bin/test_db.sql", base_dir);
snprintf(output, PATH_MAX, "%s/install.out", datadir);
snprintf(error, PATH_MAX, "%s/install.err", datadir);
@@ -1177,7 +1177,8 @@
setenv("MASTER_MYPORT", "9306", 1);
setenv("SLAVE_MYPORT", "9307", 1);
setenv("MYSQL_TCP_PORT", "3306", 1);
-
+ snprintf(file_path, PATH_MAX*2, "%s/mysql_client_test --no-defaults
--testcase--user=root --port=%u ", bin_dir, master_port);
+ setenv("MYSQL_CLIENT_TEST",file_path,1);
}
/******************************************************************************
--- 1.10/server-tools/instance-manager/mysqlmanager.cc 2005-03-22 00:04:10 +01:00
+++ 1.11/server-tools/instance-manager/mysqlmanager.cc 2005-05-10 14:57:43 +02:00
@@ -14,6 +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 */
+#if !defined(__NETWARE__)
+
#include <my_global.h>
#include "manager.h"
@@ -341,3 +343,4 @@
}
}
+#endif /* ! __NETWARE__ */
--- 1.28/innobase/buf/buf0flu.c 2005-03-15 10:22:11 +01:00
+++ 1.29/innobase/buf/buf0flu.c 2005-05-10 11:12:38 +02:00
@@ -32,6 +32,16 @@
#define BUF_FLUSH_AREA ut_min(BUF_READ_AHEAD_AREA,\
buf_pool->curr_size / 16)
+#ifdef __NETWARE__
+/**********************************************************************
+Flushes all the dirty pages to the disk */
+
+ ulint buf_flush_all_dirty()
+{
+ return( buf_flush_batch (BUF_FLUSH_LIST, UT_LIST_GET_LEN (buf_pool->flush_list),
ut_dulint_max));
+}
+
+#endif
/**********************************************************************
Validates the flush list. */
static
--- 1.30/innobase/configure.in 2004-12-01 16:36:51 +01:00
+++ 1.31/innobase/configure.in 2005-05-10 11:12:37 +02:00
@@ -69,6 +69,15 @@
DEBUG_OPTIMIZE_CXX=""
OPTIMIZE_CXXFLAGS="-O"
fi
+AC_ARG_WITH(nwbackup,
+ [ --without-nwbackup Build a MySQL without snapshot online backup],
+ [with_nwbackup=$withval],
+ [with_nwbackup=no])
+if test "$with_nwbackup" = "yes"
+then
+ CFLAGS="-DHAVE_NETWARE_BACKUP $CFLAGS"
+ CXXFLAGS="-DHAVE_NETWARE_BACKUP $CXXFLAGS"
+fi
AC_ARG_WITH(debug,
[ --without-debug Build a production version without debugging code],
[with_debug=$withval],
--- 1.34/innobase/include/os0file.h 2005-03-16 07:34:28 +01:00
+++ 1.35/innobase/include/os0file.h 2005-05-10 11:12:38 +02:00
@@ -68,6 +68,8 @@
#define OS_FILE_OVERWRITE 53
#define OS_FILE_OPEN_RAW 54
#define OS_FILE_CREATE_PATH 55
+#define OS_FILE_OPEN_RETRY 56 /* for os_file_create() on
+ the first ibdata file */
#define OS_FILE_READ_ONLY 333
#define OS_FILE_READ_WRITE 444
--- 1.54/innobase/include/srv0srv.h 2005-05-06 11:42:44 +02:00
+++ 1.55/innobase/include/srv0srv.h 2005-05-10 11:12:38 +02:00
@@ -286,6 +286,11 @@
as committed */
#define SRV_FORCE_NO_LOG_REDO 6 /* do not do the log roll-forward
in connection with recovery */
+#ifdef __NETWARE__
+/*************************************************************************
+Gets the details about the data files used by the InnoDB */
+void srv_get_data_file_details(char*** data_file_names,unsigned long *n_data_files);
+#endif
/*************************************************************************
Boots Innobase server. */
--- 1.13/innobase/include/srv0start.h 2005-02-04 15:25:03 +01:00
+++ 1.14/innobase/include/srv0start.h 2005-05-10 11:12:38 +02:00
@@ -14,7 +14,9 @@
#include "ut0byte.h"
/*************************************************************************
-Normalizes a directory path for Windows: converts slashes to backslashes. */
+Sets the InnoDB lock writs flag */
+void srv_innodb_lock_writes(bool flag);
+/*Normalizes a directory path for Windows: converts slashes to backslashes. */
void
srv_normalize_path_for_win(
--- 1.103/innobase/os/os0file.c 2005-04-06 20:29:10 +02:00
+++ 1.104/innobase/os/os0file.c 2005-05-10 14:41:37 +02:00
@@ -24,6 +24,9 @@
#undef HAVE_FDATASYNC
+#ifdef HAVE_NETWARE_BACKUP
+#include <mysql_fs.h>
+#endif
#ifdef POSIX_ASYNC_IO
/* We assume in this case that the OS has standard Posix aio (at least SunOS
2.6, HP-UX 11i and AIX 4.3 have) */
@@ -968,10 +971,19 @@
}
if (create_mode == OS_FILE_CREATE) {
+#ifdef HAVE_NETWARE_BACKUP
+ file = my_fs_open(name, create_flag, S_IRUSR | S_IWUSR
+ | S_IRGRP | S_IWGRP);
+#else
file = open(name, create_flag, S_IRUSR | S_IWUSR
| S_IRGRP | S_IWGRP);
+#endif
} else {
+#ifdef HAVE_NETWARE_BACKUP
+ file = my_fs_open(name, create_flag, MYF(0));
+#else
file = open(name, create_flag);
+#endif
}
if (file == -1) {
@@ -1088,10 +1100,19 @@
}
if (create_mode == OS_FILE_CREATE) {
+#ifdef HAVE_NETWARE_BACKUP
+ file = my_fs_open(name, create_flag, S_IRUSR | S_IWUSR
+ | S_IRGRP | S_IWGRP);
+#else
file = open(name, create_flag, S_IRUSR | S_IWUSR
| S_IRGRP | S_IWGRP);
+#endif
} else {
+#ifdef HAVE_NETWARE_BACKUP
+ file = my_fs_open(name, create_flag, MYF(0));
+#else
file = open(name, create_flag);
+#endif
}
if (file == -1) {
@@ -1300,9 +1321,17 @@
}
#endif
if (create_mode == OS_FILE_CREATE) {
+#ifdef HAVE_NETWARE_BACKUP
+ file = my_fs_open(name, create_flag, os_innodb_umask);
+#else
file = open(name, create_flag, os_innodb_umask);
+#endif
} else {
+#ifdef HAVE_NETWARE_BACKUP
+ file = my_fs_open(name, create_flag, MYF(0));
+#else
file = open(name, create_flag);
+#endif
}
if (file == -1) {
@@ -1534,7 +1563,11 @@
#else
int ret;
+#ifdef HAVE_NETWARE_BACKUP
+ ret = my_fs_close(file, MYF(0));
+#else
ret = close(file);
+#endif
if (ret == -1) {
os_file_handle_error(NULL, "close");
@@ -1570,7 +1603,11 @@
#else
int ret;
+#ifdef HAVE_NETWARE_BACKUP
+ ret = my_fs_close(file, MYF(0));
+#else
ret = close(file);
+#endif
if (ret == -1) {
@@ -1610,7 +1647,11 @@
#else
off_t offs;
+#ifdef HAVE_NETWARE_BACKUP
+ offs = my_fs_lseek(file, 0, SEEK_END, MYF(0));
+#else
offs = lseek(file, 0, SEEK_END);
+#endif
if (offs == ((off_t)-1)) {
@@ -1904,7 +1945,11 @@
os_file_n_pending_preads++;
os_mutex_exit(os_file_count_mutex);
+#ifdef HAVE_NETWARE_BACKUP
+ n_bytes = my_fs_pread(file, buf, n, offs, MYF(0));
+#else
n_bytes = pread(file, buf, (ssize_t)n, offs);
+#endif
os_mutex_enter(os_file_count_mutex);
os_file_n_pending_preads--;
@@ -1922,7 +1967,11 @@
os_mutex_enter(os_file_seek_mutexes[i]);
+#ifdef HAVE_NETWARE_BACKUP
+ ret_offset = my_fs_lseek(file, offs, 0);
+#else
ret_offset = lseek(file, offs, SEEK_SET);
+#endif
if (ret_offset < 0) {
os_mutex_exit(os_file_seek_mutexes[i]);
@@ -1930,7 +1979,11 @@
return(-1);
}
+#ifdef HAVE_NETWARE_BACKUP
+ ret = my_fs_read(file, buf, n);
+#else
ret = read(file, buf, (ssize_t)n);
+#endif
os_mutex_exit(os_file_seek_mutexes[i]);
@@ -1980,7 +2033,11 @@
os_file_n_pending_pwrites++;
os_mutex_exit(os_file_count_mutex);
+#ifdef HAVE_NETWARE_BACKUP
+ ret = my_fs_pwrite(file, (void *) buf, n, offs, MYF(0));
+#else
ret = pwrite(file, buf, (ssize_t)n, offs);
+#endif
os_mutex_enter(os_file_count_mutex);
os_file_n_pending_pwrites--;
@@ -2008,7 +2065,11 @@
os_mutex_enter(os_file_seek_mutexes[i]);
+#ifdef HAVE_NETWARE_BACKUP
+ ret_offset = my_fs_lseek(file, offs, 0);
+#else
ret_offset = lseek(file, offs, SEEK_SET);
+#endif
if (ret_offset < 0) {
os_mutex_exit(os_file_seek_mutexes[i]);
@@ -2016,7 +2077,11 @@
return(-1);
}
- ret = write(file, buf, (ssize_t)n);
+#ifdef HAVE_NETWARE_BACKUP
+ ret = my_fs_write(file, buf, n);
+#else
+ ret = write(file, buf, n);
+#endif
if (srv_unix_file_flush_method != SRV_UNIX_LITTLESYNC
&& srv_unix_file_flush_method != SRV_UNIX_NOSYNC
@@ -2919,6 +2984,24 @@
return(segment);
}
+#ifdef __NETWARE__
+/***************************************************************************
+Checks whether the segment is a write segmetn */
+
+bool
+os_aio_check_write_segment(ulint global_segment)
+{
+ if (global_segment <2)
+ {
+ // we have to check whether the the next element in the array is the write if it is
then return TRUE;
+ return FALSE;
+ }
+ else if(global_segment < os_aio_read_array->n_segments + 2)
+ return FALSE;
+ else return TRUE;
+}
+
+#endif
/**************************************************************************
Calculates local segment number and aio array from global segment number. */
static
--- 1.89/innobase/srv/srv0srv.c 2005-05-06 10:45:50 +02:00
+++ 1.90/innobase/srv/srv0srv.c 2005-05-10 14:41:57 +02:00
@@ -320,6 +320,18 @@
ibool srv_use_awe = FALSE;
ibool srv_use_adaptive_hash_indexes = TRUE;
+#ifdef __NETWARE__
+
+/*************************************************************************
+Gets the details about the data files used by the InnoDB */
+
+void srv_get_data_file_details(char*** data_file_names,unsigned long *n_data_files)
+{
+ *data_file_names=srv_data_file_names;
+ *n_data_files=srv_n_data_files;
+}
+
+#endif
/*-------------------------------------------*/
ulong srv_n_spin_wait_rounds = 20;
ulong srv_n_free_tickets_to_enter = 500;
--- 1.74/innobase/srv/srv0start.c 2005-03-16 07:34:28 +01:00
+++ 1.75/innobase/srv/srv0start.c 2005-05-10 11:12:38 +02:00
@@ -61,6 +61,11 @@
/* Log sequence number at shutdown */
dulint srv_shutdown_lsn;
+#ifdef HAVE_DARWIN_THREADS
+# include <sys/utsname.h>
+ibool srv_have_fullfsync = FALSE;
+#endif
+
ibool srv_start_raw_disk_in_use = FALSE;
#ifdef HAVE_NETWARE_BACKUP
@@ -505,7 +510,6 @@
Adds a slash or a backslash to the end of a string if it is missing
and the string is not empty. */
-static
char*
srv_add_path_separator_if_needed(
/*=============================*/
@@ -557,6 +561,7 @@
return(file_size >> (32 - UNIV_PAGE_SIZE_SHIFT));
}
+#ifndef UNIV_HOTBACKUP
/*************************************************************************
Creates or opens the log files and closes them. */
static
@@ -594,7 +599,14 @@
files[i] = os_file_create(name, OS_FILE_CREATE, OS_FILE_NORMAL,
OS_LOG_FILE, &ret);
if (ret == FALSE) {
- if (os_file_get_last_error(FALSE) != OS_FILE_ALREADY_EXISTS) {
+ if (os_file_get_last_error(FALSE) != OS_FILE_ALREADY_EXISTS
+#ifdef UNIV_AIX
+ /* AIX 5.1 after security patch ML7 may have errno set
+ to 0 here, which causes our function to return 100;
+ work around that AIX problem */
+ && os_file_get_last_error(FALSE) != 100
+#endif
+ ) {
fprintf(stderr,
"InnoDB: Error in creating or opening %s\n", name);
@@ -754,7 +766,14 @@
OS_FILE_NORMAL, OS_DATA_FILE, &ret);
if (ret == FALSE && os_file_get_last_error(FALSE) !=
- OS_FILE_ALREADY_EXISTS) {
+ OS_FILE_ALREADY_EXISTS
+#ifdef UNIV_AIX
+ /* AIX 5.1 after security patch ML7 may have
+ errno set to 0 here, which causes our function
+ to return 100; work around that AIX problem */
+ && os_file_get_last_error(FALSE) != 100
+#endif
+ ) {
fprintf(stderr,
"InnoDB: Error in creating or opening %s\n",
name);
@@ -801,6 +820,11 @@
files[i] = os_file_create(
name, OS_FILE_OPEN_RAW, OS_FILE_NORMAL,
OS_DATA_FILE, &ret);
+ } else if (i == 0) {
+ files[i] = os_file_create(
+ name, OS_FILE_OPEN_RETRY,
+ OS_FILE_NORMAL,
+ OS_DATA_FILE, &ret);
} else {
files[i] = os_file_create(
name, OS_FILE_OPEN, OS_FILE_NORMAL,
@@ -966,6 +990,28 @@
ulint i;
ibool srv_file_per_table_original_value = srv_file_per_table;
mtr_t mtr;
+#ifdef HAVE_DARWIN_THREADS
+# ifdef F_FULLFSYNC
+ /* This executable has been compiled on Mac OS X 10.3 or later.
+ Assume that F_FULLFSYNC is available at run-time. */
+ srv_have_fullfsync = TRUE;
+# else /* F_FULLFSYNC */
+ /* This executable has been compiled on Mac OS X 10.2
+ or earlier. Determine if the executable is running
+ on Mac OS X 10.3 or later. */
+ struct utsname utsname;
+ if (uname(&utsname)) {
+ fputs("InnoDB: cannot determine Mac OS X version!\n", stderr);
+ } else {
+ srv_have_fullfsync = strcmp(utsname.release, "7.") >= 0;
+ }
+ if (!srv_have_fullfsync) {
+ fputs(
+"InnoDB: On Mac OS X, fsync() may be broken on internal drives,\n"
+"InnoDB: making transactions unsafe!\n", stderr);
+ }
+# endif /* F_FULLFSYNC */
+#endif /* HAVE_DARWIN_THREADS */
if (sizeof(ulint) != sizeof(void*)) {
fprintf(stderr,
@@ -1429,14 +1475,39 @@
return(DB_ERROR);
}
- /* Since ibuf init is in dict_boot, and ibuf is needed
- in any disk i/o, first call dict_boot */
+ /* Since the insert buffer init is in dict_boot, and the
+ insert buffer is needed in any disk i/o, first we call
+ dict_boot(). Note that trx_sys_init_at_db_start() only needs
+ to access space 0, and the insert buffer at this stage already
+ works for space 0. */
dict_boot();
trx_sys_init_at_db_start();
- /* The following needs trx lists which are initialized in
- trx_sys_init_at_db_start */
+ if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) {
+ /* The following call is necessary for the insert
+ buffer to work with multiple tablespaces. We must
+ know the mapping between space id's and .ibd file
+ names.
+
+ In a crash recovery, we check that the info in data
+ dictionary is consistent with what we already know
+ about space id's from the call of
+ fil_load_single_table_tablespaces().
+
+ In a normal startup, we create the space objects for
+ every table in the InnoDB data dictionary that has
+ an .ibd file.
+
+ We also determine the maximum tablespace id used.
+
+ TODO: We may have incomplete transactions in the
+ data dictionary tables. Does that harm the scanning of
+ the data dictionary below? */
+
+ dict_check_tablespaces_and_store_max_id(
+ recv_needed_recovery);
+ }
srv_startup_is_before_trx_rollback_phase = FALSE;
@@ -1444,6 +1515,9 @@
system */
fsp_header_get_free_limit(0);
+ /* recv_recovery_from_checkpoint_finish needs trx lists which
+ are initialized in trx_sys_init_at_db_start(). */
+
recv_recovery_from_checkpoint_finish();
}
@@ -1454,15 +1528,13 @@
fsp_header_inc_size(0, sum_of_new_sizes, &mtr);
mtr_commit(&mtr);
- }
- if (recv_needed_recovery) {
- ut_print_timestamp(stderr);
- fprintf(stderr,
- " InnoDB: Flushing modified pages from the buffer pool...\n");
- }
+ /* Immediately write the log record about increased tablespace
+ size to disk, so that it is durable even if mysqld would crash
+ quickly */
- log_make_checkpoint_at(ut_dulint_max, TRUE);
+ log_buffer_flush_to_disk();
+ }
#ifdef UNIV_LOG_ARCHIVE
/* Archiving is always off under MySQL */
@@ -1484,13 +1556,6 @@
}
}
#endif /* UNIV_LOG_ARCHIVE */
- if (!create_new_db && srv_force_recovery == 0) {
- /* After a crash recovery we only check that the info in data
- dictionary is consistent with what we already know about space
- id's from the call of fil_load_single_table_tablespaces(). */
-
- dict_check_tablespaces_or_store_max_id(recv_needed_recovery);
- }
if (srv_measure_contention) {
/* os_thread_create(&test_measure_cont, NULL, thread_ids +
@@ -1558,6 +1623,21 @@
"InnoDB: the sum of data file sizes is %lu pages\n",
(ulong) tablespace_size_in_header,
(ulong) sum_of_data_file_sizes);
+
+ if (srv_force_recovery == 0
+ && sum_of_data_file_sizes < tablespace_size_in_header) {
+ /* This is a fatal error, the tail of a tablespace is
+ missing */
+
+ fprintf(stderr,
+"InnoDB: Cannot start InnoDB. The tail of the system tablespace is\n"
+"InnoDB: missing. Have you edited innodb_data_file_path in my.cnf in an\n"
+"InnoDB: inappropriate way, removing ibdata files from there?\n"
+"InnoDB: You can set innodb_force_recovery=1 in my.cnf to force\n"
+"InnoDB: a startup if you are trying to recover a badly corrupt database.\n");
+
+ return(DB_ERROR);
+ }
}
if (srv_auto_extend_last_data_file
@@ -1568,6 +1648,18 @@
"InnoDB: the sum of data file sizes is only %lu pages\n",
(ulong) tablespace_size_in_header,
(ulong) sum_of_data_file_sizes);
+
+ if (srv_force_recovery == 0) {
+
+ fprintf(stderr,
+"InnoDB: Cannot start InnoDB. The tail of the system tablespace is\n"
+"InnoDB: missing. Have you edited innodb_data_file_path in my.cnf in an\n"
+"InnoDB: inappropriate way, removing ibdata files from there?\n"
+"InnoDB: You can set innodb_force_recovery=1 in my.cnf to force\n"
+"InnoDB: a startup if you are trying to recover a badly corrupt database.\n");
+
+ return(DB_ERROR);
+ }
}
/* Check that os_fast_mutexes work as expected */
@@ -1688,6 +1780,15 @@
The step 1 is the real InnoDB shutdown. The remaining steps 2 - ...
just free data structures after the shutdown. */
+
+ if (srv_fast_shutdown == 2) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+" InnoDB: MySQL has requested a very fast shutdown without flushing "
+"the InnoDB buffer pool to data files. At the next mysqld startup "
+"InnoDB will do a crash recovery!\n");
+ }
+
#ifdef __NETWARE__
if(!panic_shutdown)
#endif
@@ -1704,6 +1805,13 @@
srv_shutdown_state = SRV_SHUTDOWN_EXIT_THREADS;
+ /* In a 'very fast' shutdown, we do not need to wait for these threads
+ to die; all which counts is that we flushed the log; a 'very fast'
+ shutdown is essentially a crash. */
+
+ if (srv_fast_shutdown)
+ return((int) DB_SUCCESS);
+
/* All threads end up waiting for certain events. Put those events
to the signaled state. Then the threads will exit themselves in
os_thread_event_wait(). */
@@ -1812,4 +1920,5 @@
extern ibool panic_shutdown;
panic_shutdown = TRUE;
}
-#endif
+#endif /* __NETWARE__ */
+#endif /* !UNIV_HOTBACKUP */
--- 1.207/sql/ha_innodb.cc 2005-05-06 15:33:58 +02:00
+++ 1.208/sql/ha_innodb.cc 2005-05-10 11:12:39 +02:00
@@ -130,6 +130,9 @@
#include "../innobase/include/fil0fil.h"
#include "../innobase/include/trx0xa.h"
}
+#ifdef HAVE_NETWARE_BACKUP
+#include <mysql_fs.h>
+#endif
#define HA_INNOBASE_ROWS_IN_TABLE 10000 /* to get optimization right */
#define HA_INNOBASE_RANGE_COUNT 100
@@ -334,6 +337,49 @@
srv_conc_enter_innodb(trx);
}
+#ifdef __NETWARE__
+
+/**********************************************************************
+Flush all the InnoDB buffers and lock the io writes.*/
+
+void innodb_flush_all_buffers()
+{
+
+ // flush all the dirty buffer pool pages to disk. While doing so it will also flush all
the logs buffers associated
+ // with those buffer pool pages. and make a checkpoint at that position.
+ //buf_flush_all_dirty();
+
+ // redundancy is good.. Now its decided with the team that performance is not a major
consideration so this redundancy
+ log_buffer_flush_to_disk();
+
+ // flush the double write buffer.
+ //buf_flush_buffered_writes();
+
+ // make a checkpoint
+ log_make_checkpoint_at(ut_dulint_max,TRUE);
+
+// all these flushing that are done above will result in lots of async i/o wait till all
of them completes.
+ os_aio_wait_until_no_pending_writes();
+
+// after the i/o has been completed. flush all the changes to the disk ( O.S might inturn
maintain some buffers) this one takes care of them.
+ fil_flush_file_spaces(FIL_TABLESPACE);
+
+ // This is to make sure that from now on lock all the async i/o threads.
+ //srv_innodb_lock_writes(TRUE);
+
+
+}
+
+
+/**********************************************************************
+All the write io thread handlers would have been locked have to release them*/
+
+void innodb_unlock_io_threads()
+{
+ // unlock all the asyn i/o thread segments ...
+ //srv_innodb_lock_writes(FALSE);
+}
+#endif
/**********************************************************************
Save some CPU by testing the value of srv_thread_concurrency in inline
@@ -1354,6 +1400,102 @@
DBUG_RETURN(&innobase_hton);
}
+#ifdef HAVE_NETWARE_BACKUP
+
+int innobase_get_consistent_dirs(char ***consistent_dirs,int *n_consistent_dirs)
+{
+ char *internal_innobase_data_file_path = NULL, *temp_dir_name = NULL;
+ char **data_file_names, current_dir[3] ;
+ ulint n_data_files, *data_file_is_raw, last_file_max_size, *data_file_sizes,
data_file_index = 0;
+ unsigned int current_data_file = 0;
+ ibool auto_extent_last_file, ret;
+
+
+ if (!innobase_data_file_path)
+ {
+ innobase_data_file_path = (char*) "ibdata1:10M:autoextend";
+ }
+
+
+ /* Since InnoDB edits the argument in the next call, we make another
+ copy of it: */
+
+ internal_innobase_data_file_path = my_strdup(innobase_data_file_path,
+ MYF(MY_WME));
+
+ ret = (bool) srv_parse_data_file_paths_and_sizes(
+ internal_innobase_data_file_path,
+ &data_file_names,
+ &data_file_sizes,
+ &data_file_is_raw,
+ &n_data_files,
+ &auto_extent_last_file,
+ &last_file_max_size);
+ if (ret == FALSE)
+ return -1;
+
+
+ (*consistent_dirs) = (char **)my_malloc( sizeof (char *) * (n_data_files +2) ,
MY_ZEROFILL);
+ if(*consistent_dirs == NULL)
+ return -1;
+
+ temp_dir_name = process_pathname(mysql_real_data_home, NULL);
+ if(temp_dir_name == NULL)
+ goto error;
+
+ (*consistent_dirs)[0]= (char *)my_malloc(strlen(temp_dir_name)+1
+strlen(PATH_DELIMITER_STR), MY_ZEROFILL);
+ strcpy((*consistent_dirs)[0], temp_dir_name);
+
+ if(ispathdelimiter(mysql_real_data_home[strlen(mysql_real_data_home)-1]) == 0)
+ strcat((*consistent_dirs)[0], PATH_DELIMITER_STR);
+ (*n_consistent_dirs) = 1;
+
+
+ if(innobase_log_group_home_dir)
+ {
+ temp_dir_name = process_pathname(innobase_log_group_home_dir, NULL);
+ if(temp_dir_name == NULL)
+ goto error;
+
+ (*consistent_dirs)[1] = (char *)my_malloc(strlen(temp_dir_name)+1
+strlen(PATH_DELIMITER_STR), MY_ZEROFILL);
+ strcpy((*consistent_dirs)[1], temp_dir_name);
+
+ if(ispathdelimiter(temp_dir_name[strlen(temp_dir_name)-1]) == 0)
+ strcat((*consistent_dirs)[1], PATH_DELIMITER_STR);
+ (*n_consistent_dirs) = 2;
+ if(temp_dir_name != innobase_log_group_home_dir)
+ my_free(temp_dir_name, MYF(0));
+ }
+
+ for(data_file_index=0;data_file_index<n_data_files; data_file_index++)
+ {
+ (*consistent_dirs)[(*n_consistent_dirs)] =
process_pathname(data_file_names[data_file_index], NULL);
+ if((*consistent_dirs)[(*n_consistent_dirs)] == NULL)
+ return (1);
+
+
+ if((*consistent_dirs)[(*n_consistent_dirs)] == data_file_names[data_file_index])
+ (*consistent_dirs)[(*n_consistent_dirs)] =
my_strdup(data_file_names[data_file_index],
+ MYF(MY_WME));
+
+ (*n_consistent_dirs)++;
+
+ }
+
+ ut_free(data_file_sizes);
+ ut_free(data_file_is_raw);
+ ut_free(data_file_names);
+
+
+ my_free(internal_innobase_data_file_path, MYF(0));
+
+ return (0);
+error:
+ return -1;
+
+}
+
+#endif
/***********************************************************************
Closes an InnoDB database. */
--- 1.94/sql/ha_innodb.h 2005-05-09 11:26:46 +02:00
+++ 1.95/sql/ha_innodb.h 2005-05-10 11:12:39 +02:00
@@ -248,7 +248,10 @@
}
extern TYPELIB innobase_lock_typelib;
-
+#ifdef __NETWARE__
+void innodb_unlock_io_threads();
+void innodb_flush_all_buffers();
+#endif
handlerton *innobase_init(void);
bool innobase_end(void);
bool innobase_flush_logs(void);
@@ -278,6 +281,9 @@
void innobase_store_binlog_offset_and_flush_log(char *binlog_name,longlong offset);
int innobase_start_trx_and_assign_read_view(THD* thd);
+#ifdef HAVE_NETWARE_BACKUP
+int innobase_get_consistent_dirs(char ***consistent_dirs,int *n_consistent_dirs);
+#endif
/***********************************************************************
This function is used to prepare X/Open XA distributed transaction */
--- 1.27/sql/sql_rename.cc 2005-03-16 15:10:55 +01:00
+++ 1.28/sql/sql_rename.cc 2005-05-10 11:12:42 +02:00
@@ -20,6 +20,9 @@
#include "mysql_priv.h"
+#ifdef HAVE_NETWARE_BACKUP
+#include "mysql_fs.h"
+#endif
static TABLE_LIST *rename_tables(THD *thd, TABLE_LIST *table_list,
bool skip_error);
@@ -155,7 +158,11 @@
sprintf(name,"%s/%s/%s%s",mysql_data_home,
new_table->db, new_alias, reg_ext);
unpack_filename(name, name);
+ #if !defined(MYSQL_CLIENT) && defined(HAVE_NETWARE_BACKUP)
+ if (!my_fs_access(name,F_OK))
+ #else
if (!access(name,F_OK))
+ #endif
{
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), new_alias);
DBUG_RETURN(ren_table); // This can't be skipped
--- 1.13/BUILD/compile-pentium-valgrind-max 2005-01-19 19:00:40 +01:00
+++ 1.14/BUILD/compile-pentium-valgrind-max 2005-05-10 14:39:28 +02:00
@@ -8,8 +8,9 @@
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs"
-# We want to test isam when building with valgrind
-extra_configs="$extra_configs $max_leave_isam_configs --with-isam"
+# We want to test isam when building with valgrind.
+# Guilhem temporarily adds --with-nwbackup etc; not for push.
+extra_configs="$extra_configs --without-berkeley-db --with-innodb --without-isam
--with-openssl --with-vio --with-nwbackup --without-ndbcluster --without-embedded-server"
. "$path/FINISH.sh"
--- 1.66/include/my_global.h 2004-12-13 14:21:16 +01:00
+++ 1.67/include/my_global.h 2005-05-10 11:12:37 +02:00
@@ -43,6 +43,11 @@
#define HAVE_ERRNO_AS_DEFINE
#endif /* __CYGWIN__ */
+/* Determine when to use "#pragma interface" */
+#if !defined(__CYGWIN__) && !defined(__ICC) && defined(__GNUC__)
&& (__GNUC__ < 3)
+#define USE_PRAGMA_INTERFACE
+#endif
+
#if defined(i386) && !defined(__i386__)
#define __i386__
#endif
@@ -97,7 +102,7 @@
/* Fix problem with S_ISLNK() on Linux */
-#if defined(HAVE_LINUXTHREADS)
+#if defined(TARGET_OS_LINUX)
#undef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
@@ -107,6 +112,7 @@
#undef THREAD
#undef HAVE_mit_thread
#undef HAVE_LINUXTHREADS
+#undef HAVE_NPTL
#undef HAVE_UNIXWARE7_THREADS
#endif
@@ -120,6 +126,38 @@
#define __STDC_EXT__ 1 /* To get large file support on hpux */
#endif
+/*
+ Solaris 9 include file <sys/feature_tests.h> refers to X/Open document
+
+ System Interfaces and Headers, Issue 5
+
+ saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes,
+ but apparently other systems (namely FreeBSD) don't agree.
+
+ On a newer Solaris 10, the above file recognizes also _XOPEN_SOURCE=600.
+ Furthermore, it tests that if a program requires older standard
+ (_XOPEN_SOURCE<600 or _POSIX_C_SOURCE<200112L) it cannot be
+ run on a new compiler (that defines _STDC_C99) and issues an #error.
+ It's also an #error if a program requires new standard (_XOPEN_SOURCE=600
+ or _POSIX_C_SOURCE=200112L) and a compiler does not define _STDC_C99.
+
+ To add more to this mess, Sun Studio C compiler defines _STDC_C99 while
+ C++ compiler does not!
+
+ So, in a desperate attempt to get correct prototypes for both
+ C and C++ code, we define either _XOPEN_SOURCE=600 or _XOPEN_SOURCE=500
+ depending on the compiler's announced C standard support.
+
+ Cleaner solutions are welcome.
+*/
+#ifdef __sun
+#if __STDC_VERSION__ - 0 >= 199901L
+#define _XOPEN_SOURCE 600
+#else
+#define _XOPEN_SOURCE 500
+#endif
+#endif
+
#if defined(THREAD) && !defined(__WIN__) && !defined(OS2)
#ifndef _POSIX_PTHREAD_SEMANTICS
#define _POSIX_PTHREAD_SEMANTICS /* We want posix threads */
@@ -135,7 +173,13 @@
#ifdef HAVE_UNIXWARE7_THREADS
#include <thread.h>
#else
+#if defined(HPUX10) || defined(HPUX11)
+C_MODE_START /* HPUX needs this, signal.h bug */
+#include <pthread.h>
+C_MODE_END
+#else
#include <pthread.h> /* AIX must have this included first */
+#endif
#endif /* HAVE_UNIXWARE7_THREADS */
#endif /* HAVE_mit_thread */
#if !defined(SCO) && !defined(_REENTRANT)
@@ -191,34 +235,11 @@
#define __LONG_MAX__ 2147483647
#endif
-/* Fix problem when linking c++ programs with gcc 3.x */
-#ifdef DEFINE_CXA_PURE_VIRTUAL
-#define FIX_GCC_LINKING_PROBLEM \
-C_MODE_START int __cxa_pure_virtual() {\
- DBUG_ASSERT("Pure virtual method called." == "Aborted");\
- return 0;\
-} C_MODE_END
-#else
-#define FIX_GCC_LINKING_PROBLEM
-#endif
-
/* egcs 1.1.2 has a problem with memcpy on Alpha */
#if defined(__GNUC__) && defined(__alpha__) && ! (__GNUC__ > 2 ||
(__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
#define BAD_MEMCPY
#endif
-/* In Linux-alpha we have atomic.h if we are using gcc */
-#if defined(HAVE_LINUXTHREADS) && defined(__GNUC__) && defined(__alpha__)
&& (__GNUC__ > 2 || ( __GNUC__ == 2 && __GNUC_MINOR__ >= 95))
&& !defined(HAVE_ATOMIC_ADD)
-#define HAVE_ATOMIC_ADD
-#define HAVE_ATOMIC_SUB
-#endif
-
-/* In Linux-ia64 including atomic.h will give us an error */
-#if (defined(HAVE_LINUXTHREADS) && defined(__GNUC__) &&
(defined(__ia64__)||defined(__powerpc64__))) || !defined(THREAD)
-#undef HAVE_ATOMIC_ADD
-#undef HAVE_ATOMIC_SUB
-#endif
-
#if defined(_lint) && !defined(lint)
#define lint
#endif
@@ -287,9 +308,15 @@
#ifndef CONFIG_SMP
#define CONFIG_SMP
#endif
+#if defined(__ia64__)
+#define new my_arg_new
+#endif
C_MODE_START
#include <asm/atomic.h>
C_MODE_END
+#if defined(__ia64__)
+#undef new
+#endif
#endif
#include <errno.h> /* Recommended by debian */
/* We need the following to go around a problem with openssl on solaris */
@@ -386,6 +413,8 @@
#endif
#if defined(__EMX__) || !defined(HAVE_UINT)
+#undef HAVE_UINT
+#define HAVE_UINT
typedef unsigned int uint;
typedef unsigned short ushort;
#endif
@@ -517,6 +546,9 @@
#ifndef O_SHORT_LIVED
#define O_SHORT_LIVED 0
#endif
+#ifndef O_NOFOLLOW
+#define O_NOFOLLOW 0
+#endif
/* #define USE_RECORD_LOCK */
@@ -530,7 +562,11 @@
#define FN_LEN 256 /* Max file name len */
#define FN_HEADLEN 253 /* Max length of filepart of file name */
#define FN_EXTLEN 20 /* Max length of extension (part of FN_LEN) */
+#ifdef PATH_MAX
+#define FN_REFLEN PATH_MAX/* Max length of full path-name */
+#else
#define FN_REFLEN 512 /* Max length of full path-name */
+#endif
#define FN_EXTCHAR '.'
#define FN_HOMELIB '~' /* ~/ is used as abbrev for home dir */
#define FN_CURLIB '.' /* ./ is used as abbrev for current dir */
@@ -664,6 +700,7 @@
#define UINT_MAX16 0xFFFF
#define INT_MIN8 (~0x7F)
#define INT_MAX8 0x7F
+#define UINT_MAX8 0xFF
/* From limits.h instead */
#ifndef DBL_MIN
@@ -753,10 +790,10 @@
#endif
typedef unsigned long uint32; /* Short for unsigned integer >= 32 bits */
#else
-error "Neither int or long is of 4 bytes width"
+#error "Neither int or long is of 4 bytes width"
#endif
-#if !defined(HAVE_ULONG) && !defined(HAVE_LINUXTHREADS) &&
!defined(__USE_MISC)
+#if !defined(HAVE_ULONG) && !defined(TARGET_OS_LINUX) &&
!defined(__USE_MISC)
typedef unsigned long ulong; /* Short for unsigned long */
#endif
#ifndef longlong_defined
@@ -1086,7 +1123,7 @@
#define float4store(V,M) memcpy_fixed((byte*) V,(byte*) (&M),sizeof(float))
#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
-#define doublestore(T,V) do { *(T)= ((byte *) &V)[4];\
+#define doublestore(T,V) do { *(((char*)T)+0)=(char) ((byte *) &V)[4];\
*(((char*)T)+1)=(char) ((byte *) &V)[5];\
*(((char*)T)+2)=(char) ((byte *) &V)[6];\
*(((char*)T)+3)=(char) ((byte *) &V)[7];\
--- 1.10/mysys/my_symlink2.c 2005-03-24 11:25:43 +01:00
+++ 1.11/mysys/my_symlink2.c 2005-05-10 11:12:38 +02:00
@@ -39,6 +39,7 @@
int tmp_errno;
/* Test if we should create a link */
int create_link;
+ char abs_linkname[FN_REFLEN];
DBUG_ENTER("my_create_with_symlink");
//TBD - This has to be removed later as there are some issues with ALTER TABLE
@@ -54,7 +55,11 @@
filename= linkname;
}
else
- create_link= (linkname && strcmp(linkname,filename));
+ {
+ if (linkname)
+ my_realpath(abs_linkname, linkname, MYF(0));
+ create_link= (linkname && strcmp(abs_linkname,filename));
+ }
if (!(MyFlags & MY_DELETE_OLD))
{
--- 1.13/include/mysql_embed.h 2005-04-04 11:51:47 +02:00
+++ 1.14/include/mysql_embed.h 2005-05-10 11:12:37 +02:00
@@ -24,7 +24,6 @@
#undef HAVE_PSTACK /* No stacktrace */
#undef HAVE_DLOPEN /* No udf functions */
#undef HAVE_OPENSSL
-#undef HAVE_ISAM
#undef HAVE_SMEM /* No shared memory */
#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */
--- 1.7/include/config-netware.h 2005-03-21 21:28:50 +01:00
+++ 1.8/include/config-netware.h 2005-05-10 11:12:37 +02:00
@@ -50,7 +50,7 @@
#define HAVE_PTHREAD_SIGMASK 1
#define HAVE_PTHREAD_YIELD_ZERO_ARG 1
#define HAVE_BROKEN_REALPATH 1
-
+#define CANT_DELETE_OPEN_FILES 1 /* saves open files in a list, for delayed delete */
/* no libc crypt() function */
#ifdef HAVE_OPENSSL
#define HAVE_CRYPT 1
--- 1.25/sql/protocol.h 2004-12-13 14:21:17 +01:00
+++ 1.26/sql/protocol.h 2005-05-10 11:12:40 +02:00
@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif
@@ -54,7 +54,6 @@
enum { SEND_NUM_ROWS= 1, SEND_DEFAULTS= 2, SEND_EOF= 4 };
virtual bool send_fields(List<Item> *list, uint flags);
- bool send_records_num(List<Item> *list, ulonglong records);
bool store(I_List<i_string> *str_list);
bool store(const char *from, CHARSET_INFO *cs);
String *storage_packet() { return packet; }
@@ -82,6 +81,7 @@
virtual bool store_short(longlong from)=0;
virtual bool store_long(longlong from)=0;
virtual bool store_longlong(longlong from, bool unsigned_flag)=0;
+ virtual bool store_decimal(const my_decimal *)=0;
virtual bool store(const char *from, uint length, CHARSET_INFO *cs)=0;
virtual bool store(const char *from, uint length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs)=0;
@@ -107,6 +107,7 @@
virtual bool store_short(longlong from);
virtual bool store_long(longlong from);
virtual bool store_longlong(longlong from, bool unsigned_flag);
+ virtual bool store_decimal(const my_decimal *);
virtual bool store(const char *from, uint length, CHARSET_INFO *cs);
virtual bool store(const char *from, uint length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs);
@@ -137,6 +138,7 @@
virtual bool store_short(longlong from);
virtual bool store_long(longlong from);
virtual bool store_longlong(longlong from, bool unsigned_flag);
+ virtual bool store_decimal(const my_decimal *);
virtual bool store(const char *from,uint length, CHARSET_INFO *cs);
virtual bool store(const char *from, uint length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs);
--- 1.109/sql/set_var.cc 2005-05-05 17:09:13 +02:00
+++ 1.110/sql/set_var.cc 2005-05-10 11:12:41 +02:00
@@ -68,6 +68,9 @@
#include "ha_ndbcluster.h"
#endif
+#ifdef HAVE_NETWARE_BACKUP
+#include <mysql_fs.h>
+#endif
static HASH system_variable_hash;
const char *bool_type_names[]= { "OFF", "ON", NullS };
TYPELIB bool_typelib=
@@ -122,6 +125,9 @@
static byte *get_error_count(THD *thd);
static byte *get_warning_count(THD *thd);
+#ifdef HAVE_NETWARE_BACKUP
+static bool set_backup_mode(THD *thd, set_var * var);
+#endif
/*
Variable definition list
@@ -532,6 +538,11 @@
sys_var_thd_time_zone sys_time_zone("time_zone");
+/** Online Backup **/
+#ifdef HAVE_NETWARE_BACKUP
+extern my_bool opt_backupmode;
+sys_var_bool_ptr sys_backupmode("backup_mode", &opt_backupmode , ( (sys_update_func)
set_backup_mode));
+#endif
/* Read only variables */
sys_var_const_str sys_os("version_compile_os", SYSTEM_TYPE);
@@ -718,6 +729,9 @@
&sys_ndb_use_exact_count,
&sys_ndb_use_transactions,
#endif
+#ifdef HAVE_NETWARE_BACKUP
+ &sys_backupmode,
+#endif
&sys_unique_checks,
&sys_updatable_views_with_limit,
&sys_warning_count
@@ -733,6 +747,10 @@
{"auto_increment_offset", (char*) &sys_auto_increment_offset, SHOW_SYS},
{sys_automatic_sp_privileges.name,(char*) &sys_automatic_sp_privileges,
SHOW_SYS},
{"back_log", (char*) &back_log, SHOW_LONG},
+#ifdef HAVE_NETWARE_BACKUP
+ {sys_backupmode.name, (char*) &sys_backupmode, SHOW_SYS},
+ {"backup_updates_path", mysql_real_backup_updates_path, SHOW_CHAR},
+#endif
{"basedir", mysql_home, SHOW_CHAR},
#ifdef HAVE_BERKELEY_DB
{"bdb_cache_size", (char*) &berkeley_cache_size, SHOW_LONG},
@@ -787,6 +805,7 @@
{"have_geometry", (char*) &have_geometry, SHOW_HAVE},
{"have_innodb", (char*) &have_innodb, SHOW_HAVE},
{"have_isam", (char*) &have_isam, SHOW_HAVE},
+ {"have_nwbackup", (char*) &have_nwbackup, SHOW_HAVE},
{"have_ndbcluster", (char*) &have_ndbcluster, SHOW_HAVE},
{"have_openssl", (char*) &have_openssl, SHOW_HAVE},
{"have_query_cache", (char*) &have_query_cache, SHOW_HAVE},
@@ -1396,6 +1415,8 @@
bool sys_var_bool_ptr::update(THD *thd, set_var *var)
{
*value= (my_bool) var->save_result.ulong_value;
+ if(update_func)
+ (*update_func)(thd, var);
return 0;
}
@@ -2662,6 +2683,40 @@
}
+/*
+ Functions to update thd->options bits
+*/
+#ifdef HAVE_NETWARE_BACKUP
+
+static bool set_backup_mode(THD *thd, set_var * var)
+{
+ int errcode = 0;
+ bool is_warnings = 0;
+
+ if( var->save_result.ulong_value)
+ errcode = my_fs_set_backup_mode(FAST_INSERT_BACKUP_MODE);
+ else
+ errcode = my_fs_reset_backup_mode(&is_warnings);
+
+ if(errcode && errcode != MYSQL_FS_ERROR_BACKUP_MODE_NOTSET &&errcode !=
MYSQL_FS_ERROR_BACKUP_MODE_SET)
+ {
+ if( var->save_result.ulong_value)
+ my_error(ER_BACKUP_MODE_SET_ERROR, MYF(0), errcode);
+ else
+ my_error(ER_BACKUP_MODE_RESET_ERROR,MYF(0), errcode);
+ return 1;
+ }
+
+ if(is_warnings == TRUE)
+ {
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_WARN_BACKUP_MODE_MERGE,
+ ER(ER_WARN_BACKUP_MODE_MERGE));
+ }
+ return 0;
+
+}
+#endif
static bool set_option_autocommit(THD *thd, set_var *var)
{
/* The test is negative as the flag we use is NOT autocommit */
--- 1.57/sql/set_var.h 2004-12-13 14:21:17 +01:00
+++ 1.58/sql/set_var.h 2005-05-10 11:12:41 +02:00
@@ -16,7 +16,7 @@
/* Classes to support the SET command */
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif
@@ -87,6 +87,7 @@
sys_var_long_ptr(const char *name_arg, ulong *value_ptr,
sys_after_update_func func)
:sys_var(name_arg,func), value(value_ptr) {}
+ bool check(THD *thd, set_var *var);
bool update(THD *thd, set_var *var);
void set_default(THD *thd, enum_var_type type);
SHOW_TYPE type() { return SHOW_LONG; }
@@ -570,9 +571,6 @@
public:
sys_var_character_set_server(const char *name_arg) :
sys_var_character_set(name_arg) {}
-#if defined(HAVE_REPLICATION)
- bool check(THD *thd, set_var *var);
-#endif
void set_default(THD *thd, enum_var_type type);
CHARSET_INFO **ci_ptr(THD *thd, enum_var_type type);
};
@@ -608,9 +606,6 @@
{
public:
sys_var_collation_server(const char *name_arg) :sys_var_collation(name_arg) {}
-#if defined(HAVE_REPLICATION)
- bool check(THD *thd, set_var *var);
-#endif
bool update(THD *thd, set_var *var);
void set_default(THD *thd, enum_var_type type);
byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
@@ -730,7 +725,23 @@
bool update(THD *thd, set_var *var);
byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
virtual void set_default(THD *thd, enum_var_type type);
- Time_zone **get_tz_ptr(THD *thd, enum_var_type type);
+};
+
+
+class sys_var_max_user_conn : public sys_var_thd
+{
+public:
+ sys_var_max_user_conn(const char *name_arg):
+ sys_var_thd(name_arg) {}
+ bool check(THD *thd, set_var *var);
+ bool update(THD *thd, set_var *var);
+ bool check_default(enum_var_type type)
+ {
+ return type != OPT_GLOBAL || !option_limits;
+ }
+ void set_default(THD *thd, enum_var_type type);
+ SHOW_TYPE type() { return SHOW_INT; }
+ byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
};
/****************************************************************************
@@ -768,7 +779,7 @@
} save_result;
LEX_STRING base; /* for structs */
- set_var(enum_var_type type_arg, sys_var *var_arg, LEX_STRING *base_name_arg,
+ set_var(enum_var_type type_arg, sys_var *var_arg, const LEX_STRING *base_name_arg,
Item *value_arg)
:var(var_arg), type(type_arg), base(*base_name_arg)
{
--- 1.4/mysys/my_sync.c 2005-04-06 18:43:27 +02:00
+++ 1.5/mysys/my_sync.c 2005-05-10 11:12:39 +02:00
@@ -14,6 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
#include "mysys_priv.h"
#include "mysys_err.h"
#include <errno.h>
--- 1.199/BitKeeper/etc/ignore 2005-04-06 17:33:57 +02:00
+++ 1.200/BitKeeper/etc/ignore 2005-05-10 11:11:31 +02:00
@@ -102,6 +102,7 @@
Makefile.in'
PENDING/*
TAGS
+VC++Files/client/mysql_amd64.dsp
ac_available_languages_fragment
acinclude.m4
aclocal.m4
@@ -274,6 +275,8 @@
client/mysqlmanagerc
client/mysqlshow
client/mysqltest
+client/mysqltestmanager-pwgen
+client/mysqltestmanagerc
client/mysys_priv.h
client/select_test
client/ssl_test
@@ -529,6 +532,17 @@
mit-pthreads/pg++
mit-pthreads/pgcc
mit-pthreads/syscall.S
+mygul.IAB
+mygul.IAD
+mygul.IMB
+mygul.IMD
+mygul.PFI
+mygul.PO
+mygul.PR
+mygul.PRI
+mygul.PS
+mygul.SearchResults
+mygul.WK3
myisam/FT1.MYD
myisam/FT1.MYI
myisam/ft_dump
@@ -557,6 +571,7 @@
mysql-4.0.2-alpha-pc-linux-gnu-i686.tar.gz
mysql-4.0.2-alpha.tar.gz
mysql-4.1.8-win-src.zip
+mysql-5.0.2-alpha-pc-linux-i686.tar.gz
mysql-5.0.2-alpha.tar.gz
mysql-max-4.0.2-alpha-pc-linux-gnu-i686.tar.gz
mysql-test/gmon.out
@@ -1100,13 +1115,10 @@
tools/my_vsnprintf.c
tools/mysqlmanager
tools/mysqlmngd
+tools/mysqltestmanager
tools/mysys_priv.h
vi.h
vio/test-ssl
vio/test-sslclient
vio/test-sslserver
vio/viotest-ssl
-VC++Files/client/mysql_amd64.dsp
-client/mysqltestmanager-pwgen
-client/mysqltestmanagerc
-tools/mysqltestmanager
| Thread |
|---|
| • bk commit into 5.0 tree (guilhem:1.1964) | guilhem | 10 May |