List:Internals« Previous MessageNext Message »
From:sasha Date:August 10 2001 12:16am
Subject:bk commit into 3.23 tree
View as plain text  
Below is the list of changes that have just been commited into a local
3.23. repository of sasha. When sasha does a push, they will be
propogaged to the main repository and within 24 hours after the push into
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-09 18:16:43-06:00, sasha@stripped
  mysqlbinlog->client

  BitKeeper/etc/ignore
    1.73 01/08/09 18:16:42 sasha@stripped +7 -0
    Added client/log_event.cc client/log_event.h client/mf_iocache.c client/mf_iocache.cc client/mysqlbinlog client/mysys_priv.h mysql.kdevprj to the ignore list

  Makefile.am
    1.23 01/08/09 18:16:42 sasha@stripped +1 -0
    do symlink hack in the client directory 
    ( originally needed to get log_event.cc for mysqlbinlog)

  client/Makefile.am
    1.13 01/08/09 18:16:42 sasha@stripped +16 -1
    mysqlbinlog->client

  client/mysqlbinlog.cc
    1.43 01/08/09 18:16:42 sasha@stripped +19 -16
    fixes to make it compile in the client directory

  libmysql/Makefile.shared
    1.12 01/08/09 18:16:42 sasha@stripped +2 -1
    link mysqlbinlog dependencies into libmysqlclient

  libmysql/libmysql.c
    1.57 01/08/09 18:16:42 sasha@stripped +2 -2
    make simple_command and net_safe_read extern ( for mysqlbinlog)

  sql/Makefile.am
    1.43 01/08/09 18:16:42 sasha@stripped +0 -4
    mysqlbinlog->client

  sql/log_event.cc
    1.39 01/08/09 18:16:42 sasha@stripped +20 -11
    removed pthread dependency in mysqlbinlog

  sql/log_event.h
    1.43 01/08/09 18:16:42 sasha@stripped +4 -0
    removed pthread dependency in mysqlbinlog

# 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

--- 1.22/Makefile.am	Sun Dec 31 06:00:45 2000
+++ 1.23/Makefile.am	Thu Aug  9 18:16:42 2001
@@ -37,6 +37,7 @@
 	echo timestamp > linked_include_sources
 
 linked_client_sources:  @linked_client_targets@
+	cd client; $(MAKE) link_sources
 	echo timestamp > linked_client_sources
 
 linked_libmysql_sources:

--- 1.12/client/Makefile.am	Fri Apr 20 05:54:14 2001
+++ 1.13/client/Makefile.am	Thu Aug  9 18:16:42 2001
@@ -21,7 +21,8 @@
 				-I..
 LIBS =				@CLIENT_LIBS@
 LDADD =				@CLIENT_EXTRA_LDFLAGS@ ../libmysql/libmysqlclient.la
-bin_PROGRAMS =			mysql mysqladmin mysqlcheck mysqlshow mysqldump mysqlimport mysqltest
+bin_PROGRAMS =			mysql mysqladmin mysqlcheck mysqlshow \
+ mysqldump mysqlimport mysqltest mysqlbinlog
 noinst_PROGRAMS =		insert_test select_test thread_test
 noinst_HEADERS =		sql_string.h completion_hash.h my_readline.h
 mysql_SOURCES =			mysql.cc readline.cc sql_string.cc completion_hash.cc
@@ -36,9 +37,23 @@
 select_test_DEPENDENCIES=	$(LIBRARIES) $(pkglib_LTLIBRARIES)
 mysqltest_SOURCES=			mysqltest.c
 mysqltest_DEPENDENCIES=   	$(LIBRARIES) $(pkglib_LTLIBRARIES)
+mysqlbinlog_SOURCES =   mysqlbinlog.cc 
+mysqlbinlog_DEPENDENCIES=   	$(LIBRARIES) $(pkglib_LTLIBRARIES)
+sql_src=log_event.h log_event.cc
+mysys_src=mysys_priv.h
 
 # Fix for mit-threads
 DEFS =			-DUNDEF_THREADS_HACK
+
+link_sources:
+	for f in $(sql_src) ; do \
+	rm -f $$f; \
+        @LN_CP_F@ ../sql/$$f $$f; \
+        done; \
+	for f in $(mysys_src); do \
+	rm -f $$f; \
+	@LN_CP_F@ ../mysys/$$f $$f; \
+	done;
 
 thread_test.o:		thread_test.c
 			$(COMPILE) -c @MT_INCLUDES@ $(INCLUDES) $<

--- 1.56/libmysql/libmysql.c	Sat Apr 21 08:12:59 2001
+++ 1.57/libmysql/libmysql.c	Thu Aug  9 18:16:42 2001
@@ -287,7 +287,7 @@
 ** or packet is an error message
 *****************************************************************************/
 
-static uint
+uint
 net_safe_read(MYSQL *mysql)
 {
   NET *net= &mysql->net;
@@ -417,7 +417,7 @@
 }
 
 
