1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1

into mc05.(none):/space2/tomas/mysql-4.1-ndb-test
This commit is contained in:
tomas@mc05.(none)
2004-05-27 11:36:08 +02:00
50 changed files with 500 additions and 511 deletions

View File

@ -7,8 +7,13 @@ extra_flags="$pentium_cflags $fast_cflags -g"
extra_configs="$pentium_configs" extra_configs="$pentium_configs"
#strip=yes #strip=yes
#extra_configs="$extra_configs --with-innodb --with-berkeley-db \
# --with-embedded-server --enable-thread-safe-client \
# --with-openssl --with-vio --with-raid --with-ndbcluster"
# removed per discussion with Brian and Sanja because it makes Bootstrap
# fail
extra_configs="$extra_configs --with-innodb --with-berkeley-db \ extra_configs="$extra_configs --with-innodb --with-berkeley-db \
--with-embedded-server --enable-thread-safe-client \ --with-embedded-server --enable-thread-safe-client \
--with-openssl --with-vio --with-raid --with-ndbcluster" --with-openssl --with-vio --with-raid --without-ndbcluster"
. "$path/FINISH.sh" . "$path/FINISH.sh"

9
Docs/manual_toc.html Normal file
View File

@ -0,0 +1,9 @@
<html>
<head>
<title>Place holder for manual_toc.html</title>
</head>
<body>
This is just a place holder for the autogenerated manual_toc.html
to make "make dist" happy.
</body>
</html>

View File

@ -24,7 +24,7 @@ SUBDIRS = . include @docs_dirs@ \
@readline_topdir@ sql-common \ @readline_topdir@ sql-common \
@thread_dirs@ pstack @sql_client_dirs@ \ @thread_dirs@ pstack @sql_client_dirs@ \
@sql_server_dirs@ scripts man tests SSL\ @sql_server_dirs@ scripts man tests SSL\
BUILD @netware_dir@ os2 @libmysqld_dirs@ \ BUILD netware os2 @libmysqld_dirs@ \
@bench_dirs@ support-files @fs_dirs@ @tools_dirs@ @bench_dirs@ support-files @fs_dirs@ @tools_dirs@
# Relink after clean # Relink after clean

View File

@ -41,7 +41,7 @@ RSC=rc.exe
# PROP Intermediate_Dir "release" # PROP Intermediate_Dir "release"
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_TLS" /D "NDEBUG" /FD /c # ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_TLS" /D "MYSQL_CLIENT" /D "NDEBUG" /FD /c
# SUBTRACT CPP /YX # SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 # ADD BASE RSC /l 0x409
# ADD RSC /l 0x409 # ADD RSC /l 0x409
@ -65,7 +65,7 @@ LIB32=xilink6.exe -lib
# PROP Intermediate_Dir "debug" # PROP Intermediate_Dir "debug"
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /FD /c # ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /D "MYSQL_CLIENT" /FD /c
# SUBTRACT CPP /YX # SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 # ADD BASE RSC /l 0x409
# ADD RSC /l 0x409 # ADD RSC /l 0x409

View File

@ -312,10 +312,6 @@ SOURCE=.\pars\pars0sym.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\que\que0que.c
# End Source File
# Begin Source File
SOURCE=.\read\read0read.c SOURCE=.\read\read0read.c
# End Source File # End Source File
# Begin Source File # Begin Source File
@ -368,10 +364,6 @@ SOURCE=.\row\row0vers.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\srv\srv0que.c
# End Source File
# Begin Source File
SOURCE=.\srv\srv0srv.c SOURCE=.\srv\srv0srv.c
# End Source File # End Source File
# Begin Source File # Begin Source File

View File

