Commit 30bffb02 authored by unknown's avatar unknown

Changed prototype of killed_ptr() to make it more portable

Applied patches for Netware


innobase/include/os0thread.h:
  Applied patches for Netware
innobase/os/os0thread.c:
  Applied patches for Netware
libmysql/libmysql.c:
  Applied patches for Netware
libmysql/libmysql.def:
  Applied patches for Netware
myisam/myisamchk.c:
  Applied patches for Netware
  Changed prototype of killed_ptr() to make it more portable
myisam/myisamdef.h:
  Applied patches for Netware
  Changed prototype of killed_ptr() to make it more portable
mysql-test/t/rpl_relayspace-slave.opt:
  Applied patches for Netware
mysys/my_pthread.c:
  Applied patches for Netware
mysys/my_static.h:
  Portability fix
netware/BUILD/compile-linux-tools:
  Applied patches for Netware
  Changed prototype of killed_ptr() to make it more portable
netware/BUILD/mwenv:
  Applied patches for Netware
  Changed prototype of killed_ptr() to make it more portable
netware/BUILD/nwbootstrap:
  Applied patches for Netware
  Changed prototype of killed_ptr() to make it more portable
netware/my_manage.c:
  Applied patches for Netware
  Changed prototype of killed_ptr() to make it more portable
netware/mysql_fix_privilege_tables.pl:
  Applied patches for Netware
  Changed prototype of killed_ptr() to make it more portable
netware/mysql_test_run.c:
  Applied patches for Netware
  Changed prototype of killed_ptr() to make it more portable
netware/static_init_db.sql:
  Applied patches for Netware
  Changed prototype of killed_ptr() to make it more portable
scripts/make_binary_distribution.sh:
  Applied patches for Netware
  Changed prototype of killed_ptr() to make it more portable
sql/filesort.cc:
  Changed prototype of killed_ptr() to make it more portable
sql/ha_myisam.cc:
  Changed prototype of killed_ptr() to make it more portable
sql/mysqld.cc:
  Fixed some typos for Netware
sql/sql_bitmap.h:
  Applied patches for Netware
sql/sql_class.h:
  Changed prototype of killed_ptr() to make it more portable
sql/sql_insert.cc:
  safety fix
strings/my_strtoll10.c:
  Added comment
