List:Commits« Previous MessageNext Message »
From:Petr Chardin Date:March 13 2006 7:27am
Subject:bk commit into 5.1 tree (petr:1.2167)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of cps. When cps 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.2167 06/03/13 10:27:03 petr@stripped +1 -0
  Merge pchardin@stripped:/home/bk/mysql-5.1-new
  into  mysql.com:/home/cps/mysql/trees/mysql-5.1-virgin

  sql/log.cc
    1.199 06/03/13 10:26:53 petr@stripped +0 -0
    Auto merged

# 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:	petr
# Host:	owlet.
# Root:	/home/cps/mysql/trees/mysql-5.1-virgin/RESYNC

--- 1.198/sql/log.cc	2006-03-08 23:49:43 +03:00
+++ 1.199/sql/log.cc	2006-03-13 10:26:53 +03:00
@@ -288,7 +288,7 @@
   Log command to the general log table
 
   SYNOPSIS
-    log_general_to_csv()
+    log_general()
 
     event_time        command start timestamp
     user_host         the pointer to the string with user@host info
@@ -322,18 +322,32 @@
   if (unlikely(!logger.is_log_tables_initialized))
     return FALSE;
 
+  /*
+    NOTE: we do not call restore_record() here, as all fields are
+    filled by the Logger (=> no need to load default ones).
+  */
+
   /* log table entries are not replicated at the moment */
   tmp_disable_binlog(current_thd);
 
+  /* Set current time. Required for CURRENT_TIMESTAMP to work */
   general_log_thd->start_time= event_time;
-  /* set default value (which is CURRENT_TIMESTAMP) */
-  table->field[0]->set_null();
+
+  /*
+    We do not set a value for table->field[0], as it will use
+    default value (which is CURRENT_TIMESTAMP).
+  */
 
   table->field[1]->store(user_host, user_host_len, client_cs);
+  table->field[1]->set_notnull();
   table->field[2]->store((longlong) thread_id);
+  table->field[2]->set_notnull();
   table->field[3]->store((longlong) server_id);
+  table->field[3]->set_notnull();
   table->field[4]->store(command_type, command_type_len, client_cs);
+  table->field[4]->set_notnull();
   table->field[5]->store(sql_text, sql_text_len, client_cs);
+  table->field[5]->set_notnull();
   table->file->ha_write_row(table->record[0]);
 
   reenable_binlog(current_thd);
@@ -346,7 +360,7 @@
   Log a query to the slow log table
 
   SYNOPSIS
-    log_slow_to_csv()
+    log_slow()
     thd               THD of the query
     current_time      current timestamp
     query_start_arg   command start timestamp
@@ -381,7 +395,7 @@
   TABLE *table= slow_log.table;
   CHARSET_INFO *client_cs= thd->variables.character_set_client;
 
-  DBUG_ENTER("log_slow_to_csv");
+  DBUG_ENTER("log_slow");
 
   /* below should never happen */
   if (unlikely(!logger.is_log_tables_initialized))
@@ -392,12 +406,15 @@
 
   /*
      Set start time for CURRENT_TIMESTAMP to the start of the query.
-     This will be default value for the field
+     This will be default value for the field[0]
   */
   slow_log_thd->start_time= query_start_arg;
+  restore_record(table, s->default_values);    // Get empty record
 
-  /* set default value (which is CURRENT_TIMESTAMP) */
-  table->field[0]->set_null();
+  /*
+    We do not set a value for table->field[0], as it will use
+    default value.
+  */
 
   /* store the value */
   table->field[1]->store(user_host, user_host_len, client_cs);
@@ -421,24 +438,28 @@
     table->field[5]->set_null();
   }
 
+  /* fill database field */
   if (thd->db)
-    /* fill database field */
+  {
     table->field[6]->store(thd->db, thd->db_length, client_cs);
-  else
-    table->field[6]->set_null();
+    table->field[6]->set_notnull();
+  }
 
   if (thd->last_insert_id_used)
+  {
     table->field[7]->store((longlong) thd->current_insert_id);
-  else
-    table->field[7]->set_null();
+    table->field[7]->set_notnull();
+  }
 
   /* set value if we do an insert on autoincrement column */
   if (thd->insert_id_used)
+  {
     table->field[8]->store((longlong) thd->last_insert_id);
-  else
-    table->field[8]->set_null();
+    table->field[8]->set_notnull();
+  }
 
   table->field[9]->store((longlong) server_id);
+  table->field[9]->set_notnull();
 
   /* sql_text */
   table->field[10]->store(sql_text,sql_text_len, client_cs);
Thread
bk commit into 5.1 tree (petr:1.2167)Petr Chardin13 Mar