@ -136,6 +136,7 @@ static my_bool info_flag=0,ignore_errors=0,wait_flag=0,quick=0,
tty_password= 0, opt_nobeep=0, opt_reconnect=1, tty_password= 0, opt_nobeep=0, opt_reconnect=1,
default_charset_used= 0, opt_secure_auth= 0, default_charset_used= 0, opt_secure_auth= 0,
default_pager_set= 0; default_pager_set= 0;
static ulong opt_max_allowed_packet, opt_net_buffer_length;
static uint verbose=0,opt_silent=0,opt_mysql_port=0, opt_local_infile=0; static uint verbose=0,opt_silent=0,opt_mysql_port=0, opt_local_infile=0;
static my_string opt_mysql_unix_port=0; static my_string opt_mysql_unix_port=0;
static int connect_flag=CLIENT_INTERACTIVE; static int connect_flag=CLIENT_INTERACTIVE;
@ -368,7 +369,7 @@ int main(int argc,char *argv[])
exit(1); exit(1);
} }
if (status.batch && !status.line_buff && if (status.batch && !status.line_buff &&
!(status.line_buff=batch_readline_init(max_allowed_packet+512,stdin))) !(status.line_buff=batch_readline_init(opt_max_allowed_packet+512,stdin)))
{ {
free_defaults(defaults_argv); free_defaults(defaults_argv);
my_end(0); my_end(0);
@ -644,12 +645,12 @@ static struct my_option my_long_options[] =
0, 1}, 0, 1},
{"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET,
"Max packet length to send to, or receive from server", "Max packet length to send to, or receive from server",
(gptr*) &max_allowed_packet, (gptr*) &max_allowed_packet, 0, GET_ULONG, (gptr*) &opt_max_allowed_packet, (gptr*) &opt_max_allowed_packet, 0, GET_ULONG,
REQUIRED_ARG, 16 *1024L*1024L, 4096, (longlong) 2*1024L*1024L*1024L, REQUIRED_ARG, 16 *1024L*1024L, 4096, (longlong) 2*1024L*1024L*1024L,
MALLOC_OVERHEAD, 1024, 0}, MALLOC_OVERHEAD, 1024, 0},
{"net_buffer_length", OPT_NET_BUFFER_LENGTH, {"net_buffer_length", OPT_NET_BUFFER_LENGTH,
"Buffer for TCP/IP and socket communication", "Buffer for TCP/IP and socket communication",
(gptr*) &net_buffer_length, (gptr*) &net_buffer_length, 0, GET_ULONG, (gptr*) &opt_net_buffer_length, (gptr*) &opt_net_buffer_length, 0, GET_ULONG,
REQUIRED_ARG, 16384, 1024, 512*1024*1024L, MALLOC_OVERHEAD, 1024, 0}, REQUIRED_ARG, 16384, 1024, 512*1024*1024L, MALLOC_OVERHEAD, 1024, 0},
{"select_limit", OPT_SELECT_LIMIT, {"select_limit", OPT_SELECT_LIMIT,
"Automatic limit for SELECT when using --safe-updates", "Automatic limit for SELECT when using --safe-updates",
@ -839,6 +840,7 @@ static int get_options(int argc, char **argv)
{ {
char *tmp, *pagpoint; char *tmp, *pagpoint;
int ho_error; int ho_error;
MYSQL_PARAMETERS *mysql_params= mysql_get_parameters();
tmp= (char *) getenv("MYSQL_HOST"); tmp= (char *) getenv("MYSQL_HOST");
if (tmp) if (tmp)
@ -854,9 +856,15 @@ static int get_options(int argc, char **argv)
strmov(pager, pagpoint); strmov(pager, pagpoint);
strmov(default_pager, pager); strmov(default_pager, pager);
opt_max_allowed_packet= *mysql_params->p_max_allowed_packet;
opt_net_buffer_length= *mysql_params->p_net_buffer_length;
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
exit(ho_error); exit(ho_error);
*mysql_params->p_max_allowed_packet= opt_max_allowed_packet;
*mysql_params->p_net_buffer_length= opt_net_buffer_length;
if (status.batch) /* disable pager and outfile in this case */ if (status.batch) /* disable pager and outfile in this case */
{ {
strmov(default_pager, "stdout"); strmov(default_pager, "stdout");
@ -2529,7 +2537,7 @@ static int com_source(String *buffer, char *line)
return put_info(buff, INFO_ERROR, 0); return put_info(buff, INFO_ERROR, 0);
} }
if (!(line_buff=batch_readline_init(max_allowed_packet+512,sql_file))) if (!(line_buff=batch_readline_init(opt_max_allowed_packet+512,sql_file)))
{ {
my_fclose(sql_file,MYF(0)); my_fclose(sql_file,MYF(0));
return put_info("Can't initialize batch_readline", INFO_ERROR, 0); return put_info("Can't initialize batch_readline", INFO_ERROR, 0);

View File

@ -82,7 +82,7 @@ static my_bool verbose=0,tFlag=0,cFlag=0,dFlag=0,quick= 1, extended_insert= 1,
opt_autocommit=0,opt_master_data,opt_disable_keys=1,opt_xml=0, opt_autocommit=0,opt_master_data,opt_disable_keys=1,opt_xml=0,
opt_delete_master_logs=0, tty_password=0, opt_delete_master_logs=0, tty_password=0,
opt_single_transaction=0, opt_comments= 0, opt_compact= 0; opt_single_transaction=0, opt_comments= 0, opt_compact= 0;
static ulong opt_max_allowed_packet, opt_net_buffer_length;
static MYSQL mysql_connection,*sock=0; static MYSQL mysql_connection,*sock=0;
static char insert_pat[12 * 1024],*opt_password=0,*current_user=0, static char insert_pat[12 * 1024],*opt_password=0,*current_user=0,
*current_host=0,*path=0,*fields_terminated=0, *current_host=0,*path=0,*fields_terminated=0,
@ -95,7 +95,6 @@ static ulong opt_compatible_mode= 0;
static uint opt_mysql_port= 0, err_len= 0; static uint opt_mysql_port= 0, err_len= 0;
static my_string opt_mysql_unix_port=0; static my_string opt_mysql_unix_port=0;
static int first_error=0; static int first_error=0;
extern ulong net_buffer_length;
static DYNAMIC_STRING extended_row; static DYNAMIC_STRING extended_row;
#include <sslopt-vars.h> #include <sslopt-vars.h>
FILE *md_result_file; FILE *md_result_file;
@ -304,11 +303,11 @@ static struct my_option my_long_options[] =
{"xml", 'X', "Dump a database as well formed XML.", 0, 0, 0, GET_NO_ARG, {"xml", 'X', "Dump a database as well formed XML.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0}, NO_ARG, 0, 0, 0, 0, 0, 0},
{"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, "", {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, "",
(gptr*) &max_allowed_packet, (gptr*) &max_allowed_packet, 0, (gptr*) &opt_max_allowed_packet, (gptr*) &opt_max_allowed_packet, 0,
GET_ULONG, REQUIRED_ARG, 24*1024*1024, 4096, GET_ULONG, REQUIRED_ARG, 24*1024*1024, 4096,
(longlong) 2L*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0}, (longlong) 2L*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0},
{"net_buffer_length", OPT_NET_BUFFER_LENGTH, "", {"net_buffer_length", OPT_NET_BUFFER_LENGTH, "",
(gptr*) &net_buffer_length, (gptr*) &net_buffer_length, 0, (gptr*) &opt_net_buffer_length, (gptr*) &opt_net_buffer_length, 0,
GET_ULONG, REQUIRED_ARG, 1024*1024L-1025, 4096, 16*1024L*1024L, GET_ULONG, REQUIRED_ARG, 1024*1024L-1025, 4096, 16*1024L*1024L,
MALLOC_OVERHEAD-1024, 1024, 0}, MALLOC_OVERHEAD-1024, 1024, 0},
{"comments", 'i', "Write additional information.", {"comments", 'i', "Write additional information.",
@ -566,6 +565,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
static int get_options(int *argc, char ***argv) static int get_options(int *argc, char ***argv)
{ {
int ho_error; int ho_error;
MYSQL_PARAMETERS *mysql_params= mysql_get_parameters();
opt_max_allowed_packet= *mysql_params->p_max_allowed_packet;
opt_net_buffer_length= *mysql_params->p_net_buffer_length;
md_result_file= stdout; md_result_file= stdout;
load_defaults("my",load_default_groups,argc,argv); load_defaults("my",load_default_groups,argc,argv);
@ -573,6 +576,9 @@ static int get_options(int *argc, char ***argv)
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option))) if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
exit(ho_error); exit(ho_error);
*mysql_params->p_max_allowed_packet= opt_max_allowed_packet;
*mysql_params->p_net_buffer_length= opt_net_buffer_length;
if (opt_delayed) if (opt_delayed)
opt_lock=0; /* Can't have lock with delayed */ opt_lock=0; /* Can't have lock with delayed */
if (!path && (enclosed || opt_enclosed || escaped || lines_terminated || if (!path && (enclosed || opt_enclosed || escaped || lines_terminated ||
@ -1399,7 +1405,7 @@ static void dumpTable(uint numFields, char *table)
if (opt_lock) if (opt_lock)
fprintf(md_result_file,"LOCK TABLES %s WRITE;\n", opt_quoted_table); fprintf(md_result_file,"LOCK TABLES %s WRITE;\n", opt_quoted_table);
total_length=net_buffer_length; /* Force row break */ total_length= opt_net_buffer_length; /* Force row break */
row_break=0; row_break=0;
rownr=0; rownr=0;
init_length=(uint) strlen(insert_pat)+4; init_length=(uint) strlen(insert_pat)+4;
@ -1544,7 +1550,7 @@ static void dumpTable(uint numFields, char *table)
ulong row_length; ulong row_length;
dynstr_append(&extended_row,")"); dynstr_append(&extended_row,")");
row_length = 2 + extended_row.length; row_length = 2 + extended_row.length;
if (total_length + row_length < net_buffer_length) if (total_length + row_length < opt_net_buffer_length)
{ {
total_length += row_length; total_length += row_length;
fputc(',',md_result_file); /* Always row break */ fputc(',',md_result_file); /* Always row break */

View File

@ -2659,6 +2659,7 @@ if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null; then
fi fi
AC_SUBST(netware_dir) AC_SUBST(netware_dir)
AC_SUBST(linked_netware_sources) AC_SUBST(linked_netware_sources)
AM_CONDITIONAL(HAVE_NETWARE, test "$netware_dir" = "netware")
if test "$with_server" = "yes" -o "$THREAD_SAFE_CLIENT" != "no" if test "$with_server" = "yes" -o "$THREAD_SAFE_CLIENT" != "no"
then then

View File

@ -26,7 +26,7 @@ pkginclude_HEADERS = my_dbug.h m_string.h my_sys.h my_list.h my_xml.h \
noinst_HEADERS = config-win.h config-os2.h config-netware.h \ noinst_HEADERS = config-win.h config-os2.h config-netware.h \
nisam.h heap.h merge.h my_bitmap.h\ nisam.h heap.h merge.h my_bitmap.h\
myisam.h myisampack.h myisammrg.h ft_global.h\ myisam.h myisampack.h myisammrg.h ft_global.h\
mysys_err.h my_base.h \ mysys_err.h my_base.h help_start.h help_end.h \
my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \ my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \
my_aes.h my_tree.h hash.h thr_alarm.h \ my_aes.h my_tree.h hash.h thr_alarm.h \
thr_lock.h t_ctype.h violite.h md5.h \ thr_lock.h t_ctype.h violite.h md5.h \

View File

@ -317,6 +317,17 @@ typedef struct st_mysql_manager
char last_error[MAX_MYSQL_MANAGER_ERR]; char last_error[MAX_MYSQL_MANAGER_ERR];
} MYSQL_MANAGER; } MYSQL_MANAGER;
typedef struct st_mysql_parameters
{
unsigned long *p_max_allowed_packet;
unsigned long *p_net_buffer_length;
} MYSQL_PARAMETERS;
#if !defined(MYSQL_CLIENT) && !defined(MYSQL_SERVER) && !defined(EMBEDDED_LIBRARY)
#define max_allowed_packet (*mysql_get_parameters()->p_max_allowed_packet)
#define net_buffer_length (*mysql_get_parameters()->p_net_buffer_length)
#endif
/* /*
Set up and bring down the server; to ensure that applications will Set up and bring down the server; to ensure that applications will
work when linked against either the standard client library or the work when linked against either the standard client library or the
@ -325,6 +336,8 @@ typedef struct st_mysql_manager
int STDCALL mysql_server_init(int argc, char **argv, char **groups); int STDCALL mysql_server_init(int argc, char **argv, char **groups);
void STDCALL mysql_server_end(void); void STDCALL mysql_server_end(void);
MYSQL_PARAMETERS *STDCALL mysql_get_parameters();
/* /*
Set up and bring down a thread; these function should be called Set up and bring down a thread; these function should be called
for each thread in an application which opens at least one MySQL for each thread in an application which opens at least one MySQL

View File

@ -36,12 +36,6 @@
#define MYSQL_SERVICENAME "MySQL" #define MYSQL_SERVICENAME "MySQL"
#endif /* __WIN__ */ #endif /* __WIN__ */
#if defined(__WIN__) && !defined(MYSQL_SERVER) && !defined(MYSQL_CLIENT) && !defined(EMBEDDED_LIBRARY)
#define dll_import_spec __declspec( dllimport )
#else
#define dll_import_spec
#endif
enum enum_server_command enum enum_server_command
{ {
COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST, COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST,
@ -312,9 +306,6 @@ typedef struct st_udf_init
extern "C" { extern "C" {
#endif #endif
dll_import_spec extern unsigned long max_allowed_packet;
dll_import_spec extern unsigned long net_buffer_length;
/* /*
These functions are used for authentication by client and server and These functions are used for authentication by client and server and
implemented in sql/password.c implemented in sql/password.c

View File

@ -114,20 +114,6 @@ dulint
log_get_lsn(void); log_get_lsn(void);
/*=============*/ /*=============*/
/* out: current lsn */ /* out: current lsn */
/****************************************************************************
Gets the online backup lsn. */
UNIV_INLINE
dulint
log_get_online_backup_lsn_low(void);
/*===============================*/
/****************************************************************************
Gets the online backup state. */
UNIV_INLINE
ibool
log_get_online_backup_state_low(void);
/*=================================*/
/* out: online backup state, the caller must
own the log_sys mutex */
/********************************************************** /**********************************************************
Initializes the log. */ Initializes the log. */
@ -326,20 +312,6 @@ log_archived_file_name_gen(
char* buf, /* in: buffer where to write */ char* buf, /* in: buffer where to write */
ulint id, /* in: group id */ ulint id, /* in: group id */
ulint file_no);/* in: file number */ ulint file_no);/* in: file number */
/**********************************************************
Switches the database to the online backup state. */
ulint
log_switch_backup_state_on(void);
/*============================*/
/* out: DB_SUCCESS or DB_ERROR */
/**********************************************************
Switches the online backup state off. */
ulint
log_switch_backup_state_off(void);
/*=============================*/
/* out: DB_SUCCESS or DB_ERROR */
/************************************************************************ /************************************************************************
Checks that there is enough free space in the log to start a new query step. Checks that there is enough free space in the log to start a new query step.
Flushes the log buffer or makes a new checkpoint if necessary. NOTE: this Flushes the log buffer or makes a new checkpoint if necessary. NOTE: this
@ -878,13 +850,6 @@ struct log_struct{
os_event_t archiving_on; /* if archiving has been stopped, os_event_t archiving_on; /* if archiving has been stopped,
a thread can wait for this event to a thread can wait for this event to
become signaled */ become signaled */
/* Fields involved in online backups */
ibool online_backup_state;
/* TRUE if the database is in the
online backup state */
dulint online_backup_lsn;
/* lsn when the state was changed to
the online backup state */
}; };
#define LOG_ARCH_ON 71 #define LOG_ARCH_ON 71

View File

@ -318,8 +318,7 @@ log_reserve_and_write_fast(
data_len = len + log->buf_free % OS_FILE_LOG_BLOCK_SIZE; data_len = len + log->buf_free % OS_FILE_LOG_BLOCK_SIZE;
if (log->online_backup_state if (data_len >= OS_FILE_LOG_BLOCK_SIZE - LOG_BLOCK_TRL_SIZE) {
|| (data_len >= OS_FILE_LOG_BLOCK_SIZE - LOG_BLOCK_TRL_SIZE)) {
/* The string does not fit within the current log block /* The string does not fit within the current log block
or the log block would become full */ or the log block would become full */
@ -403,36 +402,3 @@ log_free_check(void)
log_check_margins(); log_check_margins();
} }
} }
/****************************************************************************
Gets the online backup lsn. */
UNIV_INLINE
dulint
log_get_online_backup_lsn_low(void)
/*===============================*/
/* out: online_backup_lsn, the caller must
own the log_sys mutex */
{
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
#endif /* UNIV_SYNC_DEBUG */
ut_ad(log_sys->online_backup_state);
return(log_sys->online_backup_lsn);
}
/****************************************************************************
Gets the online backup state. */
UNIV_INLINE
ibool
log_get_online_backup_state_low(void)
/*=================================*/
/* out: online backup state, the caller must
own the log_sys mutex */
{
#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
#endif /* UNIV_SYNC_DEBUG */
return(log_sys->online_backup_state);
}

View File

@ -82,7 +82,7 @@ flag value must give the length also! */
predefined minimum record */ predefined minimum record */
#define MLOG_IBUF_BITMAP_INIT ((byte)27) /* initialize an ibuf bitmap #define MLOG_IBUF_BITMAP_INIT ((byte)27) /* initialize an ibuf bitmap
page */ page */
#define MLOG_FULL_PAGE ((byte)28) /* full contents of a page */ /*#define MLOG_FULL_PAGE ((byte)28) full contents of a page */
#define MLOG_INIT_FILE_PAGE ((byte)29) /* this means that a file page #define MLOG_INIT_FILE_PAGE ((byte)29) /* this means that a file page
is taken into use and the prior is taken into use and the prior
contents of the page should be contents of the page should be
@ -236,16 +236,6 @@ mtr_memo_release(
mtr_t* mtr, /* in: mtr */ mtr_t* mtr, /* in: mtr */
void* object, /* in: object */ void* object, /* in: object */
ulint type); /* in: object type: MTR_MEMO_S_LOCK, ... */ ulint type); /* in: object type: MTR_MEMO_S_LOCK, ... */
/****************************************************************
Parses a log record which contains the full contents of a page. */
byte*
mtr_log_parse_full_page(
/*====================*/
/* out: end of log record or NULL */
byte* ptr, /* in: buffer */
byte* end_ptr,/* in: buffer end */
page_t* page); /* in: page or NULL */
/************************************************************** /**************************************************************
Checks if memo contains the given item. */ Checks if memo contains the given item. */
UNIV_INLINE UNIV_INLINE

View File

@ -78,6 +78,10 @@ os_thread_create(
function */ function */
os_thread_id_t* thread_id); /* out: id of the created os_thread_id_t* thread_id); /* out: id of the created
thread */ thread */
int
os_thread_join(
/*=============*/
os_thread_id_t thread_id); /* in: id of the thread to join */
/********************************************************************* /*********************************************************************
Exits the current thread. */ Exits the current thread. */

View File

@ -791,10 +791,6 @@ log_init(void)
/*----------------------------*/ /*----------------------------*/
log_sys->online_backup_state = FALSE;
/*----------------------------*/
log_block_init(log_sys->buf, log_sys->lsn); log_block_init(log_sys->buf, log_sys->lsn);
log_block_set_first_rec_group(log_sys->buf, LOG_BLOCK_HDR_SIZE); log_block_set_first_rec_group(log_sys->buf, LOG_BLOCK_HDR_SIZE);
@ -3003,66 +2999,6 @@ loop:
mutex_exit(&(log_sys->mutex)); mutex_exit(&(log_sys->mutex));
} }
/**********************************************************
Switches the database to the online backup state. */
ulint
log_switch_backup_state_on(void)
/*============================*/
/* out: DB_SUCCESS or DB_ERROR */
{
dulint backup_lsn;
mutex_enter(&(log_sys->mutex));
if (log_sys->online_backup_state) {
/* The database is already in that state */
mutex_exit(&(log_sys->mutex));
return(DB_ERROR);
}
log_sys->online_backup_state = TRUE;
backup_lsn = log_sys->lsn;
log_sys->online_backup_lsn = backup_lsn;
mutex_exit(&(log_sys->mutex));
/* log_checkpoint_and_mark_file_spaces(); */
return(DB_SUCCESS);
}
/**********************************************************
Switches the online backup state off. */
ulint
log_switch_backup_state_off(void)
/*=============================*/
/* out: DB_SUCCESS or DB_ERROR */
{
mutex_enter(&(log_sys->mutex));
if (!log_sys->online_backup_state) {
/* The database is already in that state */
mutex_exit(&(log_sys->mutex));
return(DB_ERROR);
}
log_sys->online_backup_state = FALSE;
mutex_exit(&(log_sys->mutex));
return(DB_SUCCESS);
}
/******************************************************************** /********************************************************************
Makes a checkpoint at the latest lsn and writes it to first page of each Makes a checkpoint at the latest lsn and writes it to first page of each
data file in the database, so that we know that the file spaces contain data file in the database, so that we know that the file spaces contain

View File

@ -808,9 +808,6 @@ recv_parse_or_apply_log_rec_body(
} else if (type == MLOG_IBUF_BITMAP_INIT) { } else if (type == MLOG_IBUF_BITMAP_INIT) {
new_ptr = ibuf_parse_bitmap_init(ptr, end_ptr, page, mtr); new_ptr = ibuf_parse_bitmap_init(ptr, end_ptr, page, mtr);
} else if (type == MLOG_FULL_PAGE) {
new_ptr = mtr_log_parse_full_page(ptr, end_ptr, page);
} else if (type == MLOG_INIT_FILE_PAGE) { } else if (type == MLOG_INIT_FILE_PAGE) {
new_ptr = fsp_parse_init_file_page(ptr, end_ptr, page); new_ptr = fsp_parse_init_file_page(ptr, end_ptr, page);
@ -1127,15 +1124,7 @@ recv_recover_page(
buf = ((byte*)(recv->data)) + sizeof(recv_data_t); buf = ((byte*)(recv->data)) + sizeof(recv_data_t);
} }
if (recv->type == MLOG_INIT_FILE_PAGE if (recv->type == MLOG_INIT_FILE_PAGE) {
|| recv->type == MLOG_FULL_PAGE) {
/* A new file page may have been taken into use,
or we have stored the full contents of the page:
in this case it may be that the original log record
type was MLOG_INIT_FILE_PAGE, and we replaced it
with MLOG_FULL_PAGE, thus we have to apply
any record of type MLOG_FULL_PAGE */
page_lsn = page_newest_lsn; page_lsn = page_newest_lsn;
mach_write_to_8(page + UNIV_PAGE_SIZE mach_write_to_8(page + UNIV_PAGE_SIZE

View File

@ -105,179 +105,6 @@ mtr_memo_pop_all(
} }
} }
/****************************************************************
Writes to the log the contents of a full page. This is called when the
database is in the online backup state. */
static
void
mtr_log_write_full_page(
/*====================*/
page_t* page, /* in: page to write */
ulint i, /* in: i'th page for mtr */
ulint n_pages,/* in: total number of pages for mtr */
mtr_t* mtr) /* in: mtr */
{
byte* buf;
byte* ptr;
ulint len;
buf = mem_alloc(UNIV_PAGE_SIZE + 50);
ptr = mlog_write_initial_log_record_fast(page, MLOG_FULL_PAGE, buf,
mtr);
ut_memcpy(ptr, page, UNIV_PAGE_SIZE);
len = (ptr - buf) + UNIV_PAGE_SIZE;
if (i == n_pages - 1) {
if (n_pages > 1) {
*(buf + len) = MLOG_MULTI_REC_END;
len++;
} else {
*buf = (byte)((ulint)*buf | MLOG_SINGLE_REC_FLAG);
}
}
ut_ad(len < UNIV_PAGE_SIZE + 50);
log_write_low(buf, len);
mem_free(buf);
}
/****************************************************************
Parses a log record which contains the full contents of a page. */
byte*
mtr_log_parse_full_page(
/*====================*/
/* out: end of log record or NULL */
byte* ptr, /* in: buffer */
byte* end_ptr,/* in: buffer end */
page_t* page) /* in: page or NULL */
{
if (end_ptr < ptr + UNIV_PAGE_SIZE) {
return(NULL);
}
if (page) {
ut_memcpy(page, ptr, UNIV_PAGE_SIZE);
}
return(ptr + UNIV_PAGE_SIZE);
}
/****************************************************************
Writes to the database log the full contents of the pages that this mtr has
modified. */
static
void
mtr_log_write_backup_full_pages(
/*============================*/
mtr_t* mtr, /* in: mini-transaction */
ulint n_pages)/* in: number of pages modified by mtr */
{
mtr_memo_slot_t* slot;
dyn_array_t* memo;
buf_block_t* block;
ulint offset;
ulint type;
ulint i;
ut_ad(mtr);
ut_ad(mtr->magic_n == MTR_MAGIC_N);
ut_ad(mtr->state == MTR_COMMITTING);
/* Open the database log for log_write_low */
mtr->start_lsn = log_reserve_and_open(n_pages * (UNIV_PAGE_SIZE + 50));
memo = &(mtr->memo);
offset = dyn_array_get_data_size(memo);
i = 0;
while (offset > 0) {
offset -= sizeof(mtr_memo_slot_t);
slot = dyn_array_get_element(memo, offset);
block = slot->object;
type = slot->type;
if ((block != NULL) && (type == MTR_MEMO_PAGE_X_FIX)) {
mtr_log_write_full_page(block->frame, i, n_pages, mtr);
i++;
}
}
ut_ad(i == n_pages);
}
/****************************************************************
Checks if mtr is the first to modify any page after online_backup_lsn. */
static
ibool
mtr_first_to_modify_page_after_backup(
/*==================================*/
/* out: TRUE if first for a page */
mtr_t* mtr, /* in: mini-transaction */
ulint* n_pages) /* out: number of modified pages (all modified
pages, backup_lsn does not matter here) */
{
mtr_memo_slot_t* slot;
dyn_array_t* memo;
ulint offset;
buf_block_t* block;
ulint type;
dulint backup_lsn;
ibool ret = FALSE;
ut_ad(mtr);
ut_ad(mtr->magic_n == MTR_MAGIC_N);
ut_ad(mtr->state == MTR_COMMITTING);
backup_lsn = log_get_online_backup_lsn_low();
memo = &(mtr->memo);
offset = dyn_array_get_data_size(memo);
*n_pages = 0;
while (offset > 0) {
offset -= sizeof(mtr_memo_slot_t);
slot = dyn_array_get_element(memo, offset);
block = slot->object;
type = slot->type;
if ((block != NULL) && (type == MTR_MEMO_PAGE_X_FIX)) {
*n_pages = *n_pages + 1;
if (ut_dulint_cmp(buf_frame_get_newest_modification(
block->frame),
backup_lsn) <= 0) {
fprintf(stderr,
"Page %lu newest %lu backup %lu\n",
(ulong) block->offset,
(ulong) ut_dulint_get_low(
buf_frame_get_newest_modification(
block->frame)),
(ulong) ut_dulint_get_low(backup_lsn));
ret = TRUE;
}
}
}
return(ret);
}
/**************************************************************** /****************************************************************
Writes the contents of a mini-transaction log, if any, to the database log. */ Writes the contents of a mini-transaction log, if any, to the database log. */
static static
@ -291,7 +118,6 @@ mtr_log_reserve_and_write(
ulint data_size; ulint data_size;
ibool success; ibool success;
byte* first_data; byte* first_data;
ulint n_modified_pages;
ut_ad(mtr); ut_ad(mtr);
@ -322,20 +148,6 @@ mtr_log_reserve_and_write(
if (mtr->log_mode == MTR_LOG_ALL) { if (mtr->log_mode == MTR_LOG_ALL) {
if (log_get_online_backup_state_low()
&& mtr_first_to_modify_page_after_backup(mtr,
&n_modified_pages)) {
/* The database is in the online backup state: write
to the log the full contents of all the pages if this
mtr is the first to modify any page in the buffer pool
after online_backup_lsn */
log_close();
log_release();
mtr_log_write_backup_full_pages(mtr, n_modified_pages);
} else {
block = mlog; block = mlog;
while (block != NULL) { while (block != NULL) {
@ -343,7 +155,6 @@ mtr_log_reserve_and_write(
dyn_block_get_used(block)); dyn_block_get_used(block));
block = dyn_array_get_next_block(mlog, block); block = dyn_array_get_next_block(mlog, block);
} }
}
} else { } else {
ut_ad(mtr->log_mode == MTR_LOG_NONE); ut_ad(mtr->log_mode == MTR_LOG_NONE);
/* Do nothing */ /* Do nothing */

View File

@ -201,6 +201,13 @@ os_thread_exit(
#endif #endif
} }
int
os_thread_join(
/*=============*/
os_thread_id_t thread_id) /* in: id of the thread to join */
{
return pthread_join(thread_id, NULL);
}
/********************************************************************* /*********************************************************************
Returns handle to the current thread. */ Returns handle to the current thread. */

View File

@ -190,8 +190,6 @@ que_thr_end_wait(
ut_ad(mutex_own(&kernel_mutex)); ut_ad(mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */ #endif /* UNIV_SYNC_DEBUG */
ut_ad(thr); ut_ad(thr);
ut_ad(next_thr);
ut_ad(*next_thr == NULL);
ut_ad((thr->state == QUE_THR_LOCK_WAIT) ut_ad((thr->state == QUE_THR_LOCK_WAIT)
|| (thr->state == QUE_THR_PROCEDURE_WAIT) || (thr->state == QUE_THR_PROCEDURE_WAIT)
|| (thr->state == QUE_THR_SIG_REPLY_WAIT)); || (thr->state == QUE_THR_SIG_REPLY_WAIT));

View File

@ -149,7 +149,7 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
mysql_unix_port = env; mysql_unix_port = env;
} }
mysql_debug(NullS); mysql_debug(NullS);
#if defined(SIGPIPE) && !defined(__WIN__) #if defined(SIGPIPE) && !defined(__WIN__) && !defined(__NETWARE__)
(void) signal(SIGPIPE, SIG_IGN); (void) signal(SIGPIPE, SIG_IGN);
#endif #endif
#ifdef EMBEDDED_LIBRARY #ifdef EMBEDDED_LIBRARY
@ -183,6 +183,14 @@ void STDCALL mysql_server_end()
mysql_client_init= org_my_init_done= 0; mysql_client_init= org_my_init_done= 0;
} }
static MYSQL_PARAMETERS mysql_internal_parameters=
{&max_allowed_packet, &net_buffer_length};
MYSQL_PARAMETERS *STDCALL mysql_get_parameters()
{
return &mysql_internal_parameters;
}
my_bool STDCALL mysql_thread_init() my_bool STDCALL mysql_thread_init()
{ {
#ifdef THREAD #ifdef THREAD

View File

@ -16,7 +16,6 @@ EXPORTS
list_add list_add
list_delete list_delete
load_defaults load_defaults
max_allowed_packet
my_end my_end
my_getopt_print_errors my_getopt_print_errors
my_init my_init
@ -24,6 +23,7 @@ EXPORTS
my_memdup my_memdup
my_no_flags_free my_no_flags_free
my_path my_path
mysql_get_parameters
my_print_help my_print_help
my_print_variables my_print_variables
my_realloc my_realloc
@ -81,7 +81,6 @@ EXPORTS
mysql_stmt_param_count mysql_stmt_param_count
mysql_stmt_param_metadata mysql_stmt_param_metadata
mysql_ping mysql_ping
mysql_prepare
mysql_stmt_result_metadata mysql_stmt_result_metadata
mysql_query mysql_query
mysql_read_query_result mysql_read_query_result
@ -114,7 +113,9 @@ EXPORTS
mysql_thread_safe mysql_thread_safe
mysql_use_result mysql_use_result
mysql_warning_count mysql_warning_count
net_buffer_length mysql_stmt_sqlstate
mysql_sqlstate
mysql_get_server_version
set_dynamic set_dynamic
strcend strcend
strcont strcont

View File

@ -18,7 +18,7 @@
target = libmysqlclient_r.la target = libmysqlclient_r.la
target_defs = -DDONT_USE_RAID @LIB_EXTRA_CCFLAGS@ target_defs = -DDONT_USE_RAID -DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@
LIBS = @LIBS@ @openssl_libs@ LIBS = @LIBS@ @openssl_libs@
INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include $(openssl_includes) INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include $(openssl_includes)

View File

@ -23,6 +23,11 @@
#define mysql_unix_port mysql_inix_port1 #define mysql_unix_port mysql_inix_port1
#define mysql_port mysql_port1 #define mysql_port mysql_port1
extern "C"
{
extern unsigned long max_allowed_packet, net_buffer_length;
}
static int fake_argc= 1; static int fake_argc= 1;
static char *fake_argv[]= {(char *)"", 0}; static char *fake_argv[]= {(char *)"", 0};
static const char *fake_groups[] = { "server", "embedded", 0 }; static const char *fake_groups[] = { "server", "embedded", 0 };

View File

@ -47,6 +47,9 @@
#define INADDR_NONE -1 #define INADDR_NONE -1
#endif #endif
extern ulong net_buffer_length;
extern ulong max_allowed_packet;
#if defined(MSDOS) || defined(__WIN__) #if defined(MSDOS) || defined(__WIN__)
#define ERRNO WSAGetLastError() #define ERRNO WSAGetLastError()
#define perror(A) #define perror(A)
@ -81,7 +84,8 @@ static void end_server(MYSQL *mysql)
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
static inline int mysql_init_charset(MYSQL *mysql)
static int mysql_init_charset(MYSQL *mysql)
{ {
char charset_name_buff[16], *charset_name; char charset_name_buff[16], *charset_name;
@ -124,6 +128,7 @@ static inline int mysql_init_charset(MYSQL *mysql)
return 0; return 0;
} }
MYSQL * STDCALL MYSQL * STDCALL
mysql_real_connect(MYSQL *mysql,const char *host, const char *user, mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
const char *passwd, const char *db, const char *passwd, const char *db,

View File

@ -92,7 +92,6 @@ EXPORTS
mysql_thread_safe mysql_thread_safe
mysql_use_result mysql_use_result
mysql_warning_count mysql_warning_count
net_buffer_length
set_dynamic set_dynamic
strcend strcend
strcont strcont
@ -128,5 +127,5 @@ EXPORTS
alloc_root alloc_root
free_root free_root
my_read my_read
max_allowed_packet
llstr llstr
mysql_get_parameters

View File

@ -363,7 +363,7 @@ static void usage(void)
directly with '--variable-name=value'.\n\ directly with '--variable-name=value'.\n\
-t, --tmpdir=path Path for temporary files. Multiple paths can be\n\ -t, --tmpdir=path Path for temporary files. Multiple paths can be\n\
specified, separated by " specified, separated by "
#if defined( __WIN__) || defined(OS2) #if defined( __WIN__) || defined(OS2) || defined(__NETWARE__)
"semicolon (;)" "semicolon (;)"
#else #else
"colon (:)" "colon (:)"
@ -1685,9 +1685,19 @@ err:
DBUG_RETURN(1); DBUG_RETURN(1);
} /* sort_record_index */ } /* sort_record_index */
volatile bool *killed_ptr(MI_CHECK *param)
/*
Check if myisamchk was killed by a signal
This is overloaded by other programs that want to be able to abort
sorting
*/
static my_bool not_killed= 0;
volatile my_bool *killed_ptr(MI_CHECK *param)
{ {
return (bool *)(& param->thd); /* always NULL */ return &not_killed; /* always NULL */
} }
/* print warnings and errors */ /* print warnings and errors */

View File

@ -711,7 +711,7 @@ int mi_open_keyfile(MYISAM_SHARE *share);
void mi_setup_functions(register MYISAM_SHARE *share); void mi_setup_functions(register MYISAM_SHARE *share);
/* Functions needed by mi_check */ /* Functions needed by mi_check */
volatile bool *killed_ptr(MI_CHECK *param); volatile my_bool *killed_ptr(MI_CHECK *param);
void mi_check_print_error _VARARGS((MI_CHECK *param, const char *fmt,...)); void mi_check_print_error _VARARGS((MI_CHECK *param, const char *fmt,...));
void mi_check_print_warning _VARARGS((MI_CHECK *param, const char *fmt,...)); void mi_check_print_warning _VARARGS((MI_CHECK *param, const char *fmt,...));
void mi_check_print_info _VARARGS((MI_CHECK *param, const char *fmt,...)); void mi_check_print_info _VARARGS((MI_CHECK *param, const char *fmt,...));

View File

@ -1,3 +1,4 @@
-- source include/have_ndb.inc
--disable_warnings --disable_warnings
drop table if exists t1, t2; drop table if exists t1, t2;

View File

@ -1 +1 @@
-O relay_log_space_limit=10 --relay_log_space_limit=10

View File

@ -98,25 +98,23 @@ void *my_pthread_getspecific_imp(pthread_key_t key)
#undef pthread_exit #undef pthread_exit
void my_pthread_exit(void *status) void my_pthread_exit(void *status)
{ {
NXThreadId_t tid = NXThreadGetId(); NXThreadId_t tid;
NXContext_t ctx; NXContext_t ctx;
char name[PATH_MAX] = ""; char name[NX_MAX_OBJECT_NAME_LEN+1] = "";
/* Do not call pthread_exit if it is not a LibC thread */ tid= NXThreadGetId();
if (tid != 0) if (tid == NX_INVALID_THREAD_ID || !tid)
{ return;
NXThreadGetContext(tid, &ctx); if (NXThreadGetContext(tid, &ctx) ||
NXContextGetName(ctx, name, PATH_MAX); NXContextGetName(ctx, name, sizeof(name)-1))
return;
/* /*
"MYSQLD.NLM's LibC Reaper" or "MYSQLD.NLM's main thread" "MYSQLD.NLM's LibC Reaper" or "MYSQLD.NLM's main thread"
with a debug build of LibC the reaper can have different names with a debug build of LibC the reaper can have different names
*/ */
if (!strindex(name, "\'s")) if (!strindex(name, "\'s"))
{
pthread_exit(status); pthread_exit(status);
}
}
} }
#endif #endif

View File

@ -19,6 +19,7 @@
a shared library a shared library
*/ */
C_MODE_START
#include <signal.h> #include <signal.h>
#define MAX_SIGNALS 10 /* Max signals under a dont-allow */ #define MAX_SIGNALS 10 /* Max signals under a dont-allow */
@ -73,3 +74,4 @@ extern struct st_my_file_info my_file_info_default[MY_NFILE];
#if defined(THREAD) && !defined(__WIN__) #if defined(THREAD) && !defined(__WIN__)
extern sigset_t my_signals; /* signals blocked by mf_brkhant */ extern sigset_t my_signals; /* signals blocked by mf_brkhant */
#endif #endif
C_MODE_END

View File

@ -43,6 +43,8 @@ make clean config.h
(cd extra; make comp_err) (cd extra; make comp_err)
(cd libmysql; make conf_to_src) (cd libmysql; make conf_to_src)
(cd libmysql_r; make conf_to_src) (cd libmysql_r; make conf_to_src)
# so the file will be linked
(cd sql; make sql_yacc.cc)
(cd sql; make gen_lex_hash) (cd sql; make gen_lex_hash)
(cd strings; make conf_to_src) (cd strings; make conf_to_src)

View File

@ -6,8 +6,8 @@
# the default is "F:/mydev" # the default is "F:/mydev"
export MYDEV="WINE_BUILD_DIR" export MYDEV="WINE_BUILD_DIR"
export MWCNWx86Includes="$MYDEV/libc/include;$MYDEV/fs64/headers;$MYDEV;$MYDEV/zlib-1.1.4" export MWCNWx86Includes="$MYDEV/libc/include;$MYDEV/fs64/headers;$MYDEV/zlib-1.1.4;$MYDEV"
export MWNWx86Libraries="$MYDEV/libc/imports;$MYDEV/mw/lib;$MYDEV/fs64/imports;$MYDEV/zlib-1.1.4;$MYDEV/mysql-VERSION/netware/BUILD" export MWNWx86Libraries="$MYDEV/libc/imports;$MYDEV/mw/lib;$MYDEV/fs64/imports;$MYDEV/zlib-1.1.4;$MYDEV/openssl;$MYDEV/mysql-VERSION/netware/BUILD"
export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib;libz.a;neb.imp;zPublics.imp;knetware.imp" export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib;libz.a;neb.imp;zPublics.imp;knetware.imp"
export WINEPATH="$MYDEV/mw/bin" export WINEPATH="$MYDEV/mw/bin"
@ -19,11 +19,10 @@ export AR='mwldnlm'
export AR_FLAGS='-type library -o' export AR_FLAGS='-type library -o'
export AS='mwasmnlm' export AS='mwasmnlm'
export CC='mwccnlm -gccincludes' export CC='mwccnlm -gccincludes'
export CFLAGS='-align 8 -proc 686 -relax_pointers -dialect c' export CFLAGS='-O3 -align 8 -proc 686 -relax_pointers -dialect c'
export CXX='mwccnlm -gccincludes' export CXX='mwccnlm -gccincludes'
export CXXFLAGS='-align 8 -proc 686 -relax_pointers -dialect c++ -bool on -wchar_t on -D_WCHAR_T' export CXXFLAGS='-O3 -align 8 -proc 686 -relax_pointers -dialect c++ -bool on -wchar_t on -D_WCHAR_T'
export LD='mwldnlm' export LD='mwldnlm'
export LDFLAGS='-entry _LibCPrelude -exit _LibCPostlude -map -flags pseudopreemption' export LDFLAGS='-entry _LibCPrelude -exit _LibCPostlude -map -flags pseudopreemption'
export RANLIB=: export RANLIB=:
export STRIP=: export STRIP=:

View File

@ -171,6 +171,11 @@ do
rm $file.org rm $file.org
done done
# create the libmysql.imp file in netware folder from libmysql/libmysql.def
# file
echo "generating llibmysql.imp file..."
awk 'BEGIN{x=0;} x==1 {print $1;next} /EXPORTS/{x=1}' libmysql/libmysql.def > netware/libmysql.imp
# build linux tools # build linux tools
echo "compiling linux tools..." echo "compiling linux tools..."
./netware/BUILD/compile-linux-tools ./netware/BUILD/compile-linux-tools
@ -183,5 +188,3 @@ then
fi fi
echo "done" echo "done"

View File

@ -14,6 +14,7 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
if HAVE_NETWARE
INCLUDES = -I$(srcdir)/../include -I../include -I.. INCLUDES = -I$(srcdir)/../include -I../include -I..
bin_PROGRAMS = mysqld_safe mysql_install_db mysql_test_run libmysql bin_PROGRAMS = mysqld_safe mysql_install_db mysql_test_run libmysql
mysqld_safe_SOURCES= mysqld_safe.c my_manage.c mysqld_safe_SOURCES= mysqld_safe.c my_manage.c
@ -43,7 +44,31 @@ link_sources:
org=`echo $$f | sed -e 's/.*\/\(.*\)/\1/g'`; \ org=`echo $$f | sed -e 's/.*\/\(.*\)/\1/g'`; \
@LN_CP_F@ $(srcdir)/$$org $(srcdir)/../$$f; \ @LN_CP_F@ $(srcdir)/$$org $(srcdir)/../$$f; \
done; done;
else
EXTRA_DIST= comp_err.def init_db.sql install_test_db.ncf \
isamchk.def isamlog.def libmysql.def libmysql.imp \
libmysqlmain.c my_manage.c my_manage.h \
my_print_defaults.def myisam_ftdump.def myisamchk.def \
myisamlog.def myisampack.def mysql.def mysql.xdc \
mysql_fix_privilege_tables.pl mysql_install.def \
mysql_install_db.c mysql_install_db.def \
mysql_secure_installation.pl mysql_test_run.c \
mysql_test_run.def mysql_waitpid.def mysqladmin.def \
mysqlbinlog.def mysqlcheck.def mysqld.def \
mysqld_safe.c mysqld_safe.def mysqldump.def mysqlimport.def \
mysqlshow.def mysqltest.def pack_isam.def perror.def \
replace.def resolve_stack_dump.def resolveip.def test_db.sql \
static_init_db.sql \
BUILD/apply-patch BUILD/compile-AUTOTOOLS \
BUILD/compile-linux-tools BUILD/compile-netware-END \
BUILD/compile-netware-START BUILD/compile-netware-all\
BUILD/compile-netware-debug BUILD/compile-netware-max \
BUILD/compile-netware-max-debug BUILD/compile-netware-src \
BUILD/compile-netware-standard BUILD/create-patch \
BUILD/cron-build BUILD/crontab BUILD/knetware.imp \
BUILD/mwasmnlm BUILD/mwccnlm BUILD/mwenv BUILD/mwldnlm \
BUILD/nwbootstrap BUILD/openssl.imp BUILD/save-patch
endif
# Don't update the files from bitkeeper # Don't update the files from bitkeeper
%::SCCS/s.% %::SCCS/s.%

View File

@ -200,11 +200,11 @@ int wait_for_server_start(char *bin_dir, char *user, char *password, int port,ch
add_arg(&al, "--password=%s", password); add_arg(&al, "--password=%s", password);
add_arg(&al, "--silent"); add_arg(&al, "--silent");
/** Not supported on NetWare #ifdef NOT_USED
add_arg(&al, "-O"); add_arg(&al, "-O");
add_arg(&al, "connect_timeout=10"); add_arg(&al, "connect_timeout=10");
add_arg(&al, "-w"); add_arg(&al, "-w");
**/ #endif
add_arg(&al, "--host=localhost"); add_arg(&al, "--host=localhost");
add_arg(&al, "ping"); add_arg(&al, "ping");
@ -475,4 +475,3 @@ void get_basedir(char *argv0, char *basedir)
strcpy(basedir, temp); strcpy(basedir, temp);
} }
} }

View File

@ -37,7 +37,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
use strict; #use strict;
use Mysql; use Mysql;
print "MySQL Fix Privilege Tables Script\n\n"; print "MySQL Fix Privilege Tables Script\n\n";
@ -69,6 +69,21 @@ print "OK, successfully used the password, moving on...\n\n";
# MySQL 4.0.2 # MySQL 4.0.2
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
#-- Detect whether or not we had the Grant_priv column
print "Fixing privileges for old tables...\n";
$conn->query("SET \@hadGrantPriv:=0;");
$conn->query("SELECT \@hadGrantPriv:=1 FROM user WHERE Grant_priv LIKE '%';");
#--- Fix privileges for old tables
$conn->query("UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE \@hadGrantPriv = 0;");
$conn->query("UPDATE db SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE \@hadGrantPriv = 0;");
$conn->query("UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE \@hadGrantPriv = 0;");
# Detect whether we had Show_db_priv
$conn->query("SET \@hadShowDbPriv:=0;");
$conn->query("SELECT \@hadShowDbPriv:=1 FROM user WHERE Show_db_priv LIKE '%';");
print "Adding new fields used by MySQL 4.0.2 to the privilege tables...\n"; print "Adding new fields used by MySQL 4.0.2 to the privilege tables...\n";
print "NOTE: You can ignore any Duplicate column errors.\n"; print "NOTE: You can ignore any Duplicate column errors.\n";
$conn->query(" \ $conn->query(" \
@ -81,9 +96,11 @@ ADD Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv, \
ADD Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Execute_priv, \ ADD Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Execute_priv, \
ADD Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; \ ADD Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; \
") && $conn->query(" \ ") && $conn->query(" \
UPDATE user SET show_db_priv=select_priv, super_priv=process_priv, execute_priv=process_priv, create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=file_priv where user<>''; \ UPDATE user SET show_db_priv=select_priv, super_priv=process_priv, execute_priv=process_priv, create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=file_priv where user<>''AND \@hadShowDbPriv = 0; \
"); ");
#-- The above statement converts privileges so that users have similar privileges as before
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# MySQL 4.0 Limitations # MySQL 4.0 Limitations
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@ -97,6 +114,22 @@ ADD max_updates int(11) unsigned NOT NULL AFTER max_questions, \
ADD max_connections int(11) unsigned NOT NULL AFTER max_updates; \ ADD max_connections int(11) unsigned NOT NULL AFTER max_updates; \
"); ");
#-- Change the password column to suite the new password hashing used
#-- in 4.1.1 onward
$conn->query("ALTER TABLE user change Password Password char(41) binary not null;");
#-- The second alter changes ssl_type to new 4.0.2 format
#-- Adding columns needed by GRANT .. REQUIRE (openssl)"
print "Adding new fields to use in ssl authentication...\n";
$conn->query(" \
ALTER TABLE user \
ADD ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL, \
ADD ssl_cipher BLOB NOT NULL, \
ADD x509_issuer BLOB NOT NULL, \
ADD x509_subject BLOB NOT NULL; \
");
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# MySQL 4.0 DB and Host privs # MySQL 4.0 DB and Host privs
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@ -115,6 +148,77 @@ ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, \
ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; \ ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; \
"); ");
#
# Change the Table_name column to be of char(64) which was char(60) by mistake till now.
#
$conn->query("alter table tables_priv change Table_name Table_name char(64) binary DEFAULT '' NOT NULL;");
#
# Create some possible missing tables
#
print "Adding online help tables...\n";
$conn->query(" \
CREATE TABLE IF NOT EXISTS help_topic ( \
help_topic_id int unsigned not null, \
name varchar(64) not null, \
help_category_id smallint unsigned not null, \
description text not null, \
example text not null, \
url varchar(128) not null, \
primary key (help_topic_id), unique index (name) \
) comment='help topics'; \
");
$conn->query(" \
CREATE TABLE IF NOT EXISTS help_category ( \
help_category_id smallint unsigned not null, \
name varchar(64) not null, \
parent_category_id smallint unsigned null, \
url varchar(128) not null, \
primary key (help_category_id), \
unique index (name) \
) comment='help categories'; \
");
$conn->query(" \
CREATE TABLE IF NOT EXISTS help_relation ( \
help_topic_id int unsigned not null references help_topic, \
help_keyword_id int unsigned not null references help_keyword, \
primary key (help_keyword_id, help_topic_id) \
) comment='keyword-topic relation'; \
");
$conn->query(" \
CREATE TABLE IF NOT EXISTS help_keyword ( \
help_keyword_id int unsigned not null, \
name varchar(64) not null, \
primary key (help_keyword_id), \
unique index (name) \
) comment='help keywords'; \
");
#
# Filling the help tables with contents.
#
print "Filling online help tables with contents...\n";
# Generate the path for "fill_help_tables.sql" file which is in different folder.
$fill_help_table=$0;
$fill_help_table =~ s/scripts[\\\/]mysql_fix_privilege_tables.pl/support-files\\fill_help_tables.sql/;
#read all content from the sql file which contains recordsfor help tables.
open(fileIN,$fill_help_table) or die("Cannot open $fill_help_table: $!");
@logData = <fileIN>;
close(fileIN);
foreach $line (@logData) {
# if the line is not empty, insert a record in the table.
if( ! ($line =~ /^\s*$/) ) {
$conn->query("$line");
}
}
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# done # done
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@ -122,4 +226,3 @@ ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; \
print "\n\nAll done!\n\n"; print "\n\nAll done!\n\n";
print "Thanks for using MySQL!\n\n"; print "Thanks for using MySQL!\n\n";

View File

@ -153,6 +153,7 @@ void log_info(char *, ...);
void log_error(char *, ...); void log_error(char *, ...);
void log_errno(char *, ...); void log_errno(char *, ...);
void die(char *); void die(char *);
char *str_tok(char *string, const char *delim);
/****************************************************************************** /******************************************************************************
@ -244,6 +245,7 @@ void mysql_install_db()
mkdir(temp, S_IRWXU); mkdir(temp, S_IRWXU);
// create subdirectories // create subdirectories
log("Creating test-suite folders...\n");
snprintf(temp, PATH_MAX, "%s/var/run", mysql_test_dir); snprintf(temp, PATH_MAX, "%s/var/run", mysql_test_dir);
mkdir(temp, S_IRWXU); mkdir(temp, S_IRWXU);
snprintf(temp, PATH_MAX, "%s/var/tmp", mysql_test_dir); snprintf(temp, PATH_MAX, "%s/var/tmp", mysql_test_dir);
@ -262,7 +264,9 @@ void mysql_install_db()
mkdir(temp, S_IRWXU); mkdir(temp, S_IRWXU);
// install databases // install databases
log("Creating test databases for master... \n");
install_db(master_dir); install_db(master_dir);
log("Creating test databases for slave... \n");
install_db(slave_dir); install_db(slave_dir);
} }
@ -346,6 +350,9 @@ void start_master()
add_arg(&al, "--character-sets-dir=%s", char_dir); add_arg(&al, "--character-sets-dir=%s", char_dir);
add_arg(&al, "--tmpdir=%s", mysql_tmp_dir); add_arg(&al, "--tmpdir=%s", mysql_tmp_dir);
add_arg(&al, "--language=%s", lang_dir); add_arg(&al, "--language=%s", lang_dir);
#ifdef DEBUG //only for debug builds
add_arg(&al, "--debug");
#endif
if (use_openssl) if (use_openssl)
{ {
@ -370,33 +377,28 @@ void start_master()
if (master_opt[0] != NULL) if (master_opt[0] != NULL)
{ {
char *p; char *p;
char *temp;
p = (char *)strtok(master_opt, " \t"); p = (char *)str_tok(master_opt, " \t");
if (!strstr(master_opt, "timezone"))
if ((temp = strstr(p, "timezone")) == NULL)
{ {
while(p) while (p)
{ {
add_arg(&al, "%s", p); add_arg(&al, "%s", p);
p = (char *)strtok(NULL, " \t"); p = (char *)str_tok(NULL, " \t");
} }
} }
else
{
//do nothing
}
} }
// remove the pid file if it exists // remove the pid file if it exists
remove(master_pid); remove(master_pid);
// spawn // spawn
if ((err = spawn(mysqld_file, &al, FALSE, NULL, master_out, master_err)) == 0) if ((err= spawn(mysqld_file, &al, FALSE, NULL, master_out, master_err)) == 0)
{ {
sleep_until_file_exists(master_pid); sleep_until_file_exists(master_pid);
if ((err = wait_for_server_start(bin_dir, user, password, master_port,mysql_tmp_dir)) == 0) if ((err = wait_for_server_start(bin_dir, user, password, master_port,
mysql_tmp_dir)) == 0)
{ {
master_running = TRUE; master_running = TRUE;
} }
@ -467,11 +469,11 @@ void start_slave()
snprintf(temp, PATH_MAX, "%s/master.info", slave_dir); snprintf(temp, PATH_MAX, "%s/master.info", slave_dir);
fp = fopen(temp, "wb+"); fp = fopen(temp, "wb+");
fputs("master-bin.001\n", fp); fputs("master-bin.000001\n", fp);
fputs("4\n", fp); fputs("4\n", fp);
fputs("127.0.0.1\n", fp); fputs("127.0.0.1\n", fp);
fputs("replicate\n", fp); fputs("replicate\n", fp);
fputs("aaaaaaaaaaaaaaabthispartofthepasswordisnotused\n", fp); fputs("aaaaaaaaaaaaaaab\n", fp);
fputs("9306\n", fp); fputs("9306\n", fp);
fputs("1\n", fp); fputs("1\n", fp);
fputs("0\n", fp); fputs("0\n", fp);
@ -521,6 +523,9 @@ void start_slave()
add_arg(&al, "--master-retry-count=10"); add_arg(&al, "--master-retry-count=10");
add_arg(&al, "-O"); add_arg(&al, "-O");
add_arg(&al, "slave_net_timeout=10"); add_arg(&al, "slave_net_timeout=10");
#ifdef DEBUG //only for debug builds
add_arg(&al, "--debug");
#endif
if (use_openssl) if (use_openssl)
{ {
@ -534,13 +539,13 @@ void start_slave()
{ {
char *p; char *p;
p = (char *)strtok(slave_master_info, " \t"); p = (char *)str_tok(slave_master_info, " \t");
while(p) while(p)
{ {
add_arg(&al, "%s", p); add_arg(&al, "%s", p);
p = (char *)strtok(NULL, " \t"); p = (char *)str_tok(NULL, " \t");
} }
} }
else else
@ -567,13 +572,13 @@ void start_slave()
{ {
char *p; char *p;
p = (char *)strtok(slave_opt, " \t"); p = (char *)str_tok(slave_opt, " \t");
while(p) while(p)
{ {
add_arg(&al, "%s", p); add_arg(&al, "%s", p);
p = (char *)strtok(NULL, " \t"); p = (char *)str_tok(NULL, " \t");
} }
} }
@ -585,7 +590,8 @@ void start_slave()
{ {
sleep_until_file_exists(slave_pid); sleep_until_file_exists(slave_pid);
if ((err = wait_for_server_start(bin_dir, user, password, slave_port,mysql_tmp_dir)) == 0) if ((err = wait_for_server_start(bin_dir, user, password, slave_port,
mysql_tmp_dir)) == 0)
{ {
slave_running = TRUE; slave_running = TRUE;
} }
@ -636,7 +642,8 @@ void stop_slave()
if (!slave_running) return; if (!slave_running) return;
// stop // stop
if ((err = stop_server(bin_dir, user, password, slave_port, slave_pid,mysql_tmp_dir)) == 0) if ((err = stop_server(bin_dir, user, password, slave_port, slave_pid,
mysql_tmp_dir)) == 0)
{ {
slave_running = FALSE; slave_running = FALSE;
} }
@ -660,7 +667,8 @@ void stop_master()
// running? // running?
if (!master_running) return; if (!master_running) return;
if ((err = stop_server(bin_dir, user, password, master_port, master_pid,mysql_tmp_dir)) == 0) if ((err = stop_server(bin_dir, user, password, master_port, master_pid,
mysql_tmp_dir)) == 0)
{ {
master_running = FALSE; master_running = FALSE;
} }
@ -697,6 +705,7 @@ void mysql_stop()
******************************************************************************/ ******************************************************************************/
void mysql_restart() void mysql_restart()
{ {
log_info("Restarting the MySQL server(s): %u", ++restarts);
mysql_stop(); mysql_stop();
@ -758,6 +767,12 @@ int read_option(char *opt_file, char *opt)
strcat(opt, temp); strcat(opt, temp);
} }
// Check for double backslash and replace it with single bakslash
if ((p = strstr(opt, "\\\\")) != NULL)
{
/* bmove is guranteed to work byte by byte */
bmove(p, p+1, strlen(p+1));
}
} }
else else
{ {
@ -786,17 +801,13 @@ void run_test(char *test)
int flag = FALSE; int flag = FALSE;
struct stat info; struct stat info;
// single test?
// if (!single_test)
{
// skip tests in the skip list // skip tests in the skip list
snprintf(temp, PATH_MAX, " %s ", test); snprintf(temp, PATH_MAX, " %s ", test);
skip = (strindex(skip_test, temp) != NULL); skip = (strindex(skip_test, temp) != NULL);
if( skip == FALSE ) if (skip == FALSE)
ignore = (strindex(ignore_test, temp) != NULL); ignore = (strindex(ignore_test, temp) != NULL);
}
if(ignore) if (ignore)
{ {
// show test // show test
log("%-46s ", test); log("%-46s ", test);
@ -837,7 +848,7 @@ void run_test(char *test)
if (stat(test_file, &info)) if (stat(test_file, &info))
{ {
snprintf(test_file, PATH_MAX, "%s/%s%s", test_dir, test, TEST_SUFFIX); snprintf(test_file, PATH_MAX, "%s/%s%s", test_dir, test, TEST_SUFFIX);
if(access(test_file,0)) if (access(test_file,0))
{ {
printf("Invalid test name %s, %s file not found\n",test,test_file); printf("Invalid test name %s, %s file not found\n",test,test_file);
return; return;
@ -1087,8 +1098,7 @@ void die(char *msg)
void setup(char *file) void setup(char *file)
{ {
char temp[PATH_MAX]; char temp[PATH_MAX];
char mysqldump_load[PATH_MAX*2],mysqlbinlog_load[PATH_MAX*2]; char file_path[PATH_MAX*2];
char *p; char *p;
// set the timezone for the timestamp test // set the timezone for the timestamp test
@ -1145,13 +1155,15 @@ void setup(char *file)
strcpy(temp, strlwr(skip_test)); strcpy(temp, strlwr(skip_test));
snprintf(skip_test, PATH_MAX, " %s ", temp); snprintf(skip_test, PATH_MAX, " %s ", temp);
snprintf(mysqlbinlog_load,PATH_MAX*2,"%s/mysqlbinlog --no-defaults --local-load=%s",bin_dir,mysql_tmp_dir);
snprintf(mysqldump_load,PATH_MAX*2,"%s/mysqldump --no-defaults -uroot --port=%d",bin_dir,master_port);
// environment // environment
setenv("MYSQL_TEST_DIR", mysql_test_dir, 1); setenv("MYSQL_TEST_DIR", mysql_test_dir, 1);
setenv("MYSQL_DUMP", mysqldump_load, 1); snprintf(file_path, PATH_MAX*2, "%s/mysqldump --no-defaults -u root --port=%u", bin_dir, master_port);
setenv("MYSQL_BINLOG", mysqlbinlog_load, 1); setenv("MYSQL_DUMP", file_path, 1);
snprintf(file_path, PATH_MAX*2, "%s/mysqlbinlog --no-defaults --local-load=%s", bin_dir, mysql_tmp_dir);
setenv("MYSQL_BINLOG", file_path, 1);
setenv("MASTER_MYPORT", "9306", 1); setenv("MASTER_MYPORT", "9306", 1);
} }
/****************************************************************************** /******************************************************************************
@ -1165,20 +1177,22 @@ int main(int argc, char **argv)
// setup // setup
setup(argv[0]); setup(argv[0]);
/* The --ignore option is comma saperated list of test cases to skip and should /* The --ignore option is comma saperated list of test cases to skip and
* be very first command line option to the test suite. should be very first command line option to the test suite.
* The usage is now:
* mysql_test_run --ignore=test1,test2 test3 test4 The usage is now:
* where test1 and test2 are test cases to ignore mysql_test_run --ignore=test1,test2 test3 test4
* and test3 and test4 are test cases to run. */ where test1 and test2 are test cases to ignore
if( argc >= 2 && !strnicmp(argv[1], "--ignore=", sizeof("--ignore=")-1) ) and test3 and test4 are test cases to run.
*/
if (argc >= 2 && !strnicmp(argv[1], "--ignore=", sizeof("--ignore=")-1))
{ {
char *temp, *token; char *temp, *token;
temp=strdup(strchr(argv[1],'=') + 1); temp= strdup(strchr(argv[1],'=') + 1);
for(token=strtok(temp, ","); token != NULL; token=strtok(NULL, ",")) for (token=str_tok(temp, ","); token != NULL; token=str_tok(NULL, ","))
{ {
if( strlen(ignore_test) + strlen(token) + 2 <= PATH_MAX-1 ) if (strlen(ignore_test) + strlen(token) + 2 <= PATH_MAX-1)
sprintf( ignore_test+strlen(ignore_test), " %s ", token); sprintf(ignore_test+strlen(ignore_test), " %s ", token);
else else
{ {
free(temp); free(temp);
@ -1272,3 +1286,114 @@ int main(int argc, char **argv)
return 0; return 0;
} }
/*
Synopsis:
This function breaks the string into a sequence of tokens. The difference
between this function and strtok is that it respects the quoted string i.e.
it skips any delimiter character within the quoted part of the string.
It return tokens by eliminating quote character. It modifies the input string
passed. It will work with whitespace delimeter but may not work properly with
other delimeter. If the delimeter will contain any quote character, then
function will not tokenize and will return null string.
e.g. if input string is
--init-slave="set global max_connections=500" --skip-external-locking
then the output will two string i.e.
--init-slave=set global max_connections=500
--skip-external-locking
Arguments:
string: input string
delim: set of delimiter character
Output:
return the null terminated token of NULL.
*/
char *str_tok(char *string, const char *delim)
{
char *token; /* current token received from strtok */
char *qt_token; /* token delimeted by the matching pair of quote */
/*
if there are any quote chars found in the token then this variable
will hold the concatenated string to return to the caller
*/
char *ptr_token=NULL;
/* pointer to the quote character in the token from strtok */
char *ptr_quote=NULL;
/* See if the delimeter contains any quote character */
if (strchr(delim,'\'') || strchr(delim,'\"'))
return NULL;
/* repeate till we are getting some token from strtok */
while ((token = (char*)strtok(string, delim) ) != NULL)
{
/*
make the input string NULL so that next time onward strtok can
be called with NULL input string.
*/
string = NULL;
/* check if the current token contain double quote character*/
if ((ptr_quote = (char*)strchr(token,'\"')) != NULL)
{
/*
get the matching the matching double quote in the remaining
input string
*/
qt_token = (char*)strtok(NULL,"\"");
}
/* check if the current token contain single quote character*/
else if ((ptr_quote = (char*)strchr(token,'\'')) != NULL)
{
/*
get the matching the matching single quote in the remaining
input string
*/
qt_token = (char*)strtok(NULL,"\'");
}
/*
if the current token does not contains any quote character then
return to the caller.
*/
if (ptr_quote == NULL)
{
/*
if there is any earlier token i.e. ptr_token then append the
current token in it and return it else return the current
token directly
*/
return ptr_token ? strcat(ptr_token,token) : token;
}
/*
remove the quote character i.e. make NULL so that the token will
be devided in two part and later both part can be concatenated
and hence quote will be removed
*/
*ptr_quote= 0;
/* check if ptr_token has been initialized or not */
if (ptr_token == NULL)
{
/* initialize the ptr_token with current token */
ptr_token= token;
/* copy entire string between matching pair of quote*/
sprintf(ptr_token+strlen(ptr_token),"%s %s", ptr_quote+1, qt_token);
}
else
{
/*
copy the current token and entire string between matching pair
of quote
*/
sprintf(ptr_token+strlen(ptr_token),"%s%s %s", token, ptr_quote+1,
qt_token );
}
}
/* return the concatenated token */
return ptr_token;
}

View File

@ -10,7 +10,7 @@ INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y',
CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) comment='Host privileges; Merged with database privileges'; CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) comment='Host privileges; Merged with database privileges';
CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(45) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) comment='Users and global privileges'; CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) comment='Users and global privileges';
INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
INSERT INTO user VALUES ('','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user VALUES ('','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);
@ -20,7 +20,7 @@ INSERT INTO user (host,user) values ('','');
CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) comment='User defined functions'; CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) comment='User defined functions';
CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(60) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) comment='Table privileges'; CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) comment='Table privileges';
CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) comment='Column privileges'; CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) comment='Column privileges';

View File

@ -197,14 +197,6 @@ fi
$CP support-files/* $BASE/support-files $CP support-files/* $BASE/support-files
$CP scripts/*.sql $BASE/share $CP scripts/*.sql $BASE/share
if [ $BASE_SYSTEM = "netware" ] ; then
rm -f $BASE/support-files/magic \
$BASE/support-files/mysql.server \
$BASE/support-files/mysql*.spec \
$BASE/support-files/mysql-log-rotate \
$BASE/support-files/binary-configure
fi
$CP -r sql/share/* $MYSQL_SHARE $CP -r sql/share/* $MYSQL_SHARE
rm -f $MYSQL_SHARE/Makefile* $MYSQL_SHARE/*/*.OLD rm -f $MYSQL_SHARE/Makefile* $MYSQL_SHARE/*/*.OLD
@ -240,11 +232,25 @@ fi
rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh
#
# Copy system dependent files
#
if [ $BASE_SYSTEM = "netware" ] ; then
cp ./netware/static_init_db.sql ./netware/init_db.sql
./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql
fi
# #
# Remove system dependent files # Remove system dependent files
# #
if [ $BASE_SYSTEM = "netware" ] ; then if [ $BASE_SYSTEM = "netware" ] ; then
rm -f $BASE/MySQLEULA.txt rm -f $BASE/support-files/magic \
$BASE/support-files/mysql.server \
$BASE/support-files/mysql*.spec \
$BASE/support-files/mysql-log-rotate \
$BASE/support-files/binary-configure \
$BASE/INSTALL-BINARY \
$BASE/MySQLEULA.txt
else else
rm -f $BASE/README.NW rm -f $BASE/README.NW
fi fi
@ -347,9 +353,6 @@ if [ $BASE_SYSTEM != "netware" ] ; then
echo "Compressing archive" echo "Compressing archive"
rm -f $NEW_NAME.tar.gz rm -f $NEW_NAME.tar.gz
gzip -9 $NEW_NAME.tar gzip -9 $NEW_NAME.tar
echo "Removing temporary directory"
rm -r -f $BASE
echo "$NEW_NAME.tar.gz created" echo "$NEW_NAME.tar.gz created"
else else
@ -360,9 +363,8 @@ else
cd $TMP cd $TMP
if test -e "$SOURCE/$NEW_NAME.zip"; then rm $SOURCE/$NEW_NAME.zip; fi if test -e "$SOURCE/$NEW_NAME.zip"; then rm $SOURCE/$NEW_NAME.zip; fi
zip -r $SOURCE/$NEW_NAME.zip $NEW_NAME zip -r $SOURCE/$NEW_NAME.zip $NEW_NAME
echo "Removing temporary directory"
rm -r -f $BASE
echo "$NEW_NAME.zip created" echo "$NEW_NAME.zip created"
fi fi
echo "Removing temporary directory"
rm -r -f $BASE

View File

@ -349,7 +349,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
byte *ref_pos,*next_pos,ref_buff[MAX_REFLENGTH]; byte *ref_pos,*next_pos,ref_buff[MAX_REFLENGTH];
my_off_t record; my_off_t record;
TABLE *sort_form; TABLE *sort_form;
volatile bool *killed= &current_thd->killed; volatile my_bool *killed= &current_thd->killed;
handler *file; handler *file;
DBUG_ENTER("find_all_keys"); DBUG_ENTER("find_all_keys");
DBUG_PRINT("info",("using: %s",(select?select->quick?"ranges":"where":"every row"))); DBUG_PRINT("info",("using: %s",(select?select->quick?"ranges":"where":"every row")));
@ -800,8 +800,8 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
BUFFPEK *buffpek,**refpek; BUFFPEK *buffpek,**refpek;
QUEUE queue; QUEUE queue;
qsort2_cmp cmp; qsort2_cmp cmp;
volatile bool *killed= &current_thd->killed; volatile my_bool *killed= &current_thd->killed;
bool not_killable; my_bool not_killable;
DBUG_ENTER("merge_buffers"); DBUG_ENTER("merge_buffers");
statistic_increment(filesort_merge_passes, &LOCK_status); statistic_increment(filesort_merge_passes, &LOCK_status);

View File

@ -89,7 +89,7 @@ static void mi_check_print_msg(MI_CHECK *param, const char* msg_type,
extern "C" { extern "C" {
volatile bool *killed_ptr(MI_CHECK *param) volatile my_bool *killed_ptr(MI_CHECK *param)
{ {
return &(((THD *)(param->thd))->killed); return &(((THD *)(param->thd))->killed);
} }

View File

@ -515,6 +515,7 @@ end:
#else #else
#define UNLOCK_MUTEX #define UNLOCK_MUTEX
#define LOCK_MUTEX #define LOCK_MUTEX
#define max_allowed_packet (*mysql_get_parameters()->p_max_allowed_packet)
#endif #endif
/* /*

View File

@ -1503,7 +1503,7 @@ void mysql_cb_init()
} }
/ *To get the name of the NetWare volume having MySQL data folder */ /* To get the name of the NetWare volume having MySQL data folder */
static void getvolumename() static void getvolumename()
{ {
@ -1574,6 +1574,7 @@ static void registerwithneb()
/* /*
Callback for NSS Volume Deactivation event Callback for NSS Volume Deactivation event
*/ */
ulong neb_event_callback(struct EventBlock *eblock) ulong neb_event_callback(struct EventBlock *eblock)
{ {
EventChangeVolStateEnter_s *voldata; EventChangeVolStateEnter_s *voldata;
@ -1602,7 +1603,7 @@ ulong neb_event_callback(struct EventBlock *eblock)
#define ADMIN_VOL_PATH "_ADMIN:/Volumes/" #define ADMIN_VOL_PATH "_ADMIN:/Volumes/"
staticvoid getvolumeID(BYTE *volumeName) static void getvolumeID(BYTE *volumeName)
{ {
char path[zMAX_FULL_NAME]; char path[zMAX_FULL_NAME];
Key_t rootKey= 0, fileKey= 0; Key_t rootKey= 0, fileKey= 0;

View File

@ -91,7 +91,16 @@ template <> class Bitmap<64>
ulonglong map; ulonglong map;
public: public:
Bitmap<64>() { } Bitmap<64>() { }
#if defined(__NETWARE__)
/*
Metwork compiler gives error on Bitmap<64>
Changed to Bitmap, since in this case also it will proper construct
this class
*/
explicit Bitmap(uint prefix_to_set) { set_prefix(prefix_to_set); }
#else
explicit Bitmap<64>(uint prefix_to_set) { set_prefix(prefix_to_set); } explicit Bitmap<64>(uint prefix_to_set) { set_prefix(prefix_to_set); }
#endif
void init() { } void init() { }
void init(uint prefix_to_set) { set_prefix(prefix_to_set); } void init(uint prefix_to_set) { set_prefix(prefix_to_set); }
uint length() const { return 64; } uint length() const { return 64; }

View File

@ -808,10 +808,10 @@ public:
bool query_start_used,last_insert_id_used,insert_id_used,rand_used; bool query_start_used,last_insert_id_used,insert_id_used,rand_used;
bool in_lock_tables,global_read_lock; bool in_lock_tables,global_read_lock;
bool query_error, bootstrap, cleanup_done; bool query_error, bootstrap, cleanup_done;
bool volatile killed;
bool tmp_table_used; bool tmp_table_used;
bool charset_is_system_charset, charset_is_collation_connection; bool charset_is_system_charset, charset_is_collation_connection;
bool slow_command; bool slow_command;
my_bool volatile killed;
/* /*
If we do a purge of binary logs, log index info of the threads If we do a purge of binary logs, log index info of the threads

View File

@ -190,7 +190,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
else else
#endif /* EMBEDDED_LIBRARY */ #endif /* EMBEDDED_LIBRARY */
res= open_and_lock_tables(thd, table_list); res= open_and_lock_tables(thd, table_list);
if (res) if (res || thd->is_fatal_error)
DBUG_RETURN(-1); DBUG_RETURN(-1);
table= table_list->table; table= table_list->table;

View File

@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h> #include <my_global.h>
#include <my_sys.h> #include <my_sys.h> /* Needed for MY_ERRNO_ERANGE */
#include <m_string.h> #include <m_string.h>
#undef ULONGLONG_MAX #undef ULONGLONG_MAX

View File

@ -357,7 +357,7 @@ LOG_MSG_FUNC(log_info,LOG_INFO)
#ifndef DBUG_OFF #ifndef DBUG_OFF
LOG_MSG_FUNC(log_debug,LOG_DEBUG) LOG_MSG_FUNC(log_debug,LOG_DEBUG)
#else #else
void log_debug(const char* __attribute__((unused)) fmt,...) {} void log_debug(const char* fmt __attribute__((unused)),...) {}
#endif #endif
static void handle_sigterm(int sig __attribute__((unused))) static void handle_sigterm(int sig __attribute__((unused)))