List:Internals« Previous MessageNext Message »
From:Mats Kindahl Date:March 23 2005 11:15am
Subject:bk commit into 5.1 tree (mats:1.1829)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of mats. When mats does a push these changes will
be propagated 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://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.1829 05/03/23 11:15:26 mats@stripped +7 -0
  WL#2325 - Adding preprocessor directives to handle various configurations.

  sql/sql_class.h
    1.228 05/03/23 11:15:21 mats@stripped +2 -1
    Adding preprocessor directives to handle configuration.

  sql/sql_class.cc
    1.173 05/03/23 11:15:21 mats@stripped +5 -1
    Adding preprocessor directives to handle configuration.

  sql/log_event.h
    1.108 05/03/23 11:15:21 mats@stripped +14 -4
    Adding preprocessor directives to handle configuration.

  sql/log_event.cc
    1.170 05/03/23 11:15:20 mats@stripped +21 -13
    Adding preprocessor directives to handle configuration.

  sql/log.cc
    1.158 05/03/23 11:15:20 mats@stripped +3 -0
    Adding preprocessor directives to handle configuration.

  sql/handler.h
    1.132 05/03/23 11:15:20 mats@stripped +11 -2
    Adding preprocessor directives to handle configuration.

  sql/handler.cc
    1.150 05/03/23 11:15:20 mats@stripped +21 -1
    Adding preprocessor directives to handle configuration.

# 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:	mats
# Host:	romeo.kindahl.net
# Root:	/home/bk/forndb-mysql-5.1

--- 1.149/sql/handler.cc	2005-03-21 19:31:59 +01:00
+++ 1.150/sql/handler.cc	2005-03-23 11:15:20 +01:00
@@ -2408,8 +2408,10 @@
     DBUG_PRINT("exit", ("error = %d", error));
     DBUG_RETURN(error);
   }
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
   bitvector const bv(table->s->fields, true);
   m_row_writer.write_row(bv, buf);
+#endif
   DBUG_PRINT("exit", ("error = %d", 0));
   DBUG_RETURN(0);
 }
@@ -2435,8 +2437,10 @@
     DBUG_PRINT("exit", ("error = %d", error));
     DBUG_RETURN(error);
   }
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
   bitvector const cols(table->s->fields, true);
   m_row_writer.update_row(cols, old_data, new_data);
+#endif
   DBUG_PRINT("exit", ("error = %d", 0));
   DBUG_RETURN(0);
 }
@@ -2462,8 +2466,10 @@
     DBUG_PRINT("exit", ("error = %d", error));
     DBUG_RETURN(error);
   }
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
   bitvector const cols(table->s->fields, true);
   m_row_writer.delete_row(cols, buf);
+#endif
   DBUG_PRINT("exit", ("error = %d", 0));
   DBUG_RETURN(0);
 }    
@@ -2471,13 +2477,21 @@
 int handler::
 ha_stmt_begin() 
 { 
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
   return m_row_writer.transaction_begin(); 
+#else
+  return 0;
+#endif
 }
 
 int handler::
 ha_stmt_end()
 { 
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
   return m_row_writer.transaction_end(); 
+#else
+  return 0;
+#endif
 }
 
 
@@ -2485,6 +2499,8 @@
 	Row_rw_base member functions
 **************************************************************************/
 
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
+
 Row_rw_base::
 Row_rw_base(THD *thd, TABLE *table)
   : m_thd(thd), m_table(table)
@@ -2541,10 +2557,13 @@
   DBUG_RETURN(size);
 }
 
+#endif
+
 /**************************************************************************
 	Row_writer member functions
 **************************************************************************/
 
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
 
 int Row_writer::
 write_row(bitvector const& cols, byte const *record) 
@@ -2672,7 +2691,6 @@
   DBUG_RETURN(0);
 }
 
-
 int Row_writer::
 flush_pending_event(bool stmt_end)
 {
@@ -2695,3 +2713,5 @@
   int const error = thd->flush_and_set_pending_event(0);
   DBUG_RETURN(error);
 }
+
+#endif // !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)

