diff options
author | unknown <petr@mysql.com> | 2004-11-06 02:14:56 +0300 |
---|---|---|
committer | unknown <petr@mysql.com> | 2004-11-06 02:14:56 +0300 |
commit | 4f32ec18822f90ff118f4cbe655b80f977d7077f (patch) | |
tree | 8d01854a219c3f5156c99ba00a3f942fb8adc0c0 /server-tools | |
parent | 5a7c108556ad10b3a81ed131737f816d4dacdbb6 (diff) | |
download | mariadb-git-4f32ec18822f90ff118f4cbe655b80f977d7077f.tar.gz |
fix for the IM linking problem
BitKeeper/etc/ignore:
Added mysql-5.0.2-alpha.tar.gz server-tools/instance-manager/client.c server-tools/instance-manager/client_settings.h server-tools/instance-manager/errmsg.c to the ignore list
server-tools/instance-manager/instance_map.cc:
Comment updated
server-tools/instance-manager/priv.cc:
added variables needed by net_serv.cc
server-tools/instance-manager/priv.h:
declared variables needed by net_serv.cc
sql/net_serv.cc:
added some IM-specific defines
Diffstat (limited to 'server-tools')
-rw-r--r-- | server-tools/instance-manager/Makefile.am | 54 | ||||
-rw-r--r-- | server-tools/instance-manager/client_func.c | 32 | ||||
-rw-r--r-- | server-tools/instance-manager/instance_map.cc | 7 | ||||
-rw-r--r-- | server-tools/instance-manager/priv.cc | 5 | ||||
-rw-r--r-- | server-tools/instance-manager/priv.h | 4 |
5 files changed, 67 insertions, 35 deletions
diff --git a/server-tools/instance-manager/Makefile.am b/server-tools/instance-manager/Makefile.am index d485a8798f5..4c3a772111a 100644 --- a/server-tools/instance-manager/Makefile.am +++ b/server-tools/instance-manager/Makefile.am @@ -16,14 +16,14 @@ INCLUDES= -I$(top_srcdir)/include -DEFS= -DMYSQL_INSTANCE_MANAGER +DEFS= -DMYSQL_INSTANCE_MANAGER -DMYSQL_SERVER # As all autoconf variables depend from ${prefix} and being resolved only when # make is run, we can not put these defines to a header file (e.g. to # default_options.h, generated from default_options.h.in) # See automake/autoconf docs for details -noinst_LIBRARIES= liboptions.a libnet.a libalarm.a +noinst_LIBRARIES= liboptions.a libnet.a liboptions_a_CPPFLAGS= $(CPPFLAGS) \ -DDEFAULT_PID_FILE_NAME="$(localstatedir)/mysqlmanager.pid" \ @@ -34,7 +34,7 @@ liboptions_a_CPPFLAGS= $(CPPFLAGS) \ -DDEFAULT_USER="root" \ -DDEFAULT_PASSWORD="" \ -DDEFAULT_MONITORING_INTERVAL="5" \ - -DDEFAULT_PORT="3406" \ + -DDEFAULT_PORT="33006" \ -DPROTOCOL_VERSION=@PROTOCOL_VERSION@ liboptions_a_SOURCES= options.h options.cc priv.h priv.cc @@ -42,37 +42,28 @@ liboptions_a_SOURCES= options.h options.cc priv.h priv.cc # MySQL sometimes uses symlinks to reuse code # All symlinked files are grouped in libnet.a -nodist_libnet_a_SOURCES= password.c pack.c sql_state.c net_serv.cc -nodist_libnet_a_CPPFLAGS= $(CPPFLAGS) -DMYSQL_SERVER +nodist_libnet_a_SOURCES= net_serv.cc client.c errmsg.c +libnet_a_LIBADD= $(top_builddir)/sql/password.$(OBJEXT) \ + $(top_builddir)/sql/pack.$(OBJEXT) \ + $(top_builddir)/sql/sql_state.$(OBJEXT) -nodist_libalarm_a_SOURCES= thr_alarm.c -nodist_libalarm_a_CPPFLAGS= $(CPPFLAGS) -DMYSQL_SERVER -libalarm_a_LIBADD= $(top_builddir)/mysys/mf_qsort2.$(OBJEXT) \ - $(top_builddir)/mysys/queues.$(OBJEXT) \ - $(top_builddir)/mysys/my_new.$(OBJEXT) - - -CLEANFILES= net_serv.cc password.c pack.c sql_state.c thr_alarm.c +CLEANFILES= net_serv.cc client.c client_settings.h errmsg.c net_serv.cc: Makefile rm -f $(srcdir)/net_serv.cc @LN_CP_F@ $(top_srcdir)/sql/net_serv.cc $(srcdir)/net_serv.cc -password.c: Makefile - rm -f $(srcdir)/password.c - @LN_CP_F@ $(top_srcdir)/sql/password.c $(srcdir)/password.c - -pack.c: Makefile - rm -f $(srcdir)/pack.c - @LN_CP_F@ $(top_srcdir)/sql-common/pack.c $(srcdir)/pack.c +client.c: Makefile + rm -f $(srcdir)/client.c + @LN_CP_F@ $(top_srcdir)/sql-common/client.c $(srcdir)/client.c -sql_state.c: Makefile - rm -f $(srcdir)/sql_state.c - @LN_CP_F@ $(top_srcdir)/sql/sql_state.c $(srcdir)/sql_state.c +errmsg.c: Makefile + rm -f $(srcdir)/errmsg.c + @LN_CP_F@ $(top_srcdir)/libmysql/errmsg.c $(srcdir)/errmsg.c -thr_alarm.c: Makefile - rm -f $(srcdir)/thr_alarm.c - @LN_CP_F@ $(top_srcdir)/mysys/thr_alarm.c $(srcdir)/thr_alarm.c +client_settings.h: Makefile + rm -f $(srcdir)/client_settings.h + @LN_CP_F@ $(top_srcdir)/sql/client_settings.h $(srcdir)/client_settings.h bin_PROGRAMS= mysqlmanager @@ -90,15 +81,16 @@ mysqlmanager_SOURCES= command.cc command.h mysqlmanager.cc \ instance_map.h instance_map.cc\ instance_options.h instance_options.cc \ buffer.h buffer.cc parse.cc parse.h \ - guardian.cc guardian.h common_structures.h \ - mysql_manager_error.h + guardian.cc guardian.h \ + mysql_manager_error.h client_func.c mysqlmanager_LDADD= liboptions.a \ libnet.a \ - libalarm.a \ $(top_builddir)/vio/libvio.a \ - $(top_builddir)/libmysql_r/libmysqlclient_r.la \ - $(top_builddir)/dbug/libdbug.a -lz + $(top_builddir)/mysys/libmysys.a \ + $(top_builddir)/strings/libmystrings.a \ + $(top_builddir)/dbug/libdbug.a \ + @openssl_libs@ @ZLIB_LIBS@ tags: diff --git a/server-tools/instance-manager/client_func.c b/server-tools/instance-manager/client_func.c new file mode 100644 index 00000000000..a7ff1d27a8f --- /dev/null +++ b/server-tools/instance-manager/client_func.c @@ -0,0 +1,32 @@ +#include <my_global.h> +#include <my_sys.h> +#include <mysql.h> + +/* + Currently we cannot use libmysqlclient directly becouse of the linking + issues. Here we provide needed libmysqlclient functions. + TODO: to think how to use libmysqlclient code instead of copy&paste. + The other possible solution is to use simple_command directly. +*/ + +const char * STDCALL +mysql_get_server_info(MYSQL *mysql) +{ + return((char*) mysql->server_version); +} + +int STDCALL +mysql_ping(MYSQL *mysql) +{ + DBUG_ENTER("mysql_ping"); + DBUG_RETURN(simple_command(mysql,COM_PING,0,0,0)); +} + +int STDCALL +mysql_shutdown(MYSQL *mysql, enum mysql_enum_shutdown_level shutdown_level) +{ + uchar level[1]; + DBUG_ENTER("mysql_shutdown"); + level[0]= (uchar) shutdown_level; + DBUG_RETURN(simple_command(mysql, COM_SHUTDOWN, (char *)level, 1, 0)); +} diff --git a/server-tools/instance-manager/instance_map.cc b/server-tools/instance-manager/instance_map.cc index 3a0d408dc1c..41b23c5dd00 100644 --- a/server-tools/instance-manager/instance_map.cc +++ b/server-tools/instance-manager/instance_map.cc @@ -27,10 +27,9 @@ #include <m_string.h> /* - TODO: Currently there are some mysql-connection specific functions. - As we are going to suppost different types of connections, we shouldn't - have them here in future. To avoid it we could put such - connection-specific functions to the Command-derived class instead. + Note: As we are going to suppost different types of connections, + we shouldn't have connection-specific functions. To avoid it we could + put such functions to the Command-derived class instead. The command could be easily constructed for a specific connection if we would provide a special factory for each connection. */ diff --git a/server-tools/instance-manager/priv.cc b/server-tools/instance-manager/priv.cc index e449df9f540..8112ebd41d8 100644 --- a/server-tools/instance-manager/priv.cc +++ b/server-tools/instance-manager/priv.cc @@ -32,3 +32,8 @@ unsigned long net_write_timeout= 60; // same as in mysqld unsigned long net_retry_count= 10; // same as in mysqld +/* needed by net_serv.cc */ +unsigned int test_flags= 0; +unsigned long bytes_sent = 0L, bytes_received = 0L; +unsigned long mysqld_net_retry_count = 10L; +unsigned long open_files_limit; diff --git a/server-tools/instance-manager/priv.h b/server-tools/instance-manager/priv.h index 73ee87552c8..8014df7260c 100644 --- a/server-tools/instance-manager/priv.h +++ b/server-tools/instance-manager/priv.h @@ -56,5 +56,9 @@ extern unsigned long net_write_timeout; */ extern unsigned long net_retry_count; +extern unsigned int test_flags; +extern unsigned long bytes_sent, bytes_received; +extern unsigned long mysqld_net_retry_count; +extern unsigned long open_files_limit; #endif // INCLUDES_MYSQL_INSTANCE_MANAGER_PRIV_H |