Commit 91e84fc8 authored by serg@serg.mysql.com's avatar serg@serg.mysql.com

Merge work:/home/bk/mysql-4.0

into serg.mysql.com:/usr/home/serg/Abk/mysql-4.0
parents c18a94f3 9131b569
......@@ -7,6 +7,7 @@
*.la
*.lo
*.o
*.reject
*.spec
*/*_pure_*warnings
*/.pure
......@@ -152,6 +153,8 @@ client/mysqlbinlog
client/mysqlcheck
client/mysqldump
client/mysqlimport
client/mysqlmanager-pwgen
client/mysqlmanagerc
client/mysqlshow
client/mysqltest
client/mysys_priv.h
......@@ -203,6 +206,17 @@ libmysqld/backup_dir
libmysqld/convert.cc
libmysqld/derror.cc
libmysqld/errmsg.c
libmysqld/examples/completion_hash.cc
libmysqld/examples/completion_hash.h
libmysqld/examples/my_readline.h
libmysqld/examples/mysql
libmysqld/examples/mysql.cc
libmysqld/examples/mysqltest
libmysqld/examples/mysqltest.c
libmysqld/examples/readline.cc
libmysqld/examples/sql_string.cc
libmysqld/examples/sql_string.h
libmysqld/examples/test-gdbinit
libmysqld/field.cc
libmysqld/field_conv.cc
libmysqld/filesort.cc
......@@ -326,6 +340,7 @@ scripts/make_binary_distribution
scripts/msql2mysql
scripts/mysql_config
scripts/mysql_convert_table_format
scripts/mysql_explain_log
scripts/mysql_find_rows
scripts/mysql_fix_privilege_tables
scripts/mysql_install_db
......@@ -402,13 +417,3 @@ vio/test-ssl
vio/test-sslclient
vio/test-sslserver
vio/viotest-ssl
libmysqld/examples/completion_hash.cc
libmysqld/examples/completion_hash.h
libmysqld/examples/my_readline.h
libmysqld/examples/mysql.cc
libmysqld/examples/mysqltest.c
libmysqld/examples/readline.cc
libmysqld/examples/sql_string.cc
libmysqld/examples/sql_string.h
libmysqld/examples/mysql
libmysqld/examples/mysqltest
gmake -k clean || true
/bin/rm -f */.deps/*.P config.cache
aclocal && autoheader && aclocal && automake && autoconf
(cd bdb/dist && sh s_all)
(cd innobase && aclocal && autoheader && aclocal && automake && autoconf)
if [ -d gemini ]
then
(cd gemini && aclocal && autoheader && aclocal && automake && autoconf)
fi
CC=ecc CFLAGS="-w1 -DEXTRA_DEBUG -DSAFEMALLOC -DSAFE_MUTEX -O2" CXX=ecc CXXFLAGS="-w1 -DEXTRA_DEBUG -DSAFEMALLOC -DSAFE_MUTEX -O2" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-debug --with-innodb --with-embedded-server
gmake
......@@ -8,6 +8,6 @@ extra_configs="$pentium_configs"
strip=yes
extra_configs="$extra_configs --with-innodb --with-berkeley-db \
--enable-thread-safe-client"
--enable-thread-safe-client --with-openssl --with-vio"
. "$path/FINISH.sh"
Administrator@fred.
Miguel@light.local
Sinisa@sinisa.nasamreza.org
davida@isil.mysql.com
heikki@donna.mysql.fi
......@@ -26,5 +28,6 @@ tim@threads.polyesthetic.msg
tim@white.box
tim@work.mysql.com
tonu@hundin.mysql.fi
tonu@volk.internalnet
tonu@x153.internalnet
tonu@x3.internalnet
......@@ -65,6 +65,7 @@ aclocal; autoheader; aclocal; automake; autoconf
--enable-thread-safe-client \
--with-berkeley-db \
--with-innodb \
--with-vio \
--without-pstack \
--with-extra-tools \
--with-embedded-server
......
......@@ -4,10 +4,10 @@ use Getopt::Long;
$opt_distribution=$opt_user=$opt_result=$opt_config_options=$opt_config_env="";
$opt_dbd_options=$opt_perl_options=$opt_suffix="";
$opt_tmp=$version_suffix="";
$opt_help=$opt_Information=$opt_no_delete=$opt_delete=$opt_debug=$opt_stage=$opt_rsh_mail=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_no_mysqltest=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=0;
$opt_help=$opt_Information=$opt_delete=$opt_debug=$opt_stage=$opt_rsh_mail=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_no_mysqltest=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=0;
$opt_innodb=$opt_bdb=0;
GetOptions("Information","help","distribution=s","user=s","result=s","no-delete","delete","no-test","no-mysqltest","perl-files=s","debug","config-options=s","config-env=s","stage=i","rsh-mail","with-low-memory","fast-benchmark","tmp=s","static-client","static-server","static-perl","no-perl","local-perl","perl-options=s","sur","with-small-disk","dbd-options=s","tcpip","suffix=s","build-thread=i","innodb","bdb","use-old-distribution","enable-shared","no-crash-me","no-strip") || usage();
GetOptions("Information","help","distribution=s","user=s","result=s","delete","no-test","no-mysqltest","perl-files=s","debug","config-options=s","config-env=s","stage=i","rsh-mail","with-low-memory","fast-benchmark","tmp=s","static-client","static-server","static-perl","no-perl","local-perl","perl-options=s","sur","with-small-disk","dbd-options=s","tcpip","suffix=s","build-thread=i","innodb","bdb","use-old-distribution","enable-shared","no-crash-me","no-strip") || usage();
usage() if ($opt_help || $opt_Information);
usage() if (!$opt_distribution);
......@@ -105,14 +105,31 @@ $|=1;
safe_cd("$host");
if ($opt_stage == 0 && ! $opt_use_old_distribution)
{
my ($name);
safe_system("gunzip < $opt_distribution | $tar xf -");
# Fix file times; This is needed because the time for files may be
# in the future
system("touch timestamp; find $var -newer timestamp -print | xargs touch; rm -f timestamp");
sleep(2);
# Ensure that files we don't want to rebuild are newer than other files
foreach $name ("configure",
"Docs/include.texi",
"Docs/*.html", "Docs/manual.txt", "Docs/mysql.info",
"sql/sql_yacc.h", "sql/sql_yacc.cc")
{
system("touch $name");
}
}
safe_cd($ver);
if ($opt_stage <= 1)
{
$opt_config_options.=" --with-low-memory" if ($opt_with_low_memory);
# Fix files if this is in another timezone than work.mysql.com
unlink("config.cache");
unlink("bdb/build_unix/config.cache");
unlink("innobase/config.cache");
log_system("$make clean") if ($opt_use_old_distribution);
if ($opt_static_server)
{
......@@ -143,7 +160,7 @@ if ($opt_stage <= 1)
if ($opt_stage <= 2)
{
unlink($opt_distribution) if (!$opt_delete && !$opt_use_old_distribution);
unlink($opt_distribution) if ($opt_delete && !$opt_use_old_distribution);
safe_system("$make");
}
......
......@@ -210,7 +210,7 @@ if [ $? != 0 ]; then
tail $log
fi
if [ ! x$local_build=x1 ]; then
if [ x$local_build != x1 ]; then
# Build perl RPM (we currently need to be root to do this and that is
# not possible)
......@@ -228,5 +228,3 @@ if [ ! x$local_build=x1 ]; then
#scp $owner@$bmachine:$rpmdir/SRPMS/Perl*-*.rpm $bpath/NEW-RPMS
fi
) > $log 2>&1
No preview for this file type
File mode changed from 100755 to 100644
This diff is collapsed.
No preview for this file type
File mode changed from 100755 to 100644
No preview for this file type
File mode changed from 100755 to 100644
......@@ -3187,7 +3187,7 @@ encounter per year, but we are as always very flexible towards our customers!
@c @image{Flags/estonia} Estonia [Tradenet] @
@c @uref{http://mysql.tradenet.ee, WWW}
@item
@c EMAIL: tonu@spamm.ee (Tonu Samuel)
@c EMAIL: tonu@spam.ee (Tonu Samuel)
@image{Flags/estonia} Estonia [OKinteractive] @
@uref{http://mysql.mirror.ok.ee, WWW}
@item
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -663,7 +663,7 @@ if test "$cpu_vendor" = "AuthenticAMD"; then
fi
elif test "$cpu_vendor" = "GenuineIntel"; then
if test $cpu_family>=6; then
cpu_set=" pentiumpro pentium i486 i386";
cpu_set="pentiumpro pentium i486 i386";
elif test $cpu_family=5; then
cpu_set="pentium i486 i386";
elif test $cpu_family=4; then
......@@ -682,16 +682,15 @@ done
if test "$mysql_cv_cpu" = "unknown"
then
CFLAGS="$ac_save_CFLAGS"
AC_MSG_RESULT(none)
AC_MSG_RESULT(none)
else
AC_MSG_RESULT($mysql_cv_cpu)
AC_MSG_RESULT($mysql_cv_cpu)
fi
]))
AC_DEFUN(MYSQL_CHECK_VIO, [
AC_ARG_WITH([vio],
[\
--with-vio Include the Virtual IO support],
[ --with-vio Include the Virtual IO support],
[vio="$withval"],
[vio=no])
......@@ -708,30 +707,55 @@ AC_DEFUN(MYSQL_CHECK_VIO, [
AC_SUBST([vio_libs])
])
AC_DEFUN(MYSQL_FIND_OPENSSL, [
for d in /usr/ssl/include /usr/local/ssl/include /usr/include/openssl \
/usr/include/ssl /opt/ssl/include /opt/openssl/include ; do
if test -f $d/ssl.h ; then
OPENSSL_INCLUDE=$d
fi
done
for d in /usr/ssl/lib /usr/local/ssl/lib /usr/lib/openssl \
/usr/lib /opt/ssl/lib /opt/openssl/lib ; do
if test -f $d/libssl.a ; then
OPENSSL_LIB=$d
fi
done
if test -z "$OPENSSL_LIB" -o -z "$OPENSSL_INCLUDE" ; then
echo "Could not find an installation of OpenSSL"
if test -n "$OPENSSL_LIB" ; then
if test "$IS_LINUX" = "true"; then
echo "Looks like you've forgotted to install OpenSSL development RPM"
fi
fi
exit 1
fi
])
AC_DEFUN(MYSQL_CHECK_OPENSSL, [
AC_MSG_CHECKING(for OpenSSL)
AC_ARG_WITH([openssl],
[\
--with-openssl Include the OpenSSL support],
[ --with-openssl Include the OpenSSL support],
[openssl="$withval"],
[openssl=no])
openssl_libs=""
openssl_includes=""
if test "$openssl" = "yes"
then
if test -n "$vio_dir"
then
AC_MSG_RESULT(yes)
openssl_libs="-lssl -lcrypto -L/usr/local/ssl/lib"
openssl_includes="-I/usr/local/ssl/include"
else
AC_MSG_ERROR([OpenSSL requires Virtual IO support (--with-vio)])
fi
MYSQL_FIND_OPENSSL
#force VIO use
vio_dir="vio"
vio_libs="../vio/libvio.la"
AC_DEFINE(HAVE_VIO)
AC_MSG_RESULT(yes)
openssl_libs="-L$OPENSSL_LIB -lssl -lcrypto"
openssl_includes="-I$OPENSSL_INCLUDE"
AC_DEFINE(HAVE_OPENSSL)
else
AC_MSG_RESULT(no)
openssl_libs=""
openssl_includes=""
fi
NON_THREADED_CLIENT_LIBS="$NON_THREADED_CLIENT_LIBS $openssl_libs"
AC_SUBST(openssl_libs)
......@@ -750,23 +774,27 @@ dnl Call MYSQL_CHECK_ORBIT even if mysqlfs == no, so that @orbit_*@
dnl get substituted.
MYSQL_CHECK_ORBIT
AC_MSG_CHECKING(if we should build MySQLFS)
fs_dirs=""
if test "$mysqlfs" = "yes"
then
if test -n "$orbit_exec_prefix"
then
fs_dirs=fs
AC_MSG_RESULT([yes])
else
AC_MSG_ERROR([mysqlfs requires ORBit, the CORBA ORB])
AC_MSG_RESULT(disabled because ORBIT, the CORBA ORB, was not found)
fi
else
fs_dirs=
AC_MSG_RESULT([no])
fi
AC_SUBST([fs_dirs])
])
AC_DEFUN(MYSQL_CHECK_ORBIT, [
AC_MSG_CHECKING(for ORBit)
if test `which orbit-config`
orbit_config_path=`which orbit-config`
if test -n "$orbit_config_path"
then
orbit_exec_prefix=`orbit-config --exec-prefix`
orbit_includes=`orbit-config --cflags server`
......@@ -852,6 +880,7 @@ dnl echo "DBG2: [$mode] bdb='$bdb'; incl='$bdb_includes'; lib='$bdb_libs'"
no )
bdb_includes=
bdb_libs=
bdb_libs_with_path=
;;
supplied-two )
MYSQL_CHECK_INSTALLED_BDB([$bdb_includes], [$bdb_libs])
......@@ -881,6 +910,7 @@ dnl echo "DBG2: [$mode] bdb='$bdb'; incl='$bdb_includes'; lib='$bdb_libs'"
esac
bdb_includes=
bdb_libs=
bdb_libs_with_path=
;;
esac
;;
......@@ -909,6 +939,7 @@ dnl echo "DBG3: [$mode] bdb='$bdb'; incl='$bdb_includes'; lib='$bdb_libs'"
AC_SUBST(bdb_includes)
AC_SUBST(bdb_libs)
AC_SUBST(bdb_libs_with_path)
])
AC_DEFUN([MYSQL_CHECK_INSTALLED_BDB], [
......@@ -929,6 +960,7 @@ dnl echo ["MYSQL_CHECK_INSTALLED_BDB ($1) ($2)"]
MYSQL_TOP_BUILDDIR([lib])
bdb_includes="-I$inc"
bdb_libs="-L$lib -ldb"
bdb_libs_with_path="$lib/libdb.a"
])
LDFLAGS="$save_LDFLAGS"
else
......@@ -957,6 +989,7 @@ dnl echo ["MYSQL_CHECK_BDB_DIR ($1)"]
MYSQL_TOP_BUILDDIR([dir])
bdb_includes="-I$dir/build_unix"
bdb_libs="-L$dir/build_unix -ldb"
bdb_libs_with_path="$dir/build_unix/libdb.a"
else
bdb_dir_ok="$bdb_version_ok"
fi
......@@ -1053,9 +1086,9 @@ dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_CHECK_INNODB], [
AC_ARG_WITH([innodb],
[\
--with-innodb Use Innodb],
--without-innodb Do not include the InnoDB table handler],
[innodb="$withval"],
[innodb=no])
[innodb=yes])
AC_MSG_CHECKING([for Innodb])
......@@ -1068,6 +1101,7 @@ AC_DEFUN([MYSQL_CHECK_INNODB], [
AC_DEFINE(HAVE_INNOBASE_DB)
have_innodb="yes"
innodb_includes="-I../innobase/include"
innodb_system_libs=""
dnl Some libs are listed several times, in order for gcc to sort out
dnl circular references.
innodb_libs="\
......@@ -1108,7 +1142,7 @@ dnl circular references.
\$(top_builddir)/innobase/os/libos.a\
\$(top_builddir)/innobase/ut/libut.a"
AC_CHECK_LIB(rt, aio_read, [innodb_libs="$innodb_libs -lrt"])
AC_CHECK_LIB(rt, aio_read, [innodb_system_libs="-lrt"])
;;
* )
AC_MSG_RESULT([Not using Innodb])
......@@ -1117,6 +1151,7 @@ dnl circular references.
AC_SUBST(innodb_includes)
AC_SUBST(innodb_libs)
AC_SUBST(innodb_system_libs)
])
dnl ---------------------------------------------------------------------------
......@@ -1131,7 +1166,7 @@ dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_CHECK_GEMINI], [
AC_ARG_WITH([gemini],
[\
--with-gemini[=DIR] Use Gemini DB located in DIR],
--with-gemini[=DIR] Use Gemini DB located in DIR],
[gemini="$withval"],
[gemini=no])
......@@ -1152,8 +1187,7 @@ dnl echo "DBG_GEM1: gemini='$gemini'"
gemini_libs="\
../gemini/api/libapi.a\
../gemini/db/libdb.a\
../gemini/dbut/libdbut.a\
../gemini/vst/libvst.a"
../gemini/dbut/libdbut.a"
AC_MSG_RESULT([Using Gemini DB])
;;
esac
......@@ -1251,7 +1285,7 @@ changequote([, ])dnl
AC_DEFUN(AC_SYS_LARGEFILE,
[AC_REQUIRE([AC_CANONICAL_HOST])
AC_ARG_ENABLE(largefile,
[ --disable-large-files Omit support for large files])
[ --disable-largefile Omit support for large files])
if test "$enable_largefile" != no; then
AC_CHECK_TOOL(GETCONF, getconf)
AC_SYS_LARGEFILE_FLAGS(CFLAGS)
......
......@@ -19,13 +19,13 @@
INCLUDES = -I$(srcdir)/../include $(openssl_includes) \
-I../include -I$(srcdir)/.. -I$(top_srcdir) \
-I..
noinst_HEADERS = client_priv.h
LIBS = @CLIENT_LIBS@
LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysql/libmysqlclient.la
bin_PROGRAMS = mysql mysqladmin mysqlcheck mysqlshow \
mysqldump mysqlimport mysqltest mysqlbinlog
mysqldump mysqlimport mysqltest mysqlbinlog mysqlmanagerc mysqlmanager-pwgen
noinst_PROGRAMS = insert_test select_test thread_test
noinst_HEADERS = sql_string.h completion_hash.h my_readline.h
noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \
client_priv.h
mysql_SOURCES = mysql.cc readline.cc sql_string.cc completion_hash.cc
mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD) $(CXXLDFLAGS)
mysql_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
......@@ -36,14 +36,16 @@ mysqldump_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
mysqlimport_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
insert_test_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
select_test_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
mysqltest_SOURCES= mysqltest.c
mysqltest_SOURCES= mysqltest.c
mysqltest_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
mysqlbinlog_SOURCES = mysqlbinlog.cc
mysqlbinlog_SOURCES = mysqlbinlog.cc
mysqlbinlog_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
sql_src= log_event.h log_event.cc
mysqlmanagerc_SOURCES = mysqlmanagerc.c
mysqlmanagerc_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
sql_src=log_event.h log_event.cc
# Fix for mit-threads
DEFS= -DUNDEF_THREADS_HACK
DEFS = -DUNDEF_THREADS_HACK
link_sources:
for f in $(sql_src) ; do \
......
......@@ -19,6 +19,7 @@
#include <my_global.h>
#include <my_sys.h>
#include <m_string.h>
#include <mysql_embed.h>
#include <mysql.h>
#include <errmsg.h>
#include <getopt.h>
......
......@@ -47,10 +47,12 @@ int completion_hash_init(HashTable *ht, uint nSize)
ht->arBuckets = (Bucket **) my_malloc(nSize* sizeof(Bucket *),
MYF(MY_ZEROFILL | MY_WME));
if (!ht->arBuckets) {
if (!ht->arBuckets)
{
ht->initialized = 0;
return FAILURE;
}
init_alloc_root(&ht->mem_root, 8192, 0);
ht->pHashFunction = hashpjw;
ht->nTableSize = nSize;
ht->initialized = 1;
......@@ -78,8 +80,7 @@ int completion_hash_update(HashTable *ht, char *arKey, uint nKeyLength,
if (!memcmp(p->arKey, arKey, nKeyLength)) {
entry *n;
n = (entry *) my_malloc(sizeof(entry),
MYF(MY_WME));
n = (entry *) alloc_root(&ht->mem_root,sizeof(entry));
n->pNext = p->pData;
n->str = str;
p->pData = n;
......@@ -91,20 +92,16 @@ int completion_hash_update(HashTable *ht, char *arKey, uint nKeyLength,
p = p->pNext;
}
p = (Bucket *) my_malloc(sizeof(Bucket),MYF(MY_WME));
if (!p) {
if (!(p = (Bucket *) alloc_root(&ht->mem_root, sizeof(Bucket))))
return FAILURE;
}
p->arKey = arKey;
p->nKeyLength = nKeyLength;
p->h = h;
p->pData = (entry*) my_malloc(sizeof(entry),MYF(MY_WME));
if (!p->pData) {
my_free((gptr) p,MYF(0));
if (!(p->pData = (entry*) alloc_root(&ht->mem_root, sizeof(entry))))
return FAILURE;
}
p->pData->str = str;
p->pData->pNext = 0;
p->count = 1;
......@@ -209,24 +206,7 @@ Bucket *find_longest_match(HashTable *ht, char *str, uint length,
void completion_hash_clean(HashTable *ht)
{
uint i;
entry *e, *t;
Bucket *b, *tmp;
for (i=0; i<ht->nTableSize; i++) {
b = ht->arBuckets[i];
while (b) {
e = b->pData;
while (e) {
t = e;
e = e->pNext;
my_free((gptr) t,MYF(0));
}
tmp = b;
b = b->pNext;
my_free((gptr) tmp,MYF(0));
}
}
free_root(&ht->mem_root,MYF(0));
bzero((char*) ht->arBuckets,ht->nTableSize*sizeof(Bucket *));
}
......@@ -241,9 +221,7 @@ void completion_hash_free(HashTable *ht)
void add_word(HashTable *ht,char *str)
{
int i;
int length= (int) strlen(str);
for (i=1; i<=length; i++) {
char *pos=str;
for (i=1; *pos; i++, pos++)
completion_hash_update(ht, str, i, str);
}
}
......@@ -22,26 +22,29 @@
#define FAILURE 1
#include <sys/types.h>
#include <my_sys.h>
typedef struct _entry {
char *str;
struct _entry *pNext;
} entry;
typedef struct bucket {
uint h; /* Used for numeric indexing */
char *arKey;
uint nKeyLength;
uint count;
entry *pData;
struct bucket *pNext;
typedef struct bucket
{
uint h; /* Used for numeric indexing */
char *arKey;
uint nKeyLength;
uint count;
entry *pData;
struct bucket *pNext;
} Bucket;
typedef struct hashtable {
uint nTableSize;
uint initialized;
uint(*pHashFunction) (char *arKey, uint nKeyLength);
Bucket **arBuckets;
uint nTableSize;
uint initialized;
MEM_ROOT mem_root;
uint(*pHashFunction) (char *arKey, uint nKeyLength);
Bucket **arBuckets;
} HashTable;
extern int completion_hash_init(HashTable *ht, uint nSize);
......@@ -54,4 +57,4 @@ extern void completion_hash_clean(HashTable *ht);
extern int completion_hash_exists(HashTable *ht, char *arKey, uint nKeyLength);
extern void completion_hash_free(HashTable *ht);
#endif /* _HASH_ */
#endif /* _HASH_ */
......@@ -24,6 +24,7 @@
* Jani Tolonen <jani@mysql.com>
* Matt Wagner <mwagner@mysql.com>
* Jeremy Cole <jcole@mysql.com>
* Tonu Samuel <tonu@mysql.com>
*
**/
......@@ -74,7 +75,6 @@ extern "C" {
#endif
#undef bcmp // Fix problem with new readline
#undef bzero
#if defined( __WIN__) || defined(OS2)
#include <conio.h>
#else
......@@ -137,6 +137,7 @@ static const char *xmlmeta[] = {
static char default_pager[FN_REFLEN];
char pager[FN_REFLEN], outfile[FN_REFLEN];
FILE *PAGER, *OUTFILE;
MEM_ROOT hash_mem_root;
#include "sslopt-vars.h"
......@@ -243,7 +244,8 @@ static COMMANDS commands[] = {
};
static const char *load_default_groups[]= { "mysql","client",0 };
static const char *server_default_groups[]= { "server", "mysql_SERVER", 0 };
static const char *server_default_groups[]=
{ "server", "embedded", "mysql_SERVER", 0 };
#ifdef HAVE_READLINE
extern "C" void add_history(char *command); /* From readline directory */
......@@ -271,7 +273,6 @@ int main(int argc,char *argv[])
{
char buff[80];
mysql_server_init(0, NULL, server_default_groups);
MY_INIT(argv[0]);
DBUG_ENTER("main");
DBUG_PROCESS(argv[0]);
......@@ -302,7 +303,10 @@ int main(int argc,char *argv[])
!(status.line_buff=batch_readline_init(max_allowed_packet+512,stdin)))
exit(1);
glob_buffer.realloc(512);
completion_hash_init(&ht,50);
mysql_server_init(0, NULL, (char**) server_default_groups);
completion_hash_init(&ht, 128);
init_alloc_root(&hash_mem_root, 16384, 0);
bzero((char*) &mysql, sizeof(mysql));
if (sql_connect(current_host,current_db,current_user,opt_password,
opt_silent))
{
......@@ -326,11 +330,13 @@ int main(int argc,char *argv[])
put_info((char*) glob_buffer.ptr(),INFO_INFO);
#ifdef HAVE_OPENSSL
if(mysql.net.vio->ssl_ && SSL_get_cipher(mysql.net.vio->ssl_)) {
if (mysql.net.vio->ssl_ && SSL_get_cipher(mysql.net.vio->ssl_))
{
sprintf((char*) glob_buffer.ptr(),
"SSL cipher in use is %s\n", SSL_get_cipher(mysql.net.vio->ssl_));
"SSL cipher in use is %s\n", SSL_get_cipher(mysql.net.vio->ssl_));
put_info((char*) glob_buffer.ptr(),INFO_INFO);
} else
}
else
put_info("SSL is not in use\n",INFO_INFO);
#endif /* HAVE_OPENSSL */
......@@ -365,7 +371,6 @@ int main(int argc,char *argv[])
if (opt_outfile)
end_tee();
mysql_end(0);
mysql_server_end();
#ifndef _lint
DBUG_RETURN(0); // Keep compiler happy
#endif
......@@ -373,13 +378,7 @@ int main(int argc,char *argv[])
sig_handler mysql_end(int sig)
{
if (connected)
mysql_close(&mysql);
#ifdef HAVE_OPENSSL
else
mysql_ssl_clear(&mysql); /* SSL data structres should be freed
even if connection was not made */
#endif
mysql_close(&mysql);
#ifdef HAVE_READLINE
if (!status.batch && !quick && !opt_html && !opt_xml)
{
......@@ -390,6 +389,8 @@ sig_handler mysql_end(int sig)
}
batch_readline_end(status.line_buff);
completion_hash_free(&ht);
free_root(&hash_mem_root,MYF(0));
#endif
if (sig >= 0)
put_info(sig ? "Aborted" : "Bye", INFO_RESULT);
......@@ -401,6 +402,7 @@ sig_handler mysql_end(int sig)
my_free(current_db,MYF(MY_ALLOW_ZERO_PTR));
my_free(current_host,MYF(MY_ALLOW_ZERO_PTR));
my_free(current_user,MYF(MY_ALLOW_ZERO_PTR));
mysql_server_end();
my_end(info_flag ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
exit(status.exit_status);
}
......@@ -970,7 +972,7 @@ static bool add_line(String &buffer,char *line,char *in_string)
{ // mSQL or postgreSQL style command ?
if (!(inchar = (uchar) *++pos))
break; // readline adds one '\'
if (*in_string || inchar == 'N')
if (*in_string || inchar == 'N') // \N is short for NULL
{ // Don't allow commands in string
*out++='\\';
*out++= (char) inchar;
......@@ -1172,7 +1174,8 @@ static char *new_command_generator(char *text,int state)
static void build_completion_hash(bool skip_rehash,bool write_info)
{
COMMANDS *cmd=commands;
static MYSQL_RES *databases=0,*tables=0,*fields;
MYSQL_RES *databases=0,*tables=0;
MYSQL_RES *fields;
static char ***field_names= 0;
MYSQL_ROW database_row,table_row;
MYSQL_FIELD *sql_field;
......@@ -1183,16 +1186,11 @@ static void build_completion_hash(bool skip_rehash,bool write_info)
if (status.batch || quick || !current_db)
DBUG_VOID_RETURN; // We don't need completion in batches
completion_hash_clean(&ht);
if (tables)
{
mysql_free_result(tables);
tables=0;
}
if (databases) {
mysql_free_result(databases);
databases=0;
}
/* hash SQL commands */
while (cmd->name) {
......@@ -1202,16 +1200,28 @@ static void build_completion_hash(bool skip_rehash,bool write_info)
if (skip_rehash)
DBUG_VOID_RETURN;
/* Free old used memory */
if (field_names)
field_names=0;
completion_hash_clean(&ht);
free_root(&hash_mem_root,MYF(0));
/* hash MySQL functions (to be implemented) */
/* hash all database names */
if (mysql_query(&mysql,"show databases")==0) {
if (mysql_query(&mysql,"show databases") == 0)
{
if (!(databases = mysql_store_result(&mysql)))
put_info(mysql_error(&mysql),INFO_INFO);
else
{
while ((database_row=mysql_fetch_row(databases)))
add_word(&ht,(char*) database_row[0]);
{
char *str=strdup_root(&hash_mem_root, (char*) database_row[0]);
if (str)
add_word(&ht,(char*) str);
}
mysql_free_result(databases);
}
}
/* hash all table names */
......@@ -1229,22 +1239,13 @@ You can turn off this feature to get a quicker startup with -A\n\n");
}
while ((table_row=mysql_fetch_row(tables)))
{
if (!completion_hash_exists(&ht,(char*) table_row[0],
(uint) strlen((const char*) table_row[0])))
add_word(&ht,table_row[0]);
}
}
}
if (field_names) {
for (i=0; field_names[i]; i++) {
for (j=0; field_names[i][j]; j++) {
my_free(field_names[i][j],MYF(0));
char *str=strdup_root(&hash_mem_root, (char*) table_row[0]);
if (str &&
!completion_hash_exists(&ht,(char*) str, (uint) strlen(str)))
add_word(&ht,str);
}
my_free((gptr) field_names[i],MYF(0));
}
my_free((gptr) field_names,MYF(0));
}
field_names=0;
/* hash all field names, both with the table prefix and without it */
if (!tables) /* no tables */
......@@ -1252,36 +1253,37 @@ You can turn off this feature to get a quicker startup with -A\n\n");
DBUG_VOID_RETURN;
}
mysql_data_seek(tables,0);
field_names = (char ***) my_malloc(sizeof(char **) *
(uint) (mysql_num_rows(tables)+1),
MYF(MY_WME));
if (!field_names)
if (!(field_names= (char ***) alloc_root(&hash_mem_root,sizeof(char **) *
(uint) (mysql_num_rows(tables)+1))))
{
mysql_free_result(tables);
DBUG_VOID_RETURN;
}
i=0;
while ((table_row=mysql_fetch_row(tables)))
{
if ((fields=mysql_list_fields(&mysql,(const char*) table_row[0],NullS)))
{
num_fields=mysql_num_fields(fields);
field_names[i] = (char **) my_malloc(sizeof(char *)*(num_fields*2+1),
MYF(0));
if (!field_names[i])
{
continue;
}
if (!(field_names[i] = (char **) alloc_root(&hash_mem_root,
sizeof(char *) *
(num_fields*2+1))))
break;
field_names[i][num_fields*2]='\0';
j=0;
while ((sql_field=mysql_fetch_field(fields)))
{
sprintf(buf,"%s.%s",table_row[0],sql_field->name);
field_names[i][j] = my_strdup(buf,MYF(0));
field_names[i][j] = strdup_root(&hash_mem_root,buf);
add_word(&ht,field_names[i][j]);
field_names[i][num_fields+j] = my_strdup(sql_field->name,MYF(0));
field_names[i][num_fields+j] = strdup_root(&hash_mem_root,
sql_field->name);
if (!completion_hash_exists(&ht,field_names[i][num_fields+j],
(uint) strlen(field_names[i][num_fields+j])))
add_word(&ht,field_names[i][num_fields+j]);
j++;
}
mysql_free_result(fields);
}
else
{
......@@ -1291,6 +1293,7 @@ You can turn off this feature to get a quicker startup with -A\n\n");
}
i++;
}
mysql_free_result(tables);
field_names[i]=0; // End pointer
DBUG_VOID_RETURN;
}
......@@ -2208,16 +2211,8 @@ static int
sql_real_connect(char *host,char *database,char *user,char *password,
uint silent)
{
if (connected)
{ /* if old is open, close it first */
mysql_close(&mysql);
connected= 0;
}
#ifdef HAVE_OPENSSL
else
mysql_ssl_clear(&mysql); /* SSL data structres should be freed
even if connection was not made */
#endif
mysql_close(&mysql);
connected= 0;
mysql_init(&mysql);
if (opt_connect_timeout)
{
......@@ -2230,7 +2225,7 @@ sql_real_connect(char *host,char *database,char *user,char *password,
#ifdef HAVE_OPENSSL
if (opt_use_ssl)
mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath);
opt_ssl_capath, opt_ssl_cipher);
#endif
if (safe_updates)
{
......@@ -2569,7 +2564,7 @@ static void mysql_end_timer(ulong start_time,char *buff)
strmov(strend(buff),")");
}
#ifndef EMBEDDED_SERVER
#ifndef EMBEDDED_LIBRARY
/* Keep sql_string library happy */
gptr sql_alloc(unsigned int Size)
......@@ -2581,4 +2576,4 @@ void sql_element_free(void *ptr)
{
my_free((gptr) ptr,MYF(0));
}
#endif /* EMBEDDED_SERVER */
#endif /* EMBEDDED_LIBRARY */
......@@ -23,7 +23,7 @@
#include <my_pthread.h> /* because of signal() */
#endif
#define ADMIN_VERSION "8.21"
#define ADMIN_VERSION "8.22"
#define MAX_MYSQL_VAR 64
#define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */
#define MAX_TRUNC_LENGTH 3
......@@ -51,7 +51,7 @@ static void print_version(void);
static void usage(void);
static my_bool sql_connect(MYSQL *mysql,const char *host, const char *user,
const char *password,uint wait);
static my_bool execute_commands(MYSQL *mysql,int argc, char **argv);
static int execute_commands(MYSQL *mysql,int argc, char **argv);
static int drop_db(MYSQL *mysql,const char *db);
static sig_handler endprog(int signal_number);
static void nice_time(ulong sec,char *buff);
......@@ -265,7 +265,7 @@ int main(int argc,char *argv[])
#ifdef HAVE_OPENSSL
if (opt_use_ssl)
mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath);
opt_ssl_capath, opt_ssl_cipher);
#endif /* HAVE_OPENSSL */
if (sql_connect(&mysql,host,user,opt_password,option_wait))
error = 1;
......@@ -275,16 +275,24 @@ int main(int argc,char *argv[])
while (!interrupted)
{
new_line = 0;
if (execute_commands(&mysql,argc,commands) && !option_force)
if ((error=execute_commands(&mysql,argc,commands)))
{
if (option_wait && !interrupted)
if (error > 0)
break; /* Wrong command error */
if (!option_force)
{
mysql_close(&mysql);
if (!sql_connect(&mysql,host,user,opt_password,option_wait))
continue; /* Retry */
if (option_wait && !interrupted)
{
mysql_close(&mysql);
if (!sql_connect(&mysql,host,user,opt_password,option_wait))
{
sleep(1); /* Don't retry too rapidly */
continue; /* Retry */
}
}
error=1;
break;
}
error=1;
break;
}
if (interval)
{
......@@ -301,7 +309,7 @@ int main(int argc,char *argv[])
my_free(user,MYF(MY_ALLOW_ZERO_PTR));
free_defaults(argv);
my_end(0);
exit(error);
exit(error ? 1 : 0);
return 0;
}
......@@ -383,8 +391,14 @@ static my_bool sql_connect(MYSQL *mysql,const char *host, const char *user,
}
}
/*
Execute a command.
Return 0 on ok
-1 on retryable error
1 on fatal error
*/
static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
static int execute_commands(MYSQL *mysql,int argc, char **argv)
{
char *status;
......@@ -404,7 +418,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{
my_printf_error(0,"CREATE DATABASE failed; error: '%-.200s'",
MYF(ME_BELL), mysql_error(mysql));
return 1;
return -1;
}
argc--; argv++;
break;
......@@ -417,7 +431,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
return 1;
}
if (drop_db(mysql,argv[1]))
return 1;
return -1;
argc--; argv++;
break;
}
......@@ -433,7 +447,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{
my_printf_error(0,"shutdown failed; error: '%s'",MYF(ME_BELL),
mysql_error(mysql));
return 1;
return -1;
}
mysql_close(mysql); /* Close connection to avoid error messages */
if (got_pidfile)
......@@ -450,7 +464,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{
my_printf_error(0,"reload failed; error: '%s'",MYF(ME_BELL),
mysql_error(mysql));
return 1;
return -1;
}
break;
case ADMIN_REFRESH:
......@@ -461,7 +475,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{
my_printf_error(0,"refresh failed; error: '%s'",MYF(ME_BELL),
mysql_error(mysql));
return 1;
return -1;
}
break;
case ADMIN_FLUSH_THREADS:
......@@ -469,7 +483,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{
my_printf_error(0,"refresh failed; error: '%s'",MYF(ME_BELL),
mysql_error(mysql));
return 1;
return -1;
}
break;
case ADMIN_VER:
......@@ -513,7 +527,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{
my_printf_error(0,"process list failed; error: '%s'",MYF(ME_BELL),
mysql_error(mysql));
return 1;
return -1;
}
print_header(result);
while ((row=mysql_fetch_row(result)))
......@@ -552,7 +566,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
}
argc--; argv++;
if (error)
return error;
return -1;
break;
}
case ADMIN_DEBUG:
......@@ -560,7 +574,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{
my_printf_error(0,"debug failed; error: '%s'",MYF(ME_BELL),
mysql_error(mysql));
return 1;
return -1;
}
break;
case ADMIN_VARIABLES:
......@@ -574,7 +588,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{
my_printf_error(0,"unable to show variables; error: '%s'",MYF(ME_BELL),
mysql_error(mysql));
return 1;
return -1;
}
print_header(res);
while ((row=mysql_fetch_row(res)))
......@@ -596,7 +610,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{
my_printf_error(0, "unable to show status; error: '%s'", MYF(ME_BELL),
mysql_error(mysql));
return 1;
return -1;
}
if (!opt_vertical)
print_header(res);
......@@ -646,7 +660,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{
my_printf_error(0,"refresh failed; error: '%s'",MYF(ME_BELL),
mysql_error(mysql));
return 1;
return -1;
}
break;
}
......@@ -656,7 +670,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{
my_printf_error(0,"refresh failed; error: '%s'",MYF(ME_BELL),
mysql_error(mysql));
return 1;
return -1;
}
break;
}
......@@ -666,7 +680,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{
my_printf_error(0,"refresh failed; error: '%s'",MYF(ME_BELL),
mysql_error(mysql));
return 1;
return -1;
}
break;
}
......@@ -676,7 +690,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{
my_printf_error(0,"refresh failed; error: '%s'",MYF(ME_BELL),
mysql_error(mysql));
return 1;
return -1;
}
break;
}
......@@ -684,7 +698,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{
char buff[128],crypted_pw[33];
if(argc < 2)
if (argc < 2)
{
my_printf_error(0,"Too few arguments to change password",MYF(ME_BELL));
return 1;
......@@ -699,13 +713,13 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{
my_printf_error(0, "Can't turn off logging; error: '%s'",
MYF(ME_BELL),mysql_error(mysql));
return 1;
return -1;
}
if (mysql_query(mysql,buff))
{
my_printf_error(0,"unable to change password; error: '%s'",
MYF(ME_BELL),mysql_error(mysql));
return 1;
return -1;
}
argc--; argv++;
break;
......@@ -716,7 +730,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{
my_printf_error(0, "Error starting slave: %s", MYF(ME_BELL),
mysql_error(mysql));
return 1;
return -1;
}
else
puts("Slave started");
......@@ -726,7 +740,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{
my_printf_error(0, "Error stopping slave: %s", MYF(ME_BELL),
mysql_error(mysql));
return 1;
return -1;
}
else
puts("Slave stopped");
......@@ -751,7 +765,7 @@ static my_bool execute_commands(MYSQL *mysql,int argc, char **argv)
{
my_printf_error(0,"mysqld doesn't answer to ping, error: '%s'",
MYF(ME_BELL),mysql_error(mysql));
return 1;
return -1;
}
}
mysql->reconnect=1; /* Automatic reconnect is default */
......@@ -914,7 +928,7 @@ static void print_header(MYSQL_RES *result)
putchar('|');
while ((field = mysql_fetch_field(result)))
{
printf(" %-*s|",field->max_length+1,field->name);
printf(" %-*s|",(int) field->max_length+1,field->name);
}
putchar('\n');
print_top(result);
......@@ -969,11 +983,11 @@ static void print_relative_row(MYSQL_RES *result, MYSQL_ROW cur, uint row)
mysql_field_seek(result, 0);
field = mysql_fetch_field(result);
printf("| %-*s|", field->max_length + 1, cur[0]);
printf("| %-*s|", (int) field->max_length + 1, cur[0]);
field = mysql_fetch_field(result);
tmp = cur[1] ? strtoull(cur[1], NULL, 0) : (ulonglong) 0;
printf(" %-*s|\n", field->max_length + 1,
printf(" %-*s|\n", (int) field->max_length + 1,
llstr((tmp - last_values[row]), buff));
last_values[row] = tmp;
}
......
......@@ -23,15 +23,6 @@
#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_LOCAL_FILES)
#ifndef OS2
extern "C"
{
int simple_command(MYSQL *mysql,enum enum_server_command command,
const char *arg, uint length, my_bool skipp_check);
uint net_safe_read(MYSQL* mysql);
}
#endif
char server_version[SERVER_VERSION_LENGTH];
uint32 server_id = 0;
......@@ -321,6 +312,7 @@ static void dump_remote_log_entries(const char* logname)
for(;;)
{
const char *error;
len = net_safe_read(mysql);
if (len == packet_error)
die("Error reading packet from server: %s", mysql_error(mysql));
......@@ -330,8 +322,8 @@ static void dump_remote_log_entries(const char* logname)
len, net->read_pos[5]));
Log_event * ev = Log_event::read_log_event(
(const char*) net->read_pos + 1 ,
len - 1);
if(ev)
len - 1, &error);
if (ev)
{
ev->print(result_file, short_form, last_db);
if(ev->get_type_code() == LOAD_EVENT)
......
......@@ -591,7 +591,7 @@ static int dbConnect(char *host, char *user, char *passwd)
#ifdef HAVE_OPENSSL
if (opt_use_ssl)
mysql_ssl_set(&mysql_connection, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath);
opt_ssl_capath, opt_ssl_cipher);
#endif
if (!(sock = mysql_real_connect(&mysql_connection, host, user, passwd,
NULL, opt_mysql_port, opt_mysql_unix_port, 0)))
......
This diff is collapsed.
......@@ -400,7 +400,7 @@ static MYSQL *db_connect(char *host, char *database, char *user, char *passwd)
#ifdef HAVE_OPENSSL
if (opt_use_ssl)
mysql_ssl_set(&mysql_connection, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath);
opt_ssl_capath, opt_ssl_cipher);
#endif
if (!(sock= mysql_real_connect(&mysql_connection,host,user,passwd,
database,opt_mysql_port,opt_mysql_unix_port,
......
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#define MANAGER_PWGEN_VERSION "1.0"
#include <my_global.h>
#include <m_ctype.h>
#include <my_sys.h>
#include <m_string.h>
#include <mysql_version.h>
#include <errno.h>
#include <getopt.h>
#include <md5.h>
const char* outfile=0,*user="root";
struct option long_options[] =
{
{"output-file",required_argument,0,'o'},
{"user",required_argument,0,'u'},
{"help",no_argument,0,'?'},
{"version",no_argument,0,'V'},
{0,0,0,0}
};
static void die(const char* fmt, ...)
{
va_list args;
DBUG_ENTER("die");
va_start(args, fmt);
if (fmt)
{
fprintf(stderr, "%s: ", my_progname);
vfprintf(stderr, fmt, args);
fprintf(stderr, "\n");
fflush(stderr);
}
va_end(args);
exit(1);
}
static void print_version(void)
{
printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,
MANAGER_PWGEN_VERSION,
MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
}
void usage()
{
print_version();
printf("MySQL AB, by Sasha\n");
printf("This software comes with ABSOLUTELY NO WARRANTY\n\n");
printf("Generates a password file to be used by mysqltest.\n\n");
printf("Usage: %s [OPTIONS]\n", my_progname);
printf("-?,--help Display this message and exit\n\
-V,--version Display version info\n\
-u,--user= Put given user in the password file\n\
-o,--output-file= Write the output to the file with the given name\n");
}
int parse_args(int argc, char** argv)
{
int c,option_index=0;
while ((c=getopt_long(argc,argv,"?Vu:o:",long_options,&option_index))
!= EOF)
{
switch (c)
{
case 'o':
outfile=optarg;
break;
case 'u':
user=optarg;
break;
case '?':
usage();
exit(0);
case 'V':
print_version();
exit(0);
default:
usage();
exit(1);
}
}
return 0;
}
void get_pass(char* pw, int len)
{
FILE* fp;
char* pw_end=pw+len;
/* /dev/random is more secure than rand() because the seed is easy to
predict, so we resort to rand() only if /dev/random is not available */
if ((fp=fopen("/dev/random","r")))
{
fread(pw,len,1,fp);
fclose(fp);
while (pw<pw_end)
{
*pw++='a'+((uint)*pw % 26);
}
}
else
{
srand(time(NULL));
while (pw<pw_end)
*pw++='a'+((uint)rand() % 26);
}
*pw_end=0;
}
int main(int argc, char** argv)
{
FILE* fp;
my_MD5_CTX context;
uchar digest[16];
char pw[17];
uint i;
MY_INIT(argv[0]);
parse_args(argc,argv);
if (!outfile)
die("Missing --output-file");
if (!(fp=fopen(outfile,"w")))
die("Could not open '%s'(errno=%d)",outfile,errno);
get_pass(pw,sizeof(pw)-1);
my_MD5Init(&context);
my_MD5Update(&context,pw,sizeof(pw)-1);
my_MD5Final(digest,&context);
fprintf(fp,"%s:",user);
for (i=0;i<sizeof(digest);i++)
fprintf(fp,"%02x",digest[i]);
fprintf(fp,"\n");
fclose(fp);
printf("%s\n",pw);
return 0;
}
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#define MANAGER_CLIENT_VERSION "1.0"
#include <my_global.h>
#include <my_sys.h>
#include <m_string.h>
#include <mysql.h>
#include <mysql_version.h>
#include <m_ctype.h>
#ifdef OS2
#include <config-os2.h>
#else
#include <my_config.h>
#endif
#include <my_dir.h>
#include <hash.h>
#include <mysqld_error.h>
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include <stdarg.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
#include <violite.h>
#ifndef MYSQL_MANAGER_PORT
#define MYSQL_MANAGER_PORT 23546
#endif
static void die(const char* fmt, ...);
const char* user="root",*host="localhost";
char* pass=0;
int quiet=0;
uint port=MYSQL_MANAGER_PORT;
static const char *load_default_groups[]= { "mysqlmanagerc",0 };
char** default_argv;
MYSQL_MANAGER *manager;
FILE* fp, *fp_out;
struct option long_options[] =
{
{"host",required_argument,0,'h'},
{"user",required_argument,0,'u'},
{"password",optional_argument,0,'p',},
{"port",required_argument,0,'P'},
{"help",no_argument,0,'?'},
{"version",no_argument,0,'V'},
{"quiet",no_argument,0,'q'},
{0,0,0,0}
};
static void die(const char* fmt, ...)
{
va_list args;
DBUG_ENTER("die");
va_start(args, fmt);
if (fmt)
{
fprintf(stderr, "%s: ", my_progname);
vfprintf(stderr, fmt, args);
fprintf(stderr, "\n");
fflush(stderr);
}
va_end(args);
exit(1);
}
static void print_version(void)
{
printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,
MANAGER_CLIENT_VERSION,
MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
}
void usage()
{
print_version();
printf("MySQL AB, by Sasha\n");
printf("This software comes with ABSOLUTELY NO WARRANTY\n\n");
printf("Command-line client for MySQL manager daemon.\n\n");
printf("Usage: %s [OPTIONS] < command_file\n", my_progname);
printf("\n\
-?, --help Display this help and exit.\n");
printf("\
-h, --host=... Connect to host.\n\
-u, --user=... User for login.\n\
-p[password], --password[=...]\n\
Password to use when connecting to server.\n\
-P, --port=... Port number to use for connection.\n\
-q, --quiet, --silent Suppress all normal output.\n\
-V, --version Output version information and exit.\n\
--no-defaults Don't read default options from any options file.\n\n");
}
int parse_args(int argc, char **argv)
{
int c, option_index = 0;
my_bool tty_password=0;
load_defaults("my",load_default_groups,&argc,&argv);
default_argv= argv;
while ((c = getopt_long(argc, argv, "h:p::u:P:?Vq",
long_options, &option_index)) != EOF)
{
switch (c)
{
case 'h':
host=optarg;
break;
case 'u':
user=optarg;
break;
case 'p':
if (optarg)
{
my_free(pass,MYF(MY_ALLOW_ZERO_PTR));
pass=my_strdup(optarg,MYF(MY_FAE));
while (*optarg) *optarg++= 'x'; /* Destroy argument */
}
else
tty_password=1;
break;
case 'P':
port=atoi(optarg);
break;
case 'q':
quiet=1;
break;
case 'V':
print_version();
exit(0);
case '?':
usage();
exit(0);
default:
usage();
exit(1);
}
}
return 0;
}
int main(int argc, char** argv)
{
MY_INIT(argv[0]);
fp=stdin;
fp_out=stdout;
parse_args(argc,argv);
if (!(manager=mysql_manager_init(0)))
die("Failed in mysql_manager_init()");
if (!mysql_manager_connect(manager,host,user,pass,port))
die("Could not connect to MySQL manager: %s(%d)",manager->last_error,
manager->last_errno);
for (;!feof(fp);)
{
char buf[4096];
if (!fgets(buf,sizeof(buf),fp))
break;
if (!quiet)
fprintf(fp_out,"<<%s",buf);
if (mysql_manager_command(manager,buf,strlen(buf)))
die("Error in command: %s(%d)",manager->last_error,manager->last_errno);
while (!manager->eof)
{
if (mysql_manager_fetch_line(manager,buf,sizeof(buf)))
die("Error fetching result line: %s(%d)", manager->last_error,
manager->last_errno);
if (!quiet)
fprintf(fp_out,">>%s\n",buf);
}
}
mysql_manager_close(manager);
return 0;
}
......@@ -87,7 +87,7 @@ int main(int argc, char **argv)
#ifdef HAVE_OPENSSL
if (opt_use_ssl)
mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath);
opt_ssl_capath, opt_ssl_cipher);
#endif
if (!(mysql_real_connect(&mysql,host,user,opt_password,
argv[0],opt_mysql_port,opt_mysql_unix_port,
......@@ -713,7 +713,7 @@ static void print_res_header(MYSQL_RES *result)
putchar('|');
while ((field = mysql_fetch_field(result)))
{
printf(" %-*s|",field->max_length+1,field->name);
printf(" %-*s|",(int) field->max_length+1,field->name);
}
putchar('\n');
print_res_top(result);
......
This diff is collapsed.
......@@ -10,7 +10,7 @@ AM_CONFIG_HEADER(config.h)
PROTOCOL_VERSION=10
DOT_FRM_VERSION=6
# See the libtool docs for information on how to do shared lib versions.
SHARED_LIB_VERSION=10:0:0
SHARED_LIB_VERSION=11:0:0
# Set all version vars based on $VERSION. How do we do this more elegant ?
# Remember that regexps needs to quote [ and ] since this is run through m4
......@@ -699,9 +699,9 @@ int main()
AC_MSG_RESULT($atom_ops)
AC_ARG_WITH(pstack,
[ --without-pstack Do not use the pstack backtrace library],
[USE_PSTACK=$withval],
[USE_PSTACK=yes])
[ --with-pstack Use the pstack backtrace library],
[ USE_PSTACK=$withval ],
[ USE_PSTACK=no ])
pstack_libs=
pstack_dirs=
if test "$USE_PSTACK" = yes -a "$IS_LINUX" = "true" -a "$BASE_MACHINE_TYPE" = "i386" -a "$with_mit_threads" = "no"
......@@ -717,7 +717,9 @@ dnl I have no idea if this is a good test - can not find docs for libiberty
if test x"$have_libiberty" = xyes -a x"$have_libbfd" = xyes
then
pstack_dirs='$(top_srcdir)'/pstack
pstack_libs="$pstack_dirs/libpstack.a -lbfd -liberty"
pstack_libs="../pstack/libpstack.a -lbfd -liberty"
# We must link staticly when using pstack
with_mysqld_ldflags="-all-static"
AC_SUBST([pstack_dirs])
AC_SUBST([pstack_libs])
AC_DEFINE([USE_PSTACK])
......@@ -1750,17 +1752,20 @@ AC_ARG_WITH(embedded-server,
)
AC_ARG_WITH(extra-tools,
[ --without-extra-tools Skip building utilites in the tools \
directory.],
[ --without-extra-tools Skip building utilites in the tools directory.],
[with_tools=$withval],
[with_tools=yes]
)
tools_dirs=""
if test "$with_tools" = "yes"
then
tools_dirs="tools"
else
tools_dirs=""
if test "$THREAD_SAFE_CLIENT" = "no"
then
echo "Warning: extra-tools disabled because --enable-thread-safe-client wasn't used"
else
tools_dirs="tools"
fi
fi
AC_SUBST(tools_dirs)
......@@ -2176,7 +2181,17 @@ EOF
then
sql_server_dirs="innobase $sql_server_dirs"
echo "CONFIGURING FOR INNODB"
(cd innobase && sh ./configure) \
if test ! -d "innobase"; then
# This should only happen when doing a VPATH build
echo "NOTICE: I have to make the Innobase directory: `pwd`/innobase"
mkdir "innobase" || exit 1
fi
rel_srcdir=
case "$srcdir" in
/* ) rel_srcdir="$srcdir" ;;
* ) rel_srcdir="../$srcdir" ;;
esac
(cd innobase && sh $rel_srcdir/innobase/configure) \
|| AC_MSG_ERROR([could not configure INNODB])
echo "END OF INNODB CONFIGURATION"
......
......@@ -20,16 +20,11 @@
#define RESOLVE_VERSION "2.0"
#include <my_global.h>
#include <sys/types.h>
#include <sys/socket.h>
#ifndef HAVE_BROKEN_NETINET_INCLUDES
#include <netinet/in.h>
#endif
#include <arpa/inet.h>
#include <netdb.h>
#include <m_ctype.h>
#include <my_net.h>
#include <my_sys.h>
#include <m_string.h>
#include <netdb.h>
#include <getopt.h>
#if !defined(_AIX) && !defined(HAVE_UNIXWARE7_THREADS) && !defined(HAVE_UNIXWARE7_POSIX) && !defined(h_errno)
......
......@@ -62,6 +62,7 @@ int heap_write(HP_INFO *info, const byte *record)
info->update|=HA_STATE_AKTIV;
DBUG_RETURN(0);
err:
DBUG_PRINT("info",("Duplicate key: %d",key));
info->errkey= key;
do
{
......
......@@ -16,8 +16,8 @@
# MA 02111-1307, USA
BUILT_SOURCES = mysql_version.h m_ctype.h my_config.h
pkginclude_HEADERS = dbug.h m_string.h my_sys.h mysql.h mysql_com.h \
mysqld_error.h my_list.h \
pkginclude_HEADERS = dbug.h m_string.h my_sys.h my_list.h \
mysql.h mysql_com.h mysqld_error.h mysql_embed.h \
my_pthread.h my_no_pthread.h raid.h errmsg.h \
my_global.h my_net.h \
sslopt-case.h sslopt-longopts.h sslopt-usage.h \
......@@ -28,7 +28,7 @@ noinst_HEADERS = config-win.h \
my_dir.h mysys_err.h my_base.h \
my_nosys.h my_alarm.h queues.h \
my_tree.h hash.h thr_alarm.h thr_lock.h \
getopt.h t_ctype.h violite.h \
getopt.h t_ctype.h violite.h md5.h \
mysql_version.h.in
# mysql_version.h are generated
......
......@@ -57,6 +57,8 @@ extern CHARSET_INFO *default_charset_info;
extern CHARSET_INFO *find_compiled_charset(uint cs_number);
extern CHARSET_INFO *find_compiled_charset_by_name(const char *name);
extern CHARSET_INFO compiled_charsets[];
extern uint compiled_charset_number(const char *name);
extern const char *compiled_charset_name(uint charset_number);
#define MY_CHARSET_UNDEFINED 0
#define MY_CHARSET_CURRENT (default_charset_info->number)
......
......@@ -453,8 +453,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
/* Some things that this system doesn't have */
#define ONLY_OWN_DATABASES /* We are using only databases by monty */
#define NO_PISAM /* Not needed anymore */
#define NO_MISAM /* Not needed anymore */
#define HAVE_ISAM /* TO BE DELETED */
#define NO_HASH /* Not needed anymore */
#ifdef __WIN__
#define NO_DIR_LIBRARY /* Not standar dir-library */
......@@ -654,6 +653,7 @@ typedef off_t os_off_t;
#define socket_errno WSAGetLastError()
#define SOCKET_EINTR WSAEINTR
#define SOCKET_EAGAIN WSAEINPROGRESS
#define SOCKET_EWOULDBLOCK WSAEINPROGRESS
#define SOCKET_ENFILE ENFILE
#define SOCKET_EMFILE EMFILE
#elif defined(OS2)
......@@ -965,4 +965,13 @@ typedef union {
#define statistic_add(V,C,L) (V)+=(C)
#endif
/* Macros to make switching between C and C++ mode easier */
#ifdef __cplusplus
#define C_MODE_START extern "C" {
#define C_MODE_END }
#else
#define C_MODE_START
#define C_MODE_END
#endif
#endif /* _global_h */
......@@ -15,14 +15,20 @@
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA */
/* thread safe version of some common functions */
/*
thread safe version of some common functions:
my_inet_ntoa
/* for thread safe my_inet_ntoa */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
This file is also used to make handling of sockets and ioctl()
portable accross systems.
#if !defined(MSDOS) && !defined(__WIN__) && !defined(__BEOS__)
*/
#ifndef _my_net_h
#define _my_net_h
C_MODE_START
#include <errno.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
......@@ -32,10 +38,35 @@ extern "C" {
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#endif /* !defined(MSDOS) && !defined(__WIN__) */
#ifdef HAVE_POLL
#include <sys/poll.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#if !defined(MSDOS) && !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__)
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#if !defined(alpha_linux_port)
#include <netinet/tcp.h>
#endif
#endif
#if defined(__EMX__)
#include <sys/ioctl.h>
#define ioctlsocket(A,B,C) ioctl((A),(B),(void *)(C),sizeof(*(C)))
#undef HAVE_FCNTL
#endif /* defined(__EMX__) */
#if defined(MSDOS) || defined(__WIN__)
#define O_NONBLOCK 1 /* For emulation of fcntl() */
#endif
/* Thread safe or portable version of some functions */
void my_inet_ntoa(struct in_addr in, char *buf);
#ifdef __cplusplus
}
C_MODE_END
#endif
......@@ -59,6 +59,9 @@ extern int NEAR my_errno; /* Last error in mysys */
#define MY_WME 16 /* Write message on error */
#define MY_WAIT_IF_FULL 32 /* Wait and try again if disk full error */
#define MY_RAID 64 /* Support for RAID (not the "Johnson&Johnson"-s one ;) */
#define MY_FULL_IO 512 /* For my_read - loop intil I/O
is complete
*/
#define MY_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */
#define MY_LINK_WARNING 32 /* my_redel() gives warning if links */
#define MY_COPYTIME 64 /* my_redel() copys time */
......@@ -90,6 +93,16 @@ extern int NEAR my_errno; /* Last error in mysys */
#define ME_COLOUR2 ((2 << ME_HIGHBYTE))
#define ME_COLOUR3 ((3 << ME_HIGHBYTE))
/* Bits in last argument to fn_format */
#define MY_REPLACE_DIR 1 /* replace dir in name with 'dir' */
#define MY_REPLACE_EXT 2 /* replace extension with 'ext' */
#define MY_UNPACK_FILENAME 4 /* Unpack name (~ -> home) */
#define MY_PACK_FILENAME 8 /* Pack name (home -> ~) */
#define MY_RESOLVE_SYMLINKS 16 /* Resolve all symbolic links */
#define MY_RETURN_REAL_PATH 32 /* return full path for file */
#define MY_SAFE_PATH 64 /* Return NULL if too long path */
#define MY_RELATIVE_PATH 128 /* name is relative to 'dir' */
/* My seek flags */
#define MY_SEEK_SET 0
#define MY_SEEK_CUR 1
......@@ -106,7 +119,8 @@ extern int NEAR my_errno; /* Last error in mysys */
#define MY_WAIT_FOR_USER_TO_FIX_PANIC 60 /* in seconds */
#define MY_WAIT_GIVE_USER_A_MESSAGE 10 /* Every 10 times of prev */
#define MIN_COMPRESS_LENGTH 50 /* Don't compress small bl. */
#define KEYCACHE_BLOCK_SIZE 1024
#define DEFAULT_KEYCACHE_BLOCK_SIZE 1024
#define MAX_KEYCACHE_BLOCK_SIZE 16384
/* root_alloc flags */
#define MY_KEEP_PREALLOC 1
......@@ -190,9 +204,10 @@ extern char *get_charsets_dir(char *buf);
/* statistics */
extern ulong _my_cache_w_requests,_my_cache_write,_my_cache_r_requests,
_my_cache_read;
extern ulong _my_blocks_used,_my_blocks_changed;
extern ulong _my_blocks_used,_my_blocks_changed;
extern uint key_cache_block_size;
extern ulong my_file_opened,my_stream_opened, my_tmp_file_created;
extern my_bool key_cache_inited;
extern my_bool key_cache_inited, my_init_done;
/* Point to current my_message() */
extern void (*my_sigtstp_cleanup)(void),
......@@ -467,12 +482,12 @@ extern uint dirname_part(my_string to,const char *name);
extern uint dirname_length(const char *name);
#define base_name(A) (A+dirname_length(A))
extern int test_if_hard_path(const char *dir_name);
extern char *convert_dirname(my_string name);
extern char *convert_dirname(char *to, const char *from, const char *from_end);
extern void to_unix_path(my_string name);
extern my_string fn_ext(const char *name);
extern my_string fn_same(my_string toname,const char *name,int flag);
extern my_string fn_format(my_string to,const char *name,const char *dsk,
const char *form,int flag);
extern my_string fn_format(my_string to,const char *name,const char *dir,
const char *form, uint flag);
extern size_s strlength(const char *str);
extern void pack_dirname(my_string to,const char *from);
extern uint unpack_dirname(my_string to,const char *from);
......@@ -602,6 +617,7 @@ my_bool my_compress(byte *, ulong *, ulong *);
my_bool my_uncompress(byte *, ulong *, ulong *);
byte *my_compress_alloc(const byte *packet, ulong *len, ulong *complen);
ulong checksum(const byte *mem, uint count);
uint my_bit_log2(ulong value);
#if defined(_MSC_VER) && !defined(__WIN__)
extern void sleep(int sec);
......
......@@ -46,6 +46,11 @@ extern "C" {
/* Max extra space to use when sorting keys */
#define MI_MAX_TEMP_LENGTH 256*1024L*1024L
/* Possible values for myisam_block_size (must be power of 2) */
#define MI_KEY_BLOCK_LENGTH 1024 /* default key block length */
#define MI_MIN_KEY_BLOCK_LENGTH 1024 /* Min key block length */
#define MI_MAX_KEY_BLOCK_LENGTH 16384
#define mi_portable_sizeof_char_ptr 8
typedef uint32 ha_checksum;
......@@ -192,7 +197,7 @@ extern uint myisam_block_size;
extern my_bool myisam_flush,myisam_delay_key_write,myisam_single_user;
extern my_bool myisam_concurrent_insert;
extern my_off_t myisam_max_temp_length,myisam_max_extra_temp_length;
extern uint myisam_bulk_insert_tree_size;
extern ulong myisam_bulk_insert_tree_size;
/* Prototypes for myisam-functions */
......
......@@ -34,6 +34,13 @@ extern "C" {
#define MYRG_NAME_EXT ".MRG"
/* In which table to INSERT rows */
#define MERGE_INSERT_DISABLED 0
#define MERGE_INSERT_TO_FIRST 1
#define MERGE_INSERT_TO_LAST 2
extern TYPELIB merge_insert_method;
/* Param to/from myrg_info */
typedef struct st_mymerge_info /* Struct from h_info */
......@@ -44,7 +51,7 @@ typedef struct st_mymerge_info /* Struct from h_info */
ulonglong data_file_length;
uint reclength; /* Recordlength */
int errkey; /* With key was dupplicated on err */
uint options; /* HA_OPTIONS_... used */
uint options; /* HA_OPTION_... used */
} MYMERGE_INFO;
typedef struct st_myrg_table_info
......@@ -56,6 +63,7 @@ typedef struct st_myrg_table_info
typedef struct st_myrg_info
{
MYRG_TABLE *open_tables,*current_table,*end_table,*last_used_table;
uint merge_insert_method;
ulonglong records; /* records in tables */
ulonglong del; /* Removed records */
ulonglong data_file_length;
......@@ -81,10 +89,11 @@ extern int myrg_rkey(MYRG_INFO *file,byte *buf,int inx,const byte *key,
extern int myrg_rrnd(MYRG_INFO *file,byte *buf,ulonglong pos);
extern int myrg_rsame(MYRG_INFO *file,byte *record,int inx);
extern int myrg_update(MYRG_INFO *file,const byte *old,byte *new_rec);
extern int myrg_write(MYRG_INFO *info,byte *rec);
extern int myrg_status(MYRG_INFO *file,MYMERGE_INFO *x,int flag);
extern int myrg_lock_database(MYRG_INFO *file,int lock_type);
extern int myrg_create(const char *name,const char **table_names,
my_bool fix_names);
extern int myrg_create(const char *name, const char **table_names,
uint insert_method, my_bool fix_names);
extern int myrg_extra(MYRG_INFO *file,enum ha_extra_function function);
extern ha_rows myrg_records_in_range(MYRG_INFO *info,int inx,
const byte *start_key,uint start_key_len,
......
This diff is collapsed.
......@@ -104,26 +104,31 @@ enum enum_server_command {COM_SLEEP,COM_QUIT,COM_INIT_DB,COM_QUERY,
struct st_vio; /* Only C */
typedef struct st_vio Vio;
#define MAX_BLOB_WIDTH 8192 // Default width for blob
typedef struct st_net {
Vio* vio;
unsigned char *buff,*buff_end,*write_pos,*read_pos;
my_socket fd; /* For Perl DBI/dbd */
unsigned long max_packet;
int fcntl;
unsigned char *buff,*buff_end,*write_pos,*read_pos;
unsigned int last_errno,timeout,pkt_nr,compress_pkt_nr;
char last_error[MYSQL_ERRMSG_SIZE];
unsigned int last_errno,max_packet,timeout,pkt_nr;
unsigned char error;
my_bool return_errno,compress;
my_bool no_send_ok; /* needed if we are doing several
queries in one command ( as in LOAD TABLE ... FROM MASTER ),
and do not want to confuse the client with OK at the wrong time
*/
/*
The following variable is set if we are doing several queries in one
command ( as in LOAD TABLE ... FROM MASTER ),
and do not want to confuse the client with OK at the wrong time
*/
unsigned long remain_in_buf,length, buf_length, where_b;
unsigned int *return_status;
unsigned char reading_or_writing;
char save_char;
my_bool no_send_ok;
} NET;
#define packet_error ((unsigned int) -1)
#define packet_error (~(unsigned long) 0)
enum enum_field_types { FIELD_TYPE_DECIMAL, FIELD_TYPE_TINY,
FIELD_TYPE_SHORT, FIELD_TYPE_LONG,
......@@ -165,6 +170,11 @@ int net_write_command(NET *net,unsigned char command,const char *packet,
int net_real_write(NET *net,const char *packet,unsigned long len);
unsigned long my_net_read(NET *net);
/* The following function is not meant for normal usage */
struct sockaddr;
int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen,
unsigned int timeout);
struct rand_struct {
unsigned long seed1,seed2,max_value;
double max_value_dbl;
......@@ -193,7 +203,7 @@ typedef struct st_udf_init
{
my_bool maybe_null; /* 1 if function can return NULL */
unsigned int decimals; /* for real functions */
unsigned int max_length; /* For string functions */
unsigned long max_length; /* For string functions */
char *ptr; /* free pointer for function data */
my_bool const_item; /* 0 if result is independent of arguments */
} UDF_INIT;
......
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Defines that are unique to the embedded version of MySQL */
#ifdef EMBEDDED_LIBRARY
/* Things we don't need in the embedded version of MySQL */
#undef HAVE_PSTACK /* No stacktrace */
#undef HAVE_DLOPEN /* No udf functions */
#undef HAVE_OPENSSL
#undef HAVE_VIO
#undef HAVE_ISAM
#define DONT_USE_RAID
#endif /* EMBEDDED_LIBRARY */
......@@ -221,4 +221,5 @@
#define ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT 1218
#define ER_CANT_UPDATE_WITH_READLOCK 1219
#define ER_MIXING_NOT_ALLOWED 1220
#define ER_ERROR_MESSAGES 221
#define ER_DUP_ARGUMENT 1221
#define ER_ERROR_MESSAGES 222
......@@ -39,4 +39,10 @@
my_free(opt_ssl_ca, MYF(MY_ALLOW_ZERO_PTR));
opt_ssl_ca = my_strdup(optarg, MYF(0));
break;
case OPT_SSL_CIPHER:
opt_use_ssl = 1; /* true */
my_free(opt_ssl_cipher, MYF(MY_ALLOW_ZERO_PTR));
opt_ssl_cipher = my_strdup(optarg, MYF(0));
break;
#endif
......@@ -22,10 +22,12 @@
#define OPT_SSL_CERT 202
#define OPT_SSL_CA 203
#define OPT_SSL_CAPATH 204
#define OPT_SSL_CIPHER 205
{"ssl", no_argument, 0, OPT_SSL_SSL},
{"ssl-key", required_argument, 0, OPT_SSL_KEY},
{"ssl-cert", required_argument, 0, OPT_SSL_CERT},
{"ssl-ca", required_argument, 0, OPT_SSL_CA},
{"ssl-capath", required_argument, 0, OPT_SSL_CAPATH},
{"ssl-cipher", required_argument, 0, OPT_SSL_CIPHER},
#endif /* HAVE_OPENSSL */
......@@ -21,5 +21,6 @@
--ssl-key X509 key in PEM format (implies --ssl)\n\
--ssl-cert X509 cert in PEM format (implies --ssl)\n\
--ssl-ca CA file in PEM format (check OpenSSL docs, implies --ssl)\n\
--ssl-capath CA directory (check OpenSSL docs, implies --ssl)");
--ssl-capath CA directory (check OpenSSL docs, implies --ssl)\n\
--ssl-cipher SSL cipher to use (implies --ssl)");
#endif
......@@ -21,4 +21,5 @@ static char *opt_ssl_key = 0;
static char *opt_ssl_cert = 0;
static char *opt_ssl_ca = 0;
static char *opt_ssl_capath = 0;
static char *opt_ssl_cipher = 0;
#endif
......@@ -33,67 +33,59 @@ extern "C" {
#endif /* __cplusplus */
enum enum_vio_type { VIO_CLOSED, VIO_TYPE_TCPIP, VIO_TYPE_SOCKET,
VIO_TYPE_NAMEDPIPE, VIO_TYPE_SSL};
VIO_TYPE_NAMEDPIPE, VIO_TYPE_SSL};
#ifndef __WIN__
#define HANDLE void *
#endif
Vio* vio_new(my_socket sd,
enum enum_vio_type type,
my_bool localhost);
Vio* vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost);
#ifdef __WIN__
Vio* vio_new_win32pipe(HANDLE hPipe);
Vio* vio_new_win32pipe(HANDLE hPipe);
#endif
void vio_delete(Vio* vio);
void vio_delete(Vio* vio);
#ifdef EMBEDDED_LIBRARY
void vio_reset(Vio *vio);
#else
void vio_reset(Vio* vio, enum enum_vio_type type,
my_socket sd, HANDLE hPipe,
my_bool localhost);
my_socket sd, HANDLE hPipe, my_bool localhost);
#endif
/*
* vio_read and vio_write should have the same semantics
* as read(2) and write(2).
*/
int vio_read( Vio* vio,
gptr buf, int size);
int vio_write( Vio* vio,
const gptr buf,
int size);
int vio_read(Vio *vio, gptr buf, int size);
int vio_write(Vio *vio, const gptr buf, int size);
/*
* Whenever the socket is set to blocking mode or not.
*/
int vio_blocking( Vio* vio,
my_bool onoff);
my_bool vio_is_blocking( Vio* vio);
int vio_blocking(Vio *vio, my_bool onoff);
my_bool vio_is_blocking(Vio *vio);
/*
* setsockopt TCP_NODELAY at IPPROTO_TCP level, when possible.
*/
int vio_fastsend( Vio* vio);
int vio_fastsend(Vio *vio);
/*
* setsockopt SO_KEEPALIVE at SOL_SOCKET level, when possible.
*/
int vio_keepalive( Vio* vio,
my_bool onoff);
int vio_keepalive(Vio *vio, my_bool onoff);
/*
* Whenever we should retry the last read/write operation.
*/
my_bool vio_should_retry( Vio* vio);
my_bool vio_should_retry(Vio *vio);
/*
* When the workday is over...
*/
int vio_close(Vio* vio);
int vio_close(Vio* vio);
/*
* Short text description of the socket for those, who are curious..
*/
const char* vio_description( Vio* vio);
const char* vio_description(Vio *vio);
/* Return the type of the connection */
enum enum_vio_type vio_type(Vio* vio);
enum enum_vio_type vio_type(Vio* vio);
/* Return last error number */
int vio_errno(Vio*vio);
......@@ -116,9 +108,8 @@ my_bool vio_poll_read(Vio *vio,uint timeout);
#ifdef __cplusplus
}
#endif
#endif /* vio_violite_h_ */
#ifdef HAVE_VIO
#ifndef DONT_MAP_VIO
#if defined(HAVE_VIO) && !defined(DONT_MAP_VIO)
#define vio_delete(vio) (vio)->viodelete(vio)
#define vio_errno(vio) (vio)->vioerrno(vio)
#define vio_read(vio, buf, size) (vio)->read(vio,buf,size)
......@@ -132,9 +123,7 @@ my_bool vio_poll_read(Vio *vio,uint timeout);
#define vio_peer_addr(vio, buf) (vio)->peer_addr(vio, buf)
#define vio_in_addr(vio, in) (vio)->in_addr(vio, in)
#define vio_poll_read(vio,timeout) (vio)->poll_read(vio,timeout)
#endif /* !DONT_MAP_VIO */
#endif /* HAVE_VIO */
#endif /* defined(HAVE_VIO) && !defined(DONT_MAP_VIO) */
#ifdef HAVE_OPENSSL
#define HEADER_DES_LOCL_H dummy_something
......@@ -142,17 +131,16 @@ my_bool vio_poll_read(Vio *vio,uint timeout);
#include <openssl/err.h>
#include "my_net.h" /* needed because of struct in_addr */
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
void vio_ssl_delete(Vio* vio);
void vio_ssl_delete(Vio* vio);
int vio_ssl_read(Vio* vio,gptr buf, int size);
int vio_ssl_write(Vio* vio,const gptr buf,int size);
int vio_ssl_blocking(Vio* vio,my_bool onoff);
my_bool vio_ssl_is_blocking(Vio* vio);
int vio_ssl_read(Vio* vio,gptr buf, int size);
int vio_ssl_write(Vio* vio,const gptr buf,int size);
int vio_ssl_blocking(Vio* vio,my_bool onoff);
my_bool vio_ssl_is_blocking(Vio* vio);
/* setsockopt TCP_NODELAY at IPPROTO_TCP level, when possible. */
int vio_ssl_fastsend(Vio* vio);
......@@ -170,8 +158,6 @@ void vio_ssl_in_addr(Vio *vio, struct in_addr *in);
/* Return 1 if there is data to be read */
my_bool vio_ssl_poll_read(Vio *vio,uint timeout);
#ifdef HAVE_OPENSSL
/* Single copy for server */
struct st_VioSSLAcceptorFd
{
......@@ -182,9 +168,6 @@ struct st_VioSSLAcceptorFd
state_connect = 1,
state_accept = 2
};
// BIO* bio_;
// char desc_[100];
// Vio* sd_;
/* function pointers which are only once for SSL server
Vio*(*sslaccept)(struct st_VioSSLAcceptorFd*,Vio*); */
......@@ -197,24 +180,27 @@ struct st_VioSSLConnectorFd
SSL_METHOD* ssl_method_;
/* function pointers which are only once for SSL client */
};
void sslaccept(struct st_VioSSLAcceptorFd*, Vio*);
void sslconnect(struct st_VioSSLConnectorFd*, Vio*);
void sslaccept(struct st_VioSSLAcceptorFd*, Vio*, long timeout);
void sslconnect(struct st_VioSSLConnectorFd*, Vio*, long timeout);
#else /* HAVE_OPENSSL */
/* This dummy is required to maintain proper size of st_mysql in mysql.h */
struct st_VioSSLConnectorFd {};
#endif /* HAVE_OPENSSL */
struct st_VioSSLConnectorFd *new_VioSSLConnectorFd(
const char* key_file,const char* cert_file,const char* ca_file,const char* ca_path);
struct st_VioSSLAcceptorFd *new_VioSSLAcceptorFd(
const char* key_file,const char* cert_file,const char* ca_file,const char* ca_path);
struct st_VioSSLConnectorFd
*new_VioSSLConnectorFd(const char* key_file, const char* cert_file,
const char* ca_file, const char* ca_path,
const char* cipher);
struct st_VioSSLAcceptorFd
*new_VioSSLAcceptorFd(const char* key_file, const char* cert_file,
const char* ca_file,const char* ca_path,
const char* cipher);
Vio* new_VioSSL(struct st_VioSSLAcceptorFd* fd, Vio* sd,int state);
#ifdef __cplusplus
}
#endif
#endif /* HAVE_OPENSSL */
/* This enumerator is used in parser - should be always visible */
enum SSL_type {SSL_TYPE_NONE, SSL_TYPE_ANY, SSL_TYPE_X509, SSL_TYPE_SPECIFIED};
#ifndef EMBEDDED_LIBRARY
/* This structure is for every connection on both sides */
struct st_vio
......@@ -229,27 +215,25 @@ struct st_vio
char desc[30]; /* String description */
#ifdef HAVE_VIO
/* function pointers. They are similar for socket/SSL/whatever */
void (*viodelete)(Vio*);
int(*vioerrno)(Vio*);
int(*read)(Vio*, gptr, int);
int(*write)(Vio*, gptr, int);
int(*vioblocking)(Vio*, my_bool);
my_bool(*is_blocking)(Vio*);
int(*viokeepalive)(Vio*, my_bool);
int(*fastsend)(Vio*);
my_bool(*peer_addr)(Vio*, gptr);
void(*in_addr)(Vio*, struct in_addr*);
my_bool(*should_retry)(Vio*);
int(*vioclose)(Vio*);
my_bool(*poll_read)(Vio*,uint);
void (*viodelete)(Vio*);
int (*vioerrno)(Vio*);
int (*read)(Vio*, gptr, int);
int (*write)(Vio*, gptr, int);
int (*vioblocking)(Vio*, my_bool);
my_bool (*is_blocking)(Vio*);
int (*viokeepalive)(Vio*, my_bool);
int (*fastsend)(Vio*);
my_bool (*peer_addr)(Vio*, gptr);
void (*in_addr)(Vio*, struct in_addr*);
my_bool (*should_retry)(Vio*);
int (*vioclose)(Vio*);
my_bool (*poll_read)(Vio*,uint);
#ifdef HAVE_OPENSSL
BIO* bio_;
SSL* ssl_;
my_bool open_;
char *ssl_cip_;
#endif /* HAVE_OPENSSL */
#endif /* HAVE_VIO */
};
#endif /* EMBEDDED_LIBRARY */
#endif /* vio_violite_h_ */
......@@ -55,5 +55,7 @@ noinst_HEADERS = btr0btr.h btr0btr.ic btr0cur.h btr0cur.ic \
ut0dbg.h ut0lst.h ut0mem.h ut0mem.ic ut0rnd.h ut0rnd.ic \
ut0sort.h ut0ut.h ut0ut.ic
EXTRA_DIST = Makefile.i
# Don't update the files from bitkeeper
%::SCCS/s.%
......@@ -2,7 +2,7 @@
libsdir = ../libs
INCLUDES = -I../../include -I../include
INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../../include -I../../include
# Don't update the files from bitkeeper
%::SCCS/s.%
......@@ -170,7 +170,9 @@ mem_heap_alloc(
buf = (byte*)buf + MEM_FIELD_HEADER_SIZE;
#endif
#ifdef UNIV_SET_MEM_TO_ZERO
memset(buf, '\0', n);
#endif
return(buf);
}
......@@ -494,8 +496,14 @@ mem_alloc_func(
)
{
#ifndef UNIV_MEM_DEBUG
void* buf;
buf = mem_area_alloc(n, mem_comm_pool);
return(mem_area_alloc(n, mem_comm_pool));
#ifdef UNIV_SET_MEM_TO_ZERO
memset(buf, '\0', n);
#endif
return(buf);
#else
......
......@@ -160,6 +160,7 @@ os_fast_mutex_trylock(
was reserved by another
thread */
os_fast_mutex_t* fast_mutex); /* in: mutex to acquire */
#endif
/**************************************************************
Releases ownership of a fast mutex. */
UNIV_INLINE
......@@ -188,7 +189,6 @@ void
os_fast_mutex_free(
/*===============*/
os_fast_mutex_t* fast_mutex); /* in: mutex to free */
#endif
#ifndef UNIV_NONINL
#include "os0sync.ic"
......
......@@ -38,6 +38,7 @@ os_fast_mutex_trylock(
return((ulint) pthread_mutex_trylock(fast_mutex));
#endif
}
#endif
/**************************************************************
Releases ownership of a fast mutex. */
......@@ -53,4 +54,3 @@ os_fast_mutex_unlock(
pthread_mutex_unlock(fast_mutex);
#endif
}
#endif
......@@ -70,6 +70,7 @@ extern ulint srv_n_rows_read;
extern ibool srv_print_innodb_monitor;
extern ibool srv_print_innodb_lock_monitor;
extern ibool srv_print_innodb_tablespace_monitor;
extern ibool srv_print_verbose_log;
extern ulint srv_n_spin_wait_rounds;
extern ulint srv_spin_wait_delay;
......
......@@ -61,8 +61,12 @@ subdirectory of 'mysql'. */
/* DEBUG VERSION CONTROL
===================== */
/* The following flag will make InnoDB to initialize
all memory it allocates to zero. It hides Purify
warnings about reading unallocated memory unless
memory is read outside the allocated blocks. */
/*
#define UNIV_SYNC_DEBUG
#define UNIV_INIT_MEM_TO_ZERO
*/
/* Make a non-inline debug version */
......@@ -72,7 +76,7 @@ subdirectory of 'mysql'. */
#define UNIV_SEARCH_DEBUG
#define UNIV_IBUF_DEBUG
#define UNIV_SYNC_DEBUG
#define UNIV_SYNC_PERF_STAT
#define UNIV_SEARCH_PERF_STAT
*/
......
......@@ -26,12 +26,39 @@ int
ut_memcmp(void* str1, void* str2, ulint n);
/**************************************************************************
Allocates memory. Sets it also to zero if UNIV_SET_MEM_TO_ZERO is
defined and set_to_zero is TRUE. */
void*
ut_malloc(ulint n);
ut_malloc_low(
/*==========*/
/* out, own: allocated memory */
ulint n, /* in: number of bytes to allocate */
ibool set_to_zero); /* in: TRUE if allocated memory should be set
to zero if UNIV_SET_MEM_TO_ZERO is defined */
/**************************************************************************
Allocates memory. Sets it also to zero if UNIV_SET_MEM_TO_ZERO is
defined. */
void*
ut_malloc(
/*======*/
/* out, own: allocated memory */
ulint n); /* in: number of bytes to allocate */
/**************************************************************************
Frees a memory bloock allocated with ut_malloc. */
void
ut_free(
/*====*/
void* ptr); /* in, own: memory block */
/**************************************************************************
Frees all allocated memory not freed yet. */
UNIV_INLINE
void
ut_free(void* ptr);
ut_free_all_mem(void);
/*=================*/
UNIV_INLINE
char*
......
......@@ -27,13 +27,6 @@ ut_memcmp(void* str1, void* str2, ulint n)
return(memcmp(str1, str2, n));
}
UNIV_INLINE
void
ut_free(void* ptr)
{
free(ptr);
}
UNIV_INLINE
char*
ut_strcpy(char* dest, char* sour)
......
......@@ -2641,9 +2641,11 @@ logs_empty_and_mark_files_at_shutdown(void)
dulint lsn;
ulint arch_log_no;
ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB: Starting shutdown...\n");
if (srv_print_verbose_log)
{
ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB: Starting shutdown...\n");
}
/* Wait until the master thread and all other operations are idle: our
algorithm only works if the server is idle at shutdown */
loop:
......@@ -2732,8 +2734,11 @@ loop:
fil_flush_file_spaces(FIL_TABLESPACE);
ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB: Shutdown completed\n");
if (srv_print_verbose_log)
{
ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB: Shutdown completed\n");
}
}
/**********************************************************
......
......@@ -170,7 +170,11 @@ mem_pool_create(
pool = ut_malloc(sizeof(mem_pool_t));
pool->buf = ut_malloc(size);
/* We do not set the memory to zero (FALSE) in the pool,
but only when allocated at a higher level in mem0mem.c.
This is to avoid masking useful Purify warnings. */
pool->buf = ut_malloc_low(size, FALSE);
pool->size = size;
mutex_create(&(pool->mutex));
......
......@@ -422,7 +422,6 @@ os_mutex_free(
#endif
}
#ifndef _WIN32
/*************************************************************
Initializes an operating system fast mutex semaphore. */
......@@ -472,4 +471,3 @@ os_fast_mutex_free(
#endif
}
#endif
......@@ -120,6 +120,12 @@ ibool srv_print_innodb_monitor = FALSE;
ibool srv_print_innodb_lock_monitor = FALSE;
ibool srv_print_innodb_tablespace_monitor = FALSE;
/*
Set the following to 0 if you want InnoDB to write messages on
stderr on startup/shutdown
*/
ibool srv_print_verbose_log = TRUE;
/* The parameters below are obsolete: */
ibool srv_print_parsed_sql = FALSE;
......
......@@ -888,9 +888,11 @@ innobase_start_or_create_for_mysql(void)
/* buf_debug_prints = TRUE; */
ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB: Started\n");
if (srv_print_verbose_log)
{
ut_print_timestamp(stderr);
fprintf(stderr, " InnoDB: Started\n");
}
return((int) DB_SUCCESS);
}
......@@ -916,5 +918,7 @@ innobase_shutdown_for_mysql(void)
logs_empty_and_mark_files_at_shutdown();
ut_free_all_mem();
return((int) DB_SUCCESS);
}
......@@ -14,30 +14,136 @@ Created 5/11/1994 Heikki Tuuri
#include "mem0mem.h"
/* This struct is placed first in every allocated memory block */
typedef struct ut_mem_block_struct ut_mem_block_t;
struct ut_mem_block_struct{
UT_LIST_NODE_T(ut_mem_block_t) mem_block_list;/* mem block list node */
};
/* List of all memory blocks allocated from the operating system
with malloc */
UT_LIST_BASE_NODE_T(ut_mem_block_t) ut_mem_block_list;
os_fast_mutex_t ut_list_mutex; /* this protects the list */
ibool ut_mem_block_list_inited = FALSE;
/**************************************************************************
Initializes the mem block list at database startup. */
static
void
ut_mem_block_list_init(void)
/*========================*/
{
os_fast_mutex_init(&ut_list_mutex);
UT_LIST_INIT(ut_mem_block_list);
ut_mem_block_list_inited = TRUE;
}
/**************************************************************************
Allocates memory. Sets it also to zero if UNIV_SET_MEM_TO_ZERO is
defined and set_to_zero is TRUE. */
void*
ut_malloc(ulint n)
ut_malloc_low(
/*==========*/
/* out, own: allocated memory */
ulint n, /* in: number of bytes to allocate */
ibool set_to_zero) /* in: TRUE if allocated memory should be set
to zero if UNIV_SET_MEM_TO_ZERO is defined */
{
void* ret;
/*
ret = VirtualAlloc(NULL, n, MEM_COMMIT, PAGE_READWRITE);
*/
ret = malloc(n);
ut_ad((sizeof(ut_mem_block_t) % 8) == 0); /* check alignment ok */
if (!ut_mem_block_list_inited) {
ut_mem_block_list_init();
}
os_fast_mutex_lock(&ut_list_mutex);
ret = malloc(n + sizeof(ut_mem_block_t));
if (ret == NULL) {
fprintf(stderr,
"Innobase: Fatal error: cannot allocate memory!\n");
fprintf(stderr,
"Innobase: Cannot continue operation!\n");
fprintf(stderr,
"Innobase: Check if you can increase the swap file of your\n");
fprintf(stderr,
"Innobase: operating system.\n");
"InnoDB: Fatal error: cannot allocate %lu bytes of\n"
"InnoDB: memory with malloc!\n"
"InnoDB: Operating system errno: %lu\n"
"InnoDB: Cannot continue operation!\n"
"InnoDB: Check if you should increase the swap file or\n"
"InnoDB: ulimits of your operating system.\n", n, errno);
os_fast_mutex_unlock(&ut_list_mutex);
exit(1);
}
return(ret);
if (set_to_zero) {
#ifdef UNIV_SET_MEM_TO_ZERO
memset(ret, '\0', n + sizeof(ut_mem_block_t));
#endif
}
UT_LIST_ADD_FIRST(mem_block_list, ut_mem_block_list,
((ut_mem_block_t*)ret));
os_fast_mutex_unlock(&ut_list_mutex);
return((void*)((byte*)ret + sizeof(ut_mem_block_t)));
}
/**************************************************************************
Allocates memory. Sets it also to zero if UNIV_SET_MEM_TO_ZERO is
defined. */
void*
ut_malloc(
/*======*/
/* out, own: allocated memory */
ulint n) /* in: number of bytes to allocate */
{
return(ut_malloc_low(n, TRUE));
}
/**************************************************************************
Frees a memory bloock allocated with ut_malloc. */
void
ut_free(
/*====*/
void* ptr) /* in, own: memory block */
{
ut_mem_block_t* block;
block = (ut_mem_block_t*)((byte*)ptr - sizeof(ut_mem_block_t));
os_fast_mutex_lock(&ut_list_mutex);
UT_LIST_REMOVE(mem_block_list, ut_mem_block_list, block);
free(block);
os_fast_mutex_unlock(&ut_list_mutex);
}
/**************************************************************************
Frees all allocated memory not freed yet. */
void
ut_free_all_mem(void)
/*=================*/
{
ut_mem_block_t* block;
os_fast_mutex_lock(&ut_list_mutex);
while (block = UT_LIST_GET_FIRST(ut_mem_block_list)) {
UT_LIST_REMOVE(mem_block_list, ut_mem_block_list, block);
free(block);
}
os_fast_mutex_unlock(&ut_list_mutex);
}
/**************************************************************************
......
......@@ -400,11 +400,7 @@ static int examine_log(my_string file_name, char **table_names)
}
to=isam_file_name;
if (filepath)
{
strmov(isam_file_name,filepath);
convert_dirname(isam_file_name);
to=strend(isam_file_name);
}
to=convert_dirname(isam_file_name, filepath, NullS);
strmov(to,pos);
fn_ext(isam_file_name)[0]=0; /* Remove extension */
}
......
......@@ -71,11 +71,11 @@ link_sources:
# keep only the stubs for safemalloc.c and debug.c
#
# A list of needed headers collected from the deps information 000213
nh = global.h config-win32.h dbug.h errmsg.h global.h \
nh = my_global.h config-win32.h dbug.h errmsg.h \
m_ctype.h m_string.h \
my_alarm.h my_config.h my_dir.h my_list.h my_net.h my_sys.h \
mysql.h mysql_com.h mysql_version.h mysqld_error.h mysys_err.h \
my_pthread.h thr_alarm.h violite.h hash.h
mysql.h mysql_com.h mysql_version.h mysqld_error.h \
mysys_err.h my_pthread.h thr_alarm.h violite.h hash.h
# Get a list of the needed objects
lobjs = $(mysysobjects1) $(dbugobjects) $(mystringsobjects)
......
......@@ -31,7 +31,7 @@ noinst_PROGRAMS = conf_to_src
CHARSET_OBJS=@CHARSET_OBJS@
LTCHARSET_OBJS= ${CHARSET_OBJS:.o=.lo}
target_sources = libmysql.c net.c password.c \
target_sources = libmysql.c net.c password.c manager.c \
get_password.c errmsg.c
mystringsobjects = strmov.lo strxmov.lo strnmov.lo strmake.lo strend.lo \
......@@ -56,7 +56,7 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \
thr_mutex.lo mulalloc.lo string.lo default.lo \
my_compress.lo array.lo my_once.lo list.lo my_net.lo \
charset.lo hash.lo mf_iocache.lo my_seek.lo \
my_pread.lo mf_cache.lo my_vsnprintf.lo
my_pread.lo mf_cache.lo my_vsnprintf.lo md5.lo
# Not needed in the minimum library
mysysobjects2 = getopt.lo getopt1.lo getvar.lo my_lib.lo
......
This diff is collapsed.
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA */
#include <my_global.h>
#if defined(__WIN__) || defined(_WIN32) || defined(_WIN64)
#include <winsock.h>
#include <odbcinst.h>
#endif
#include <my_sys.h>
#include <mysys_err.h>
#include <m_string.h>
#include <m_ctype.h>
#include "mysql.h"
#include "mysql_version.h"
#include "mysqld_error.h"
#include "errmsg.h"
#include <violite.h>
#include <sys/stat.h>
#include <signal.h>
#include <time.h>
#include <errno.h>
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
#if !defined(MSDOS) && !defined(__WIN__)
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#ifdef HAVE_SELECT_H
# include <select.h>
#endif
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#endif
#ifdef HAVE_SYS_UN_H
# include <sys/un.h>
#endif
#if defined(THREAD) && !defined(__WIN__)
#include <my_pthread.h> /* because of signal() */
#endif
#ifndef INADDR_NONE
#define INADDR_NONE -1
#endif
#define RES_BUF_SHIFT 5
#define SOCKET_ERROR -1
#define NET_BUF_SIZE 2048
MYSQL_MANAGER* STDCALL mysql_manager_init(MYSQL_MANAGER* con)
{
int net_buf_size=NET_BUF_SIZE;
if (!con)
{
if (!(con=(MYSQL_MANAGER*)my_malloc(sizeof(*con)+net_buf_size,
MYF(MY_WME|MY_ZEROFILL))))
return 0;
con->free_me=1;
con->net_buf=(char*)con+sizeof(*con);
}
else
{
bzero((char*)con,sizeof(*con));
if (!(con->net_buf=my_malloc(net_buf_size,MYF(0))))
return 0;
}
con->net_buf_pos=con->net_data_end=con->net_buf;
con->net_buf_size=net_buf_size;
return con;
}
MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con,
const char* host,
const char* user,
const char* passwd,
unsigned int port)
{
my_socket sock;
struct sockaddr_in sock_addr;
uint32 ip_addr;
char msg_buf[MAX_MYSQL_MANAGER_MSG];
int msg_len;
if (!host)
host="localhost";
if (!user)
user="root";
if (!passwd)
passwd="";
if ((sock=(my_socket)socket(AF_INET,SOCK_STREAM,0)) == SOCKET_ERROR)
{
con->last_errno=errno;
strmov(con->last_error,"Cannot create socket");
goto err;
}
if (!(con->vio=vio_new(sock,VIO_TYPE_TCPIP,FALSE)))
{
con->last_errno=ENOMEM;
strmov(con->last_error,"Cannot create network I/O object");
goto err;
}
vio_blocking(con->vio,TRUE);
bzero((char*) &sock_addr,sizeof(sock_addr));
sock_addr.sin_family = AF_INET;
if ((int) (ip_addr = inet_addr(host)) != (int) INADDR_NONE)
{
memcpy_fixed(&sock_addr.sin_addr,&ip_addr,sizeof(ip_addr));
}
else
#if defined(HAVE_GETHOSTBYNAME_R) && defined(_REENTRANT) && defined(THREAD)
{
int tmp_errno;
struct hostent tmp_hostent,*hp;
char buff2[GETHOSTBYNAME_BUFF_SIZE];
hp = my_gethostbyname_r(host,&tmp_hostent,buff2,sizeof(buff2),
&tmp_errno);
if (!hp)
{
con->last_errno=tmp_errno;
sprintf(con->last_error,"Could not resolve host '%s'",host);
goto err;
}
memcpy(&sock_addr.sin_addr,hp->h_addr, (size_t) hp->h_length);
}
#else
{
struct hostent *hp;
if (!(hp=gethostbyname(host)))
{
con->last_errno=socket_errno;
sprintf(con->last_error, "Could not resolve host '%s'", host);
goto err;
}
memcpy(&sock_addr.sin_addr,hp->h_addr, (size_t) hp->h_length);
}
#endif
sock_addr.sin_port = (ushort) htons((ushort) port);
if (my_connect(sock,(struct sockaddr *) &sock_addr, sizeof(sock_addr),
0) <0)
{
con->last_errno=errno;
sprintf(con->last_error ,"Could not connect to %-.64s", host);
goto err;
}
/* read the greating */
if (vio_read(con->vio,msg_buf,MAX_MYSQL_MANAGER_MSG)<=0)
{
con->last_errno=errno;
strmov(con->last_error,"Read error on socket");
goto err;
}
sprintf(msg_buf,"%-.16s %-.16s\n",user,passwd);
msg_len=strlen(msg_buf);
if (vio_write(con->vio,msg_buf,msg_len)!=msg_len)
{
con->last_errno=errno;
strmov(con->last_error,"Write error on socket");
goto err;
}
if (vio_read(con->vio,msg_buf,MAX_MYSQL_MANAGER_MSG)<=0)
{
con->last_errno=errno;
strmov(con->last_error,"Read error on socket");
goto err;
}
if ((con->cmd_status=atoi(msg_buf)) != MANAGER_OK)
{
strmov(con->last_error,"Access denied");
goto err;
}
if (!my_multi_malloc(MYF(0), &con->host, (uint)strlen(host)+1,
&con->user, (uint)strlen(user)+1,
&con->passwd, (uint)strlen(passwd)+1,
NullS))
{
con->last_errno=ENOMEM;
strmov(con->last_error,"Out of memory");
goto err;
}
strmov(con->host,host);
strmov(con->user,user);
strmov(con->passwd,passwd);
return con;
err:
{
my_bool free_me=con->free_me;
con->free_me=0;
mysql_manager_close(con);
con->free_me=free_me;
}
return 0;
}
void STDCALL mysql_manager_close(MYSQL_MANAGER* con)
{
my_free((gptr)con->host,MYF(MY_ALLOW_ZERO_PTR));
/* no need to free con->user and con->passwd, because they were
allocated in my_multimalloc() along with con->host, freeing
con->hosts frees the whole block
*/
if (con->vio)
{
vio_delete(con->vio);
con->vio=0;
}
if (con->free_me)
my_free((gptr)con,MYF(0));
}
int STDCALL mysql_manager_command(MYSQL_MANAGER* con,const char* cmd,
int cmd_len)
{
if (!cmd_len)
cmd_len=strlen(cmd);
if (vio_write(con->vio,(char*)cmd,cmd_len) != cmd_len)
{
con->last_errno=errno;
strmov(con->last_error,"Write error on socket");
return 1;
}
con->eof=0;
return 0;
}
int STDCALL mysql_manager_fetch_line(MYSQL_MANAGER* con, char* res_buf,
int res_buf_size)
{
char* res_buf_end=res_buf+res_buf_size;
char* net_buf_pos=con->net_buf_pos, *net_buf_end=con->net_data_end;
int res_buf_shift=RES_BUF_SHIFT;
int done=0;
if (res_buf_size<RES_BUF_SHIFT)
{
con->last_errno=ENOMEM;
strmov(con->last_error,"Result buffer too small");
return 1;
}
for (;;)
{
for (;net_buf_pos<net_buf_end && res_buf<res_buf_end;
net_buf_pos++,res_buf++)
{
char c=*net_buf_pos;
if (c == '\r')
c=*++net_buf_pos;
if (c == '\n')
{
*res_buf=0;
net_buf_pos++;
done=1;
break;
}
else
*res_buf=*net_buf_pos;
}
if (done || res_buf==res_buf_end)
break;
if (net_buf_pos == net_buf_end && res_buf<res_buf_end)
{
int num_bytes;
if ((num_bytes=vio_read(con->vio,con->net_buf,con->net_buf_size))<=0)
{
con->last_errno=errno;
strmov(con->last_error,"socket read failed");
return 1;
}
net_buf_pos=con->net_buf;
net_buf_end=net_buf_pos+num_bytes;
}
}
con->net_buf_pos=net_buf_pos;
con->net_data_end=net_buf_end;
res_buf=res_buf_end-res_buf_size;
if ((con->eof=(res_buf[3]==' ')))
res_buf_shift--;
res_buf_end-=res_buf_shift;
for (;res_buf<res_buf_end;res_buf++)
{
if(!(*res_buf=res_buf[res_buf_shift]))
break;
}
return 0;
}
This diff is collapsed.
This diff is collapsed.
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Prototypes for the embedded version of MySQL */
#include <my_global.h>
#include <mysql_embed.h>
#include <mysql.h>
#include <mysql_version.h>
#include <mysqld_error.h>
#include <my_pthread.h>
C_MODE_START
extern void start_embedded_connection(NET * net);
extern void end_embedded_connection(NET * net);
extern void lib_connection_phase(NET *net, int phase);
extern bool lib_dispatch_command(enum enum_server_command command, NET *net,
const char *arg, ulong length);
C_MODE_END
......@@ -7,26 +7,15 @@ link_sources:
@LN_CP_F@ $(srcdir)/../../client/$$f $(srcdir)/$$f; \
done;
DEFS = -DEMBEDDED_SERVER
DEFS = -DEMBEDDED_LIBRARY
INCLUDES = -I$(top_srcdir)/include $(openssl_includes) \
-I$(srcdir) -I$(top_srcdir) -I$(top_srcdir)/client
LIBS = @LIBS@
LDADD = $(top_builddir)/libmysqld/libmysqld.la \
$(top_builddir)/isam/libnisam.a \
$(top_builddir)/myisam/libmyisam.a \
$(top_builddir)/heap/libheap.a \
$(top_builddir)/merge/libmerge.a \
$(top_builddir)/myisammrg/libmyisammrg.a \
@innodb_libs@ @bdb_libs@ @pstack_libs@ \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/strings/libmystrings.a \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/regex/libregex.a @LIBDL@
LIBS = @LIBS@
LDADD = ../libmysqld.a @innodb_system_libs@ @LIBDL@
mysqltest_DEPENDENCIES = ../libmysqld.la
mysqltest_SOURCES = mysqltest.c
mysql_SOURCES = mysql.cc readline.cc sql_string.cc completion_hash.cc \
mysql_SOURCES = mysql.cc readline.cc completion_hash.cc \
my_readline.h sql_string.h completion_hash.h
mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -16,10 +16,10 @@
INCLUDES = @MT_INCLUDES@ -I$(srcdir)/../include -I../include
pkglib_LIBRARIES = libmerge.a
noinst_HEADERS = mrgdef.h
libmerge_a_SOURCES = open.c extra.c info.c _locking.c \
rrnd.c update.c delete.c rsame.c panic.c \
close.c create.c static.c
noinst_HEADERS = mrg_def.h
libmerge_a_SOURCES = mrg_open.c mrg_extra.c mrg_info.c mrg_locking.c \
mrg_rrnd.c mrg_update.c mrg_delete.c mrg_rsame.c \
mrg_panic.c mrg_close.c mrg_create.c mrg_static.c
OMIT_DEPENDENCIES = pthread.h stdio.h __stdio.h stdlib.h __stdlib.h math.h\
__math.h time.h __time.h unistd.h __unistd.h types.h \
......
......@@ -16,7 +16,7 @@
/* close a isam-database */
#include "mrgdef.h"
#include "mrg_def.h"
int mrg_close(register MRG_INFO *info)
{
......
......@@ -16,7 +16,7 @@
/* Create a MERGE-file */
#include "mrgdef.h"
#include "mrg_def.h"
/* create file named 'name' and save filenames in it
table_names should be NULL or a vector of string-pointers with
......
......@@ -16,7 +16,7 @@
/* Delete last read record */
#include "mrgdef.h"
#include "mrg_def.h"
int mrg_delete(MRG_INFO *info,const byte *record)
{
......
......@@ -20,7 +20,7 @@
record-cache-flags are set in mrg_rrnd when we are changing database.
*/
#include "mrgdef.h"
#include "mrg_def.h"
int mrg_extra(
MRG_INFO *info,
......
......@@ -14,7 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "mrgdef.h"
#include "mrg_def.h"
ulong mrg_position(MRG_INFO *info)
{
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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