--- 1.131/sql/handler.h	2005-03-21 19:31:59 +01:00
+++ 1.132/sql/handler.h	2005-03-23 11:15:20 +01:00
@@ -466,6 +466,8 @@
 
  ****************************************************************************/
 
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
+
 class handler;
 
 class Row_writer : public Row_rw_base
@@ -503,6 +505,7 @@
   bool m_has_trans;
 };
 
+#endif // !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
 
 class handler :public Sql_alloc
 {
@@ -571,8 +574,10 @@
     key_used_on_scan(MAX_KEY), active_index(MAX_KEY),
     ref_length(sizeof(my_off_t)), block_size(0),
     raid_type(0), ft_handler(0), inited(NONE), implicit_emptied(0),
-    pushed_cond(NULL),
-    m_row_writer(current_thd, table_arg, has_transactions())
+    pushed_cond(NULL)
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
+    , m_row_writer(current_thd, table_arg, has_transactions())
+#endif
     {}
   virtual ~handler(void) { /* TODO: DBUG_ASSERT(inited == NONE); */ }
   int ha_open(const char *name, int mode, int test_if_locked);
@@ -869,8 +874,10 @@
  */
  virtual void cond_pop() { return; };
 
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
   // This is a temporary solution
   Row_writer* row_writer() { return &m_row_writer; }
+#endif
 
 private:
   /*
@@ -884,7 +891,9 @@
   virtual int delete_row(const byte * buf)
   { return  HA_ERR_WRONG_COMMAND; }
  
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
   Row_writer m_row_writer;
+#endif
 };
 
 	/* Some extern variables used with handlers */

--- 1.157/sql/log.cc	2005-03-21 19:32:00 +01:00
+++ 1.158/sql/log.cc	2005-03-23 11:15:20 +01:00
@@ -2303,6 +2303,8 @@
 }
 
 
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
+
 ulong MYSQL_LOG::
 get_table_id(TABLE* table)
 {
@@ -2325,6 +2327,7 @@
   DBUG_PRINT("return", ("table_id=%d", tid));
   DBUG_RETURN(tid);
 }
+#endif // !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
 
 #ifdef __NT__
 void print_buffer_to_nt_eventlog(enum loglevel level, char *buff,

--- 1.169/sql/log_event.cc	2005-03-22 10:41:44 +01:00
+++ 1.170/sql/log_event.cc	2005-03-23 11:15:20 +01:00
@@ -4833,6 +4833,7 @@
 }
 
 #ifndef MYSQL_CLIENT
