List:Commits« Previous MessageNext Message »
From:tim Date:October 17 2006 2:15am
Subject:bk commit into 5.0 tree (tsmith:1.2308)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of tim. When tim 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, 2006-10-16 20:15:14-06:00, tsmith@stripped +4 -0
  Merge siva.hindu.god:/usr/home/tim/m/bk/b19764/50
  into  siva.hindu.god:/usr/home/tim/m/bk/tmp/mrgOct16/50
  MERGE: 1.2258.67.3

  mysql-test/r/ps.result@stripped, 2006-10-16 20:15:11-06:00, tsmith@stripped +17 -17
    Manual merge
    MERGE: 1.74.2.1

  mysql-test/t/ps.test@stripped, 2006-10-16 20:15:11-06:00, tsmith@stripped +14 -14
    Manual merge
    MERGE: 1.71.1.1

  sql/sql_parse.cc@stripped, 2006-10-16 20:12:50-06:00, tsmith@stripped +0 -0
    Auto merged
    MERGE: 1.580.1.3

  sql/sql_prepare.cc@stripped, 2006-10-16 20:12:50-06:00, tsmith@stripped +0 -0
    Auto merged
    MERGE: 1.182.1.1

# 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:	tsmith
# Host:	siva.hindu.god
# Root:	/usr/home/tim/m/bk/tmp/mrgOct16/50/RESYNC

--- 1.584/sql/sql_parse.cc	2006-10-16 20:15:21 -06:00
+++ 1.585/sql/sql_parse.cc	2006-10-16 20:15:21 -06:00
@@ -2159,9 +2159,11 @@ void log_slow_statement(THD *thd)
 
     if ((ulong) (thd->start_time - thd->time_after_lock) >
 	thd->variables.long_query_time ||
-	((thd->server_status &
+        (thd->server_status &
 	  (SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED)) &&
-	 (specialflag & SPECIAL_LOG_QUERIES_NOT_USING_INDEXES)))
+        (specialflag & SPECIAL_LOG_QUERIES_NOT_USING_INDEXES) &&
+        /* == SQLCOM_END unless this is a SHOW command */
+        thd->lex->orig_sql_command == SQLCOM_END)
     {
       thd->status_var.long_query_count++;
       mysql_slow_log.write(thd, thd->query, thd->query_length, start_of_query);

--- 1.76/mysql-test/r/ps.result	2006-10-16 20:15:21 -06:00
+++ 1.77/mysql-test/r/ps.result	2006-10-16 20:15:21 -06:00
@@ -1379,4 +1379,21 @@ i
 1
 DEALLOCATE PREPARE stmt;
 DROP TABLE t1, t2;
+flush status;
+prepare sq from 'show status like "slow_queries"';
+execute sq;
+Variable_name	Value
+Slow_queries	0
+prepare no_index from 'select 1 from information_schema.tables limit 1';
+execute sq;
+Variable_name	Value
+Slow_queries	0
+execute no_index;
+1
+1
+execute sq;
+Variable_name	Value
+Slow_queries	1
+deallocate prepare no_index;
+deallocate prepare sq;
 End of 5.0 tests.

--- 1.74/mysql-test/t/ps.test	2006-10-16 20:15:21 -06:00
+++ 1.75/mysql-test/t/ps.test	2006-10-16 20:15:21 -06:00
@@ -1437,4 +1437,18 @@ DEALLOCATE PREPARE stmt;
 DROP TABLE t1, t2;
 
 
+#
+# Bug 19764:  SHOW commands end up in the slow log as table scans
+#
+
+flush status;
+prepare sq from 'show status like "slow_queries"';
+execute sq;
+prepare no_index from 'select 1 from information_schema.tables limit 1';
+execute sq;
+execute no_index;
+execute sq;
+deallocate prepare no_index;
+deallocate prepare sq;
+
 --echo End of 5.0 tests.

--- 1.183/sql/sql_prepare.cc	2006-10-16 20:15:21 -06:00
+++ 1.184/sql/sql_prepare.cc	2006-10-16 20:15:21 -06:00
@@ -2930,6 +2930,12 @@ bool Prepared_statement::execute(String 
   stmt_backup.query_length= thd->query_length;
 
   /*
+    Save orig_sql_command as we use it to disable slow logging for SHOW
+    commands (see log_slow_statement()).
+  */
+  stmt_backup.lex->orig_sql_command= thd->lex->orig_sql_command;
+
+  /*
     At first execution of prepared statement we may perform logical
     transformations of the query tree. Such changes should be performed
     on the parse tree of current prepared statement and new items should
Thread
bk commit into 5.0 tree (tsmith:1.2308)tim17 Oct