summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <SergeyV@selena.>2006-01-20 18:40:02 +0300
committerunknown <SergeyV@selena.>2006-01-20 18:40:02 +0300
commit61946d225a0d8a7e941bc00395391ef9b9f47efe (patch)
tree5c8dacf57abe3abd01d2b44332a2e9efebc3c562
parentb045ee329765231d8fcfc722fc87d2cc18f6643b (diff)
parent94ea98832aeff8854090ddb6d64886b648ddccc7 (diff)
downloadmariadb-git-61946d225a0d8a7e941bc00395391ef9b9f47efe.tar.gz
Merge svlasenko@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into selena.:H:/MYSQL/src/#00000-mysql-5.1 client/mysqlslap.c: Auto merged configure.in: Auto merged VC++Files/mysql.sln: manual merge
-rw-r--r--VC++Files/client/mysqlslap.vcproj7
-rw-r--r--VC++Files/mysql.sln40
-rw-r--r--client/Makefile.am2
-rw-r--r--client/mysqlslap.c35
-rw-r--r--configure.in5
5 files changed, 82 insertions, 7 deletions
diff --git a/VC++Files/client/mysqlslap.vcproj b/VC++Files/client/mysqlslap.vcproj
index 0f0f2f7db45..581a852b170 100644
--- a/VC++Files/client/mysqlslap.vcproj
+++ b/VC++Files/client/mysqlslap.vcproj
@@ -3,6 +3,7 @@
ProjectType="Visual C++"
Version="7.10"
Name="mysqlslap"
+ ProjectGUID="{2E9332CF-072A-4381-BF37-17C5AB4F8583}"
SccProjectName=""
SccLocalPath="">
<Platforms>
@@ -39,7 +40,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="wsock32.lib odbc32.lib odbccp32.lib"
+ AdditionalDependencies="wsock32.lib odbc32.lib odbccp32.lib mysqlclient.lib mysys.lib"
OutputFile="../client_release/mysqlslap.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
@@ -101,7 +102,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="wsock32.lib odbc32.lib odbccp32.lib"
+ AdditionalDependencies="wsock32.lib odbc32.lib odbccp32.lib mysqlclient.lib mysys.lib"
OutputFile="../client_classic/mysqlslap.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
@@ -161,7 +162,7 @@
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="wsock32.lib odbc32.lib odbccp32.lib"
+ AdditionalDependencies="wsock32.lib odbc32.lib odbccp32.lib mysqlclient.lib mysys.lib"
OutputFile="../client_debug/mysqlslap.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
diff --git a/VC++Files/mysql.sln b/VC++Files/mysql.sln
index 9b3d827ce06..e877ee653d8 100644
--- a/VC++Files/mysql.sln
+++ b/VC++Files/mysql.sln
@@ -288,6 +288,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bdb", "storage\bdb\bdb.vcpr
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlslap", "client\mysqlslap.vcproj", "{2E9332CF-072A-4381-BF37-17C5AB4F8583}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "archive", "storage\archive\archive.vcproj", "{4471CADD-737B-4AD7-A108-2FBAA1C4B03B}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
@@ -1664,6 +1668,42 @@ Global
{B3BFA8E5-90CF-4794-96E0-0B03ACA57A30}.TLS.Build.0 = Debug|Win32
{B3BFA8E5-90CF-4794-96E0-0B03ACA57A30}.TLS_DEBUG.ActiveCfg = Debug|Win32
{B3BFA8E5-90CF-4794-96E0-0B03ACA57A30}.TLS_DEBUG.Build.0 = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.classic.ActiveCfg = classic|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.classic.Build.0 = classic|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.classic nt.ActiveCfg = classic|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.classic nt.Build.0 = classic|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Debug.ActiveCfg = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Debug.Build.0 = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Embedded_Classic.ActiveCfg = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Embedded_Classic.Build.0 = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Embedded_Debug.ActiveCfg = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Embedded_Debug.Build.0 = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Embedded_Pro.ActiveCfg = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Embedded_Pro.Build.0 = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Embedded_ProGPL.ActiveCfg = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Embedded_ProGPL.Build.0 = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Embedded_Release.ActiveCfg = Release|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Embedded_Release.Build.0 = Release|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Max.ActiveCfg = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Max.Build.0 = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Max nt.ActiveCfg = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Max nt.Build.0 = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.nt.ActiveCfg = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.nt.Build.0 = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.pro.ActiveCfg = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.pro.Build.0 = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.pro gpl.ActiveCfg = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.pro gpl.Build.0 = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.pro gpl nt.ActiveCfg = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.pro gpl nt.Build.0 = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.pro nt.ActiveCfg = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.pro nt.Build.0 = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Release.ActiveCfg = Release|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Release.Build.0 = Release|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.TLS.ActiveCfg = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.TLS.Build.0 = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.TLS_DEBUG.ActiveCfg = Debug|Win32
+ {2E9332CF-072A-4381-BF37-17C5AB4F8583}.TLS_DEBUG.Build.0 = Debug|Win32
{4471CADD-737B-4AD7-A108-2FBAA1C4B03B}.classic.ActiveCfg = Release|Win32
{4471CADD-737B-4AD7-A108-2FBAA1C4B03B}.classic.Build.0 = Release|Win32
{4471CADD-737B-4AD7-A108-2FBAA1C4B03B}.classic nt.ActiveCfg = Release|Win32
diff --git a/client/Makefile.am b/client/Makefile.am
index a22b929207c..849bd37eb57 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -48,7 +48,7 @@ mysqlbinlog_SOURCES = mysqlbinlog.cc $(top_srcdir)/mysys/mf_tempdir.c \
$(top_srcdir)/mysys/my_vle.c \
$(top_srcdir)/mysys/base64.c
mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS)
-mysqlslap_LDADD = $(LDADD) $(CXXLDFLAGS) -lpthread
+mysqlslap_LDADD = $(LDADD) $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS)
mysqltestmanager_pwgen_SOURCES = mysqlmanager-pwgen.c
mysqltestmanagerc_SOURCES= mysqlmanagerc.c $(yassl_dummy_link_fix)
mysqlcheck_SOURCES= mysqlcheck.c $(yassl_dummy_link_fix)
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index 93781504b57..c993b93e608 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -85,13 +85,25 @@ TODO:
#include <stdarg.h>
#include <sslopt-vars.h>
#include <sys/types.h>
+#ifndef __WIN__
#include <sys/wait.h>
+#endif
#include <ctype.h>
#include <my_pthread.h>
#define MYSLAPLOCK "/myslaplock.lck"
#define MYSLAPLOCK_DIR "/tmp"
+#ifdef __WIN__
+#define srandom srand
+#define random rand
+#define snprintf _snprintf
+#endif
+
+#ifdef HAVE_SMEM
+static char *shared_memory_base_name=0;
+#endif
+
static char **defaults_argv;
static char *host= NULL, *opt_password= NULL, *user= NULL,
@@ -213,6 +225,17 @@ static long int timedif(struct timeval a, struct timeval b)
return s + us;
}
+#ifdef __WIN__
+static int gettimeofday(struct timeval *tp, void *tzp)
+{
+ unsigned int ticks;
+ ticks= GetTickCount();
+ tp->tv_usec= ticks*1000;
+ tp->tv_sec= ticks/1000;
+
+ return 0;
+}
+#endif
int main(int argc, char **argv)
{
@@ -222,7 +245,10 @@ int main(int argc, char **argv)
unsigned long long client_limit;
statement *eptr;
- DBUG_ENTER("main");
+#ifdef __WIN__
+ opt_use_threads= 1;
+#endif
+
MY_INIT(argv[0]);
/* Seed the random number generator if we will be using it. */
@@ -353,7 +379,7 @@ int main(int argc, char **argv)
free_defaults(defaults_argv);
my_end(0);
- DBUG_RETURN(0); /* No compiler warnings */
+ return 0;
}
@@ -937,7 +963,6 @@ drop_schema(MYSQL *mysql, const char *db)
DBUG_RETURN(0);
}
-
static int
run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
{
@@ -981,6 +1006,7 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
}
}
}
+#ifndef __WIN__
else
{
fflush(NULL);
@@ -1021,6 +1047,7 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
}
}
}
+#endif
/* Lets release use some clients! */
if (!opt_slave)
@@ -1042,6 +1069,7 @@ run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
}
my_lock(lock_file, F_UNLCK, 0, F_TO_EOF, MYF(0));
}
+#ifndef __WIN__
else
{
WAIT:
@@ -1052,6 +1080,7 @@ WAIT:
DBUG_PRINT("info", ("Parent: child %d status %d", pid, status));
}
}
+#endif
gettimeofday(&end_time, NULL);
my_close(lock_file, MYF(0));
diff --git a/configure.in b/configure.in
index ad31ec8a497..ffc311a7857 100644
--- a/configure.in
+++ b/configure.in
@@ -1420,6 +1420,7 @@ AC_MSG_CHECKING("named thread libs:")
if test "$with_named_thread" != "no"
then
LIBS="$with_named_thread $LIBS $with_named_thread"
+ CLIENT_THREAD_LIBS="$with_named_thread"
with_posix_threads="yes"
AC_MSG_RESULT("$with_named_thread")
else
@@ -1436,6 +1437,7 @@ else
AC_MSG_CHECKING("for pthread_create in -lpthread");
ac_save_LIBS="$LIBS"
LIBS="$LIBS -lpthread"
+ CLIENT_THREAD_LIBS="-lpthread"
AC_TRY_LINK(
[#include <pthread.h>],
[ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ],
@@ -1444,6 +1446,7 @@ else
if test "$with_posix_threads" = "no"
then
LIBS=" $ac_save_LIBS -lpthreads"
+ CLIENT_THREAD_LIBS="-lpthreads"
AC_MSG_CHECKING("for pthread_create in -lpthreads");
AC_TRY_LINK(
[#include <pthread.h>],
@@ -1454,6 +1457,7 @@ else
then
# This is for FreeBSD
LIBS="$ac_save_LIBS -pthread"
+ CLIENT_THREAD_LIBS="-pthread"
AC_MSG_CHECKING("for pthread_create in -pthread");
AC_TRY_LINK(
[#include <pthread.h>],
@@ -2470,6 +2474,7 @@ fi
CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS"
AC_SUBST(CLIENT_LIBS)
+AC_SUBST(CLIENT_THREAD_LIBS)
AC_SUBST(NON_THREADED_LIBS)
AC_SUBST(STATIC_NSS_FLAGS)
AC_SUBST(sql_client_dirs)