+#ifdef HAVE_REPLICATION
 /*
   Unpack a row into a record. The row is assumed to only consist of the fields
   for which the bitset represented by 'arr' and 'bits'; the other parts of the
@@ -4928,7 +4929,8 @@
     
   DBUG_RETURN(error || Log_event::exec_event(rli));
 }
-#endif
+#endif // HAVE_REPLICATION
+#endif // MYSQL_CLIENT
 
 bool Rows_log_event::
 write_data_header(IO_CACHE* file)
@@ -5087,6 +5089,7 @@
 }
 
 #ifndef MYSQL_CLIENT
+#ifdef HAVE_REPLICATION
 int Table_map_log_event::
 exec_event(st_relay_log_info* rli)
 {
@@ -5111,7 +5114,8 @@
   int error = rli->m_table_map.set_table(m_table_id, m_table);
   DBUG_RETURN(error || Log_event::exec_event(rli));
 }
-#endif
+#endif // HAVE_REPLICATION
+#endif // !MYSQL_CLIENT
 
 #ifndef MYSQL_CLIENT
 bool Table_map_log_event::
@@ -5211,7 +5215,7 @@
   DBUG_VOID_RETURN;
 }
 
-#ifndef MYSQL_CLIENT
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
 int Write_rows_log_event::
 do_before_row_operations(TABLE* table)
 {
@@ -5243,7 +5247,7 @@
   int error = table->file->ha_write_row(table->record[0]);
   DBUG_RETURN(error);
 }
-#endif
+#endif // !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
 
 #ifdef MYSQL_CLIENT
 void Write_rows_log_event::
@@ -5284,8 +5288,12 @@
 Delete_rows_log_event::
 Delete_rows_log_event(THD* thd_arg, TABLE* tbl_arg, ulong tid, 
 		      bitvector const& cols, bool using_trans)
+#ifndef HAVE_REPLICATION
+  : Rows_log_event(thd_arg, tbl_arg, tid, cols, using_trans)
+#else
   : Rows_log_event(thd_arg, tbl_arg, tid, cols, using_trans), 
     m_memory(NULL), m_key(NULL), m_search_record(NULL)
+#endif
 {
 }
 
@@ -5301,7 +5309,7 @@
 Delete_rows_log_event::
 Delete_rows_log_event(const char* buf, uint event_len,
 		      const Format_description_log_event *description_event)
-#ifdef MYSQL_CLIENT
+#if defined(MYSQL_CLIENT) || !defined(HAVE_REPLICATION)
   : Rows_log_event(buf, event_len, DELETE_ROWS_EVENT, description_event)
 #else
   : Rows_log_event(buf, event_len, DELETE_ROWS_EVENT, description_event),
@@ -5313,7 +5321,7 @@
 }
 
 
-#ifndef MYSQL_CLIENT
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
 int Delete_rows_log_event::
 do_before_row_operations(TABLE* table)
 {
@@ -5442,7 +5450,7 @@
   DBUG_PRINT("return", ("error = %d", error));
   DBUG_RETURN(error);
 }
-#endif
+#endif // !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
 
 /**************************************************************************
 	Update_rows_log_event member functions
@@ -5451,7 +5459,7 @@
 /*
   Constructor used to build an event for writing to the binary log.
  */
-#ifndef MYSQL_CLIENT
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
 Update_rows_log_event::
 Update_rows_log_event(THD* thd_arg, TABLE* tbl_arg, ulong tid, 
 		      bitvector const& cols,
@@ -5460,7 +5468,7 @@
   m_memory(NULL), m_key(NULL)
 {
 }
-#endif
+#endif // !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
 
 /*
   Constructor used by slave to read the event from the binary log.
@@ -5468,10 +5476,10 @@
 Update_rows_log_event::
 Update_rows_log_event(const char* buf, uint event_len,
 		      const Format_description_log_event *description_event)
-#ifdef MYSQL_CLIENT
+#if defined(MYSQL_CLIENT) || !defined(HAVE_REPLICATION)
   : Rows_log_event(buf, event_len, UPDATE_ROWS_EVENT, description_event)
 #else
-  : Rows_log_event(buf, event_len, UPDATE_ROWS_EVENT, description_event),
+  : Rows_log_event(buf, event_len, UPDATE_ROWS_EVENT, description_event), 
     m_memory(NULL), m_key(NULL)
 #endif
 {
@@ -5479,7 +5487,7 @@
   DBUG_VOID_RETURN;
 }
 
-#ifndef MYSQL_CLIENT
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
 int Update_rows_log_event::
 do_before_row_operations(TABLE* table)
 {
@@ -5614,5 +5622,5 @@
   DBUG_PRINT("return", ("error = %d", error));
   DBUG_RETURN(error);
 }
-#endif
+#endif // !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
 

--- 1.107/sql/log_event.h	2005-03-21 19:53:26 +01:00
+++ 1.108/sql/log_event.h	2005-03-23 11:15:21 +01:00
@@ -641,6 +641,7 @@
   /* returns the human readable name of the event's type */
   const char* get_type_str();
 
+#ifndef MYSQL_CLIENT
   /*
     Predicate to check if this event should be written to the binary
     log.  This function is called by MYSQL_LOG to decide if this event
@@ -668,8 +669,10 @@
   bool can_be_cached() const {
       return do_can_be_cached();
   }
+#endif
 
 private:
+#ifndef MYSQL_CLIENT
   /*
     Primitive for testing if the event should be written to the binary log.
     The subclasses should override this if they do not want to be written to
@@ -688,6 +691,7 @@
   virtual bool do_can_be_cached() const {
     return true;
   }
+#endif
 };
 
 /*
@@ -1631,8 +1635,10 @@
   virtual bool write_data_body(IO_CACHE* file);
 
 #ifndef MYSQL_CLIENT
+#ifdef HAVE_REPLICATION
   virtual int exec_event(struct st_relay_log_info* rli);
 #endif
+#endif
 
 #ifdef MYSQL_CLIENT
   virtual void print(FILE* file, bool short_form = 0, 
@@ -1700,8 +1706,10 @@
   }
 
 #ifndef MYSQL_CLIENT
+#ifdef HAVE_REPLICATION
   virtual int exec_event(struct st_relay_log_info* rli);
 #endif
+#endif
 
 #ifdef MYSQL_CLIENT
   virtual void print(FILE* file, bool short_form = 0, 
@@ -1768,6 +1776,7 @@
     return opt_binlog_row_level && m_table->file->has_transactions();
   }
 
+#ifdef HAVE_REPLICATION
   /*
     Primitive to prepare for a sequence of row executions.
 
@@ -1829,6 +1838,7 @@
   */
   virtual int do_exec_row(TABLE* table, st_relay_log_info* rli) = 0;
 #endif
+#endif
 };
 
 
