List:Commits« Previous MessageNext Message »
From:Chad MILLER Date:November 10 2007 2:29am
Subject:bk commit into 5.1 tree (cmiller:1.2491)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of cmiller. When cmiller 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@stripped, 2007-11-09 20:29:02-05:00, cmiller@stripped +2 -0
  Don't start profiling too soon.  Begin timing when the packet is 
  read.
  
  Do not store profiling information when there is no query text.  We
  don't wish to capture non-COM_QUERY packets.

  sql/sql_parse.cc@stripped, 2007-11-09 20:28:59-05:00, cmiller@stripped +6 -4
    Start profiling immediately after a command packet is read from 
    the network.

  sql/sql_profile.cc@stripped, 2007-11-09 20:29:00-05:00, cmiller@stripped +1 -0
    Do not store items for which there is no query, i.e., protocol API 
    calls (non-COM_QUERY) and such.

diff -Nrup a/sql/sql_parse.cc b/sql/sql_parse.cc
--- a/sql/sql_parse.cc	2007-11-09 14:55:28 -05:00
+++ b/sql/sql_parse.cc	2007-11-09 20:28:59 -05:00
@@ -668,9 +668,6 @@ bool do_command(THD *thd)
   enum enum_server_command command;
   DBUG_ENTER("do_command");
 
-#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
-  thd->profiling.start_new_query();
-#endif
   /*
     indicator of uninitialized lex => normal flow of errors handling
     (see my_message_sql)
@@ -688,7 +685,12 @@ bool do_command(THD *thd)
   thd->clear_error();				// Clear error message
 
   net_new_transaction(net);
-  if ((packet_length=my_net_read(net)) == packet_error)
+
+  packet_length= my_net_read(net);
+#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
+  thd->profiling.start_new_query();
+#endif
+  if (packet_length == packet_error)
   {
     DBUG_PRINT("info",("Got error %d reading command from socket %s",
 		       net->error,
diff -Nrup a/sql/sql_profile.cc b/sql/sql_profile.cc
--- a/sql/sql_profile.cc	2007-11-09 14:45:41 -05:00
+++ b/sql/sql_profile.cc	2007-11-09 20:29:00 -05:00
@@ -378,6 +378,7 @@ void PROFILING::finish_current_query()
 
     if ((enabled) &&                                    /* ON at start? */
         ((thd->options & OPTION_PROFILING) != 0) &&   /* and ON at end? */
+        (current->query_source != NULL) &&
         (! current->entries.is_empty()))
     {
       current->profiling_query_id= next_profile_id();   /* assign an id */
Thread
bk commit into 5.1 tree (cmiller:1.2491)Chad MILLER10 Nov