-static int
+int
 simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg,
 	       uint length, my_bool skipp_check)
 {

--- 1.42/sql/Makefile.am	Sun Jul 15 18:04:29 2001
+++ 1.43/sql/Makefile.am	Thu Aug  9 18:16:42 2001
@@ -27,7 +27,6 @@
 			-I$(srcdir) -I../include -I.. -I.
 WRAPLIBS=		@WRAPLIBS@
 SUBDIRS =		share
-bin_PROGRAMS	=	mysqlbinlog
 libexec_PROGRAMS =	mysqld
 noinst_PROGRAMS =	gen_lex_hash
 gen_lex_hash_LDFLAGS =        @NOINST_LDFLAGS@
@@ -83,9 +82,6 @@
 			md5.c stacktrace.c
 gen_lex_hash_SOURCES =	gen_lex_hash.cc
 gen_lex_hash_LDADD =	$(LDADD) $(CXXLDFLAGS)
-mysqlbinlog_SOURCES =   mysqlbinlog.cc mini_client.cc net_serv.cc \
-			mini_client_errors.c violite.c password.c
-mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS) # $(mysqld_LDADD)
 
 DEFS =			-DMYSQL_SERVER \
 			-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \

--- 1.38/sql/log_event.cc	Sun Apr 29 07:07:58 2001
+++ 1.39/sql/log_event.cc	Thu Aug  9 18:16:42 2001
@@ -111,18 +111,29 @@
 
 #endif // MYSQL_CLIENT
 
-// allocates memory - the caller is responsible for clean-up
+#ifndef MYSQL_CLIENT
+#define UNLOCK_MUTEX if(log_lock) pthread_mutex_unlock(log_lock);
+#else
+#define UNLOCK_MUTEX
+#endif
 
+// allocates memory - the caller is responsible for clean-up
+#ifndef MYSQL_CLIENT
 Log_event* Log_event::read_log_event(IO_CACHE* file, pthread_mutex_t* log_lock)