@@ -1863,7 +1873,7 @@
   void print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info);
 #endif
 
-#ifndef MYSQL_CLIENT
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
   gptr  m_memory;
   byte* m_search_record;
 
@@ -1905,7 +1915,7 @@
   virtual Log_event_type get_type_code() { return UPDATE_ROWS_EVENT; }
   virtual bool is_valid() const { return 1; }
 
-#ifndef MYSQL_CLIENT
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
   gptr  m_memory;
   byte* m_key;
   byte* m_search_record;
@@ -1914,7 +1924,7 @@
   virtual void        do_after_row_operations(TABLE* table);
   virtual char const* do_prepare_row(THD*, TABLE*, char const* row_start);
   virtual int         do_exec_row(TABLE* table, st_relay_log_info* rli);
-#endif
+#endif // !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
 };
 
 /*****************************************************************************
@@ -1956,7 +1966,7 @@
   virtual Log_event_type get_type_code() { return DELETE_ROWS_EVENT; }
   virtual bool is_valid() const { return 1; }
 
-#ifndef MYSQL_CLIENT
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
   gptr  m_memory;
   byte* m_key;
   byte* m_search_record;

--- 1.172/sql/sql_class.cc	2005-03-21 19:32:01 +01:00
+++ 1.173/sql/sql_class.cc	2005-03-23 11:15:21 +01:00
@@ -1841,6 +1841,8 @@
     the columns suppled to the function.
  */
 
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
+
 template <class RowsEventT>
 Rows_log_event* THD::
 prepare_pending(TABLE* table, uint32 server_id, 
@@ -1905,7 +1907,6 @@
 template Rows_log_event* THD::
 prepare_pending<Update_rows_log_event>(TABLE*, uint32, bitvector const&,
size_t);
 
-
 int THD::
 flush_and_set_pending_event(Rows_log_event* event)
 {
@@ -1931,3 +1932,6 @@
   DBUG_PRINT("exit", ("0"));
   DBUG_RETURN(0);		// All OK
 }
+
+#endif // !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
+

--- 1.227/sql/sql_class.h	2005-03-21 19:32:02 +01:00
+++ 1.228/sql/sql_class.h	2005-03-23 11:15:21 +01:00
@@ -256,10 +256,11 @@
   void unlog(ulong cookie, my_xid xid);
   int recover(IO_CACHE *log, Format_description_log_event *fdle);
 
+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
   // This will return a table id for the table. If the table is not known, a
   // new table id will be invented and returned. 
   ulong get_table_id(TABLE* table);
-
+#endif // !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
   /*
      These describe the log's format. This is used only for relay logs.
      _for_exec is used by the SQL thread, _for_queue by the I/O thread. It's
Thread
bk commit into 5.1 tree (mats:1.1829)Mats Kindahl23 Mar