parent 1d482780
...@@ -78,6 +78,10 @@ os_thread_create( ...@@ -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. */
......
...@@ -201,6 +201,13 @@ os_thread_exit( ...@@ -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. */
......
...@@ -149,7 +149,7 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)), ...@@ -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
......
...@@ -81,7 +81,6 @@ EXPORTS ...@@ -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,6 +113,9 @@ EXPORTS ...@@ -114,6 +113,9 @@ EXPORTS
mysql_thread_safe mysql_thread_safe
mysql_use_result mysql_use_result
mysql_warning_count mysql_warning_count
mysql_stmt_sqlstate
mysql_sqlstate
mysql_get_server_version
net_buffer_length net_buffer_length
set_dynamic set_dynamic
strcend strcend
......
...@@ -363,7 +363,7 @@ static void usage(void) ...@@ -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: ...@@ -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 */
......
...@@ -711,7 +711,7 @@ int mi_open_keyfile(MYISAM_SHARE *share); ...@@ -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,...));
......
-O relay_log_space_limit=10 --relay_log_space_limit=10
\ No newline at end of file
...@@ -98,25 +98,23 @@ void *my_pthread_getspecific_imp(pthread_key_t key) ...@@ -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" /*
with a debug build of LibC the reaper can have different names "MYSQLD.NLM's LibC Reaper" or "MYSQLD.NLM's main thread"
*/ 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
......
...@@ -19,6 +19,7 @@ ...@@ -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]; ...@@ -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
...@@ -43,6 +43,8 @@ make clean config.h ...@@ -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)
......
...@@ -6,8 +6,8 @@ ...@@ -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' ...@@ -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=:
...@@ -171,6 +171,11 @@ do ...@@ -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 ...@@ -183,5 +188,3 @@ then
fi fi
echo "done" echo "done"
...@@ -200,11 +200,11 @@ int wait_for_server_start(char *bin_dir, char *user, char *password, int port,ch ...@@ -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) ...@@ -475,4 +475,3 @@ void get_basedir(char *argv0, char *basedir)
strcpy(basedir, temp); strcpy(basedir, temp);
} }
} }
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Copyright (C) 2002 MySQL AB # Copyright (C) 2002 MySQL AB
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or # the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# 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
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# This notice applies to changes, created by or for Novell, Inc., # This notice applies to changes, created by or for Novell, Inc.,
# to preexisting works for which notices appear elsewhere in this file. # to preexisting works for which notices appear elsewhere in this file.
# Copyright (c) 2003 Novell, Inc. All Rights Reserved. # Copyright (c) 2003 Novell, Inc. All Rights Reserved.
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
...@@ -37,7 +37,7 @@ ...@@ -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";
...@@ -63,12 +63,27 @@ my $conn = Mysql->connect("localhost", "mysql", "root", $password) ...@@ -63,12 +63,27 @@ my $conn = Mysql->connect("localhost", "mysql", "root", $password)
|| die "Unable to connect to MySQL."; || die "Unable to connect to MySQL.";
print "OK, successfully used the password, moving on...\n\n"; 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, \ ...@@ -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, \ ...@@ -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, \ ...@@ -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; \ ...@@ -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";
...@@ -153,6 +153,7 @@ void log_info(char *, ...); ...@@ -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() ...@@ -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() ...@@ -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() ...@@ -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() ...@@ -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() ...@@ -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() ...@@ -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() ...@@ -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() ...@@ -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() ...@@ -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() ...@@ -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() ...@@ -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() ...@@ -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) ...@@ -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) ...@@ -786,17 +801,13 @@ void run_test(char *test)
int flag = FALSE; int flag = FALSE;
struct stat info; struct stat info;
// single test? // skip tests in the skip list
// if (!single_test) snprintf(temp, PATH_MAX, " %s ", test);
{ skip = (strindex(skip_test, temp) != NULL);
// skip tests in the skip list if (skip == FALSE)
snprintf(temp, PATH_MAX, " %s ", test); ignore = (strindex(ignore_test, temp) != NULL);
skip = (strindex(skip_test, temp) != NULL);
if( skip == FALSE )
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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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;
}
...@@ -10,7 +10,7 @@ INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y', ...@@ -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 ('',''); ...@@ -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';
......
...@@ -197,14 +197,6 @@ fi ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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
...@@ -349,7 +349,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select, ...@@ -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, ...@@ -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);
......
...@@ -89,7 +89,7 @@ static void mi_check_print_msg(MI_CHECK *param, const char* msg_type, ...@@ -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);
} }
......
...@@ -1503,7 +1503,7 @@ void mysql_cb_init() ...@@ -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() ...@@ -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) ...@@ -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;
...@@ -1610,7 +1611,7 @@ staticvoid getvolumeID(BYTE *volumeName) ...@@ -1610,7 +1611,7 @@ staticvoid getvolumeID(BYTE *volumeName)
zInfo_s info; zInfo_s info;
STATUS status; STATUS status;
/* Get the root key */ /* Get the root key */
if ((status= zRootKey(0, &rootKey)) != zOK) if ((status= zRootKey(0, &rootKey)) != zOK)
{ {
consoleprintf("\nGetNSSVolumeProperties - Failed to get root key, status: %d\n.", (int) status); consoleprintf("\nGetNSSVolumeProperties - Failed to get root key, status: %d\n.", (int) status);
......
...@@ -91,7 +91,16 @@ template <> class Bitmap<64> ...@@ -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; }
......
...@@ -808,10 +808,10 @@ public: ...@@ -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
......
...@@ -190,7 +190,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, ...@@ -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;
......
...@@ -15,7 +15,7 @@ ...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment