List:Internals« Previous MessageNext Message »
From:sasha Date:August 29 2001 5:52am
Subject:bk commit into 4.0 tree
View as plain text  
Below is the list of changes that have just been committed into a
4.0 repository of sasha. When sasha does a push, they will be propogated to 
the main repository and within 24 hours after the push to the public repository. 
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html

ChangeSet@stripped, 2001-08-28 23:52:02-06:00, sasha@stripped
  temporary commit to merge Monty's changes

  tools/Makefile.am
    1.2 01/08/28 23:52:01 sasha@stripped +1 -1
    fixed typo

  tools/mysqlmngd.c
    1.3 01/08/28 23:52:01 sasha@stripped +48 -5
    started work on exec command

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	sasha
# Host:	mysql.sashanet.com
# Root:	/home/sasha/src/bk/mysql-4.0

--- 1.1/tools/Makefile.am	Mon Aug 27 17:33:11 2001
+++ 1.2/tools/Makefile.am	Tue Aug 28 23:52:01 2001
@@ -5,7 +5,7 @@
 LDADD =				@CLIENT_EXTRA_LDFLAGS@ ../libmysql_r/libmysqlclient_r.la
 bin_PROGRAMS =			mysqlmngd
 mysqlmngd_SOURCES = mysqlmngd.c my_vsnprintf.c 
-mysqltest_DEPENDENCIES=   	$(LIBRARIES) $(pkglib_LTLIBRARIES)
+mysqlmngd_DEPENDENCIES=   	$(LIBRARIES) $(pkglib_LTLIBRARIES)
 DEFS =			-DUNDEF_THREADS_HACK
 
 mysys_src=my_vsnprintf.c mysys_priv.h

--- 1.2/tools/mysqlmngd.c	Mon Aug 27 17:33:11 2001
+++ 1.3/tools/mysqlmngd.c	Tue Aug 28 23:52:01 2001
@@ -112,8 +112,15 @@
   int fatal,finished;
 };
 
-struct mngd_thd* mngd_thd_new(Vio* vio);
-void mngd_thd_free(struct mngd_thd* thd);
+HASH exec_hash;
+
+static struct mngd_thd* mngd_thd_new(Vio* vio);
+static struct mngd_exec* mngd_exec_new(const char* arg_start,
+				       const char* arg_end);
+static void mngd_thd_free(struct mngd_thd* thd);
+static void mngd_exec_free(void* e);
+static byte* get_exec_key(const byte* e, uint* len,
+			  my_bool __attribute__((unused)) t);
 
 typedef int (*mngd_cmd_handler)(struct mngd_thd*,char*,char*);
 
@@ -126,6 +133,17 @@
   int len;
 };
 
+struct mngd_exec
+{
+  const char* ident;
+  const char* bin_path;
+  const char** args;
+  const char* con_user;
+  const char* con_pass;
+  int con_port;
+  const char* con_sock;
+};
+
 #define HANDLE_DECL(com) static int handle_ ## com (struct mngd_thd* thd,\
  char* args_start,char* args_end)
 
@@ -617,6 +635,32 @@
   return fp;
 }
 
+static byte* get_exec_key(const byte* e, uint* len,
+			 my_bool __attribute__((unused)) t)
+{
+  register char* key;
+  key = ((struct mngd_exec*)e)->ident;
+  *len = ((struct mngd_exec*)e)->ident_len;
+  return (byte*)key;
+}
+
+static struct mngd_exec* mngd_exec_new(const char* arg_start,
+				       const char* arg_end)
+{
+}
+
+
+static void mngd_exec_free(void* e)
+{
+  my_free(e,MYF(0));
+}
+
+void init_globals()
+{
+  if (hash_init(&exec_hash,1024,0,0,get_exec_key,exec_free,MYF(0)))
+    die("Exec hash initialization failed");
+}
+
 int daemonize()
 {
   switch (fork())
@@ -625,8 +669,10 @@
       die("Cannot fork");
     case 0:
       errfp = open_log_stream();
+      init_globals();
       close(0);
       close(1);
+      close(2);
       init_server();
       run_server_loop();
       clean_up();
@@ -646,6 +692,3 @@
   pthread_mutex_init(&lock_shutdown,0);
   return daemonize();
 }
-
-
-
Thread
bk commit into 4.0 treesasha29 Aug