+#else
+Log_event* Log_event::read_log_event(IO_CACHE* file)
+#endif  
 {
   time_t timestamp;
   uint32 server_id;
   
   char buf[LOG_EVENT_HEADER_LEN-4];
+#ifndef MYSQL_CLIENT  
   if(log_lock) pthread_mutex_lock(log_lock);
+#endif  
   if (my_b_read(file, (byte *) buf, sizeof(buf)))
   {
-    if (log_lock) pthread_mutex_unlock(log_lock);
+    UNLOCK_MUTEX
     return NULL;
   }
   timestamp = uint4korr(buf);
@@ -133,7 +144,7 @@
   case QUERY_EVENT:
   {
     Query_log_event* q = new Query_log_event(file, timestamp, server_id);
-    if(log_lock) pthread_mutex_unlock(log_lock);
+    UNLOCK_MUTEX
     if (!q->query)
     {
       delete q;
@@ -145,7 +156,7 @@
   case LOAD_EVENT:
   {
     Load_log_event* l = new Load_log_event(file, timestamp, server_id);
-    if(log_lock) pthread_mutex_unlock(log_lock);
+    UNLOCK_MUTEX
     if (!l->table_name)
     {
       delete l;
@@ -158,8 +169,7 @@
   case ROTATE_EVENT:
   {
     Rotate_log_event* r = new Rotate_log_event(file, timestamp, server_id);
-    if(log_lock) pthread_mutex_unlock(log_lock);
-    
+    UNLOCK_MUTEX
     if (!r->new_log_ident)
     {
       delete r;
@@ -171,8 +181,7 @@
   case INTVAR_EVENT:
   {
     Intvar_log_event* e = new Intvar_log_event(file, timestamp, server_id);
-    if(log_lock) pthread_mutex_unlock(log_lock);
-    
+    UNLOCK_MUTEX
     if (e->type == INVALID_INT_EVENT)
     {
       delete e;
@@ -184,13 +193,13 @@
   case START_EVENT:
     {
       Start_log_event* e = new Start_log_event(file, timestamp, server_id);
-      if(log_lock) pthread_mutex_unlock(log_lock);
+      UNLOCK_MUTEX
       return e;
     }	  
   case STOP_EVENT:
     {
       Stop_log_event* e = new Stop_log_event(file, timestamp, server_id);
-      if(log_lock) pthread_mutex_unlock(log_lock);
+      UNLOCK_MUTEX
       return e;
     }
   default:
@@ -198,7 +207,7 @@
   }
 
   // default
-  if (log_lock) pthread_mutex_unlock(log_lock);
+  UNLOCK_MUTEX
   return NULL;
 }
 

--- 1.42/sql/log_event.h	Sat Jul 28 11:46:13 2001
+++ 1.43/sql/log_event.h	Thu Aug  9 18:16:42 2001
@@ -105,8 +105,12 @@
   void print_timestamp(FILE* file, time_t *ts = 0);
   void print_header(FILE* file);
 
+#ifndef MYSQL_CLIENT  
   // if mutex is 0, the read will proceed without mutex
   static Log_event* read_log_event(IO_CACHE* file, pthread_mutex_t* log_lock);
+#else // avoid having to link mysqlbinlog against libpthread
+  static Log_event* read_log_event(IO_CACHE* file);
+#endif  
   static Log_event* read_log_event(const char* buf, int event_len);
 
 #ifndef MYSQL_CLIENT

--- 1.42/sql/mysqlbinlog.cc	Tue Jun 19 05:30:12 2001
+++ 1.43/client/mysqlbinlog.cc	Thu Aug  9 18:16:42 2001
@@ -22,13 +22,19 @@
 #include <my_sys.h>
 #include <getopt.h>
 #include <thr_alarm.h>
-#define MYSQL_SERVER			// We want the C++ version of net
 #include <mysql.h>
 #include "log_event.h"
-#include "mini_client.h"
 
 #define CLIENT_CAPABILITIES	(CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_LOCAL_FILES)
 
+extern "C"
+{
+ int simple_command(MYSQL *mysql,enum enum_server_command command,
+			      const char *arg,
+		  uint length, my_bool skipp_check);
+ int net_safe_read(MYSQL* mysql);
+}
+
 char server_version[SERVER_VERSION_LENGTH];
 uint32 server_id = 0;
 
@@ -108,7 +114,7 @@
 
 static void print_version()
 {
-  printf("%s  Ver 1.4 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE);
+  printf("%s  Ver 1.5 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE);
 }
 
 
@@ -248,12 +254,12 @@
 
 static MYSQL* safe_connect()
 {
-  MYSQL *local_mysql = mc_mysql_init(NULL);
+  MYSQL *local_mysql = mysql_init(NULL);
   if(!local_mysql)
-    die("Failed on mc_mysql_init");
+    die("Failed on mysql_init");
 
-  if(!mc_mysql_connect(local_mysql, host, user, pass, 0, port, 0, 0))
-    die("failed on connect: %s", mc_mysql_error(local_mysql));
+  if(!mysql_real_connect(local_mysql, host, user, pass, 0, port, 0, 0))
+    die("failed on connect: %s", mysql_error(local_mysql));
 
   return local_mysql;
 }
@@ -281,7 +287,7 @@
   *p++ = table_len;
   memcpy(p, table, table_len);
   
-  if(mc_simple_command(mysql, COM_TABLE_DUMP, buf, p - buf + table_len, 1))
+  if(simple_command(mysql, COM_TABLE_DUMP, buf, p - buf + table_len, 1))
     die("Error sending the table dump command");
 
   for(;;)
@@ -314,14 +320,14 @@
   len = (uint) strlen(logname);
   int4store(buf + 6, 0);
   memcpy(buf + 10, logname,len);
-  if(mc_simple_command(mysql, COM_BINLOG_DUMP, buf, len + 10, 1))
+  if(simple_command(mysql, COM_BINLOG_DUMP, buf, len + 10, 1))
     die("Error sending the log dump command");
   
   for(;;)
   {
-    len = mc_net_safe_read(mysql);
+    len = net_safe_read(mysql);
     if (len == packet_error)
-      die("Error reading packet from server: %s", mc_mysql_error(mysql));
+      die("Error reading packet from server: %s", mysql_error(mysql));
     if(len == 1 && net->read_pos[0] == 254)
       break; // end of data
     DBUG_PRINT("info",( "len= %u, net->read_pos[5] = %d\n",
@@ -391,7 +397,7 @@
     char llbuff[21];
     my_off_t old_off = my_b_tell(file);
 
-    Log_event* ev = Log_event::read_log_event(file, 0);
+    Log_event* ev = Log_event::read_log_event(file);
     if (!ev)
     {
       if (file->error)
@@ -430,9 +436,6 @@
 
   if(use_remote)
   {
-#ifndef __WIN__
-    init_thr_alarm(10); // need to do this manually 
-#endif
     mysql = safe_connect();
   }
 
@@ -457,7 +460,7 @@
   if (result_file != stdout)
     my_fclose(result_file, MYF(0));
   if (use_remote)
-    mc_mysql_close(mysql);
+    mysql_close(mysql);
   return 0;
 }
 

--- 1.72/BitKeeper/etc/ignore	Tue Jul 24 10:23:17 2001
+++ 1.73/BitKeeper/etc/ignore	Thu Aug  9 18:16:42 2001
@@ -291,3 +291,10 @@
 myisam/test1.MYI
 .gdbinit
 .vimrc
+client/log_event.cc
+client/log_event.h
+client/mf_iocache.c
+client/mf_iocache.cc
+client/mysqlbinlog
+client/mysys_priv.h
+mysql.kdevprj

--- 1.11/libmysql/Makefile.shared	Thu May 31 18:53:14 2001
+++ 1.12/libmysql/Makefile.shared	Thu Aug  9 18:16:42 2001
@@ -55,7 +55,8 @@
 			mf_loadpath.lo my_pthread.lo my_thr_init.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
+                        charset.lo hash.lo mf_iocache.lo my_seek.lo \
+			my_pread.lo mf_cache.lo
 # Not needed in the minimum library
 mysysobjects2 =		getopt.lo getopt1.lo getvar.lo my_lib.lo
 mysysobjects =		$(mysysobjects1) $(mysysobjects2)
Thread
bk commit into 3.23 treesasha10 Aug