List:Internals« Previous MessageNext Message »
From:sasha Date:July 23 2001 8:35pm
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-07-23 14:35:25-06:00, sasha@stripped
  clean-up, more work on LOAD DATA INFILE

  sql/log_event.cc
    1.46 01/07/23 14:35:24 sasha@stripped +60 -8
    clean-up, more work on LOAD DATA INFILE

  sql/log_event.h
    1.49 01/07/23 14:35:24 sasha@stripped +4 -0
    more work on LOAD DATA INFILE

# 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.45/sql/log_event.cc	Fri Jul 20 16:22:54 2001
+++ 1.46/sql/log_event.cc	Mon Jul 23 14:35:24 2001
@@ -89,7 +89,9 @@
 
 void Query_log_event::pack_info(String* packet)
 {
-  String tmp;
+  char buf[256];
+  String tmp(buf, sizeof(buf));
+  tmp.length(0);
   if(db && db_len)
   {
    tmp.append("use ");
@@ -104,7 +106,9 @@
 
 void Start_log_event::pack_info(String* packet)
 {
-  String tmp;
+  char buf1[256];
+  String tmp(buf1, sizeof(buf1));
+  tmp.length(0);
   char buf[22];
 
   tmp.append("Server ver: ");
@@ -116,7 +120,9 @@
 
 void Load_log_event::pack_info(String* packet)
 {
-  String tmp;
+  char buf[256];
+  String tmp(buf, sizeof(buf));
+  tmp.length(0);
   if(db && db_len)
   {
    tmp.append("use ");
@@ -190,7 +196,9 @@
 
 void Rotate_log_event::pack_info(String* packet)
 {
-  String tmp;
+  char buf1[256];
+  String tmp(buf1, sizeof(buf1));
+  tmp.length(0);
   char buf[22];
   tmp.append(new_log_ident, ident_len);
   tmp.append(";pos=");
@@ -202,7 +210,9 @@
 
 void Intvar_log_event::pack_info(String* packet)
 {
-  String tmp;
+  char buf1[256];
+  String tmp(buf1, sizeof(buf1));
+  tmp.length(0);
   char buf[22];
   tmp.append(get_var_type_name());
   tmp.append('=');
@@ -212,7 +222,9 @@
 
 void Slave_log_event::pack_info(String* packet)
 {
-  String tmp;
+  char buf1[256];
+  String tmp(buf1, sizeof(buf1));
+  tmp.length(0);
   char buf[22];
   tmp.append("host=");
   tmp.append(master_host);
@@ -967,19 +979,59 @@
 
 int Create_file_log_event::write_data(IO_CACHE* file)
 {
-  return 0;
+  char buf[CREATE_FILE_HEADER_LEN];
+  buf[CF_DB_LEN_OFFSET] = (uchar)db_len;
+  buf[CF_TBL_LEN_OFFSET] = (uchar)tbl_name_len;
+  int4store(buf + CF_FILE_ID_OFFSET, file_id);
+  return my_b_write(file, buf, CREATE_FILE_HEADER_LEN) ||
+     my_b_write(file, db, db_len) ||
+     my_b_write(file, tbl_name, tbl_name_len) ||
+     my_b_write(file, block, block_len);
+}
+
+Create_file_log_event::Create_file_log_event(const char* buf, int len):
+  Log_event(buf),db(0)
+{
+  db_len = (uint)buf[LOG_EVENT_HEADER_LEN + CF_DB_LEN_OFFSET];
+  tbl_name_len = (uint)buf[CF_TBL_LEN_OFFSET + LOG_EVENT_HEADER_LEN];
+  if ((uint)len < db_len + tbl_name_len + CREATE_FILE_EVENT_OVERHEAD)
+    return;
+
+  file_id = uint4korr(buf + LOG_EVENT_HEADER_LEN + CF_FILE_ID_OFFSET);
+  db = (char*)buf + CREATE_FILE_EVENT_OVERHEAD;
+  tbl_name = db + db_len;
+  block = tbl_name + tbl_name_len;
+  block_len = len - (db_len + tbl_name_len + CREATE_FILE_EVENT_OVERHEAD);
 }
-
 #ifdef MYSQL_CLIENT
 void Create_file_log_event::print(FILE* file, bool short_form = 0,
 				  char* last_db = 0)
 {
+  if (short_form)
+    return;
+  print_header(file);
+  fputc('\n', file);
+  fprintf(file, "Create_file: db='%-*s' table='%-*s' file_id=%d,\
+ block_len=%d\n", db_len, db, tbl_name_len, tbl_name, file_id,
+	  block_len);
 }
 #endif
 
 #ifndef MYSQL_CLIENT
 void Create_file_log_event::pack_info(String* packet)
 {
+  char buf1[256];
+  String tmp(buf1, sizeof(buf1));
+  tmp.length(0);
+  char buf[22];
+  tmp.append("db=");
+  tmp.append(db, db_len);
+  tmp.append(";table=");
+  tmp.append(tbl_name, tbl_name_len);
+  tmp.append(";file_id=");
+  tmp.append(llstr(file_id,buf));
+  tmp.append(";block_len=");
+  tmp.append(llstr(block_len,buf));
 }
 #endif  
 

--- 1.48/sql/log_event.h	Fri Jul 20 16:22:54 2001
+++ 1.49/sql/log_event.h	Mon Jul 23 14:35:24 2001
@@ -105,6 +105,10 @@
 #define R_POS_OFFSET       0
 #define R_IDENT_OFFSET     8
 
+#define CF_DB_LEN_OFFSET   0
+#define CF_TBL_LEN_OFFSET  1
+#define CF_FILE_ID_OFFSET  2
+
 #define QUERY_EVENT_OVERHEAD  (LOG_EVENT_HEADER_LEN+QUERY_HEADER_LEN)
 #define QUERY_DATA_OFFSET (LOG_EVENT_HEADER_LEN+QUERY_HEADER_LEN)
 #define ROTATE_EVENT_OVERHEAD (LOG_EVENT_HEADER_LEN+ROTATE_HEADER_LEN)
Thread
bk commit into 4.0 treesasha23 Jul