MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:ramil Date:July 5 2007 10:34am
Subject:bk commit into 5.0 tree (ramil:1.2519) BUG#28808
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of ram. When ram 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-07-05 15:34:12+05:00, ramil@stripped +5 -0
  Fix for bug #28808: log_queries_not_using_indexes variable dynamic change is ignored
  
  Problem: logging queries not using indexes we check a special flag which 
  is set only at the server startup and is not changing with a corresponding
  server variable together.
  
  Fix: check the variable value instead of the flag.
  

  mysql-test/r/show_check.result@stripped, 2007-07-05 15:34:10+05:00, ramil@stripped +30 -0
    Fix for bug #28808: log_queries_not_using_indexes variable dynamic change is ignored
      - test result.

  mysql-test/t/show_check.test@stripped, 2007-07-05 15:34:10+05:00, ramil@stripped +16 -0
    Fix for bug #28808: log_queries_not_using_indexes variable dynamic change is ignored
      - test case.

  sql/mysqld.cc@stripped, 2007-07-05 15:34:10+05:00, ramil@stripped +0 -2
    Fix for bug #28808: log_queries_not_using_indexes variable dynamic change is ignored
      - SPECIAL_LOG_QUERIES_NOT_USING_INDEXES is not used anymore.

  sql/sql_parse.cc@stripped, 2007-07-05 15:34:10+05:00, ramil@stripped +1 -1
    Fix for bug #28808: log_queries_not_using_indexes variable dynamic change is ignored
      - check opt_log_queries_not_using_indexes instead of 
        SPECIAL_LOG_QUERIES_NOT_USING_INDEXES flag.

  sql/unireg.h@stripped, 2007-07-05 15:34:11+05:00, ramil@stripped +1 -1
    Fix for bug #28808: log_queries_not_using_indexes variable dynamic change is ignored
      - SPECIAL_LOG_QUERIES_NOT_USING_INDEXES is not used anymore.

diff -Nrup a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
--- a/mysql-test/r/show_check.result	2007-06-28 14:24:51 +05:00
+++ b/mysql-test/r/show_check.result	2007-07-05 15:34:10 +05:00
@@ -1088,4 +1088,34 @@ DROP TABLE t1;
 DROP VIEW v1;
 DROP PROCEDURE p1;
 DROP FUNCTION f1;
+flush status;
+show variables like "log_queries_not_using_indexes";
+Variable_name	Value
+log_queries_not_using_indexes	ON
+select 1 from information_schema.tables limit 1;
+1
+1
+show status like 'slow_queries';
+Variable_name	Value
+Slow_queries	1
+set global log_queries_not_using_indexes=OFF;
+show variables like "log_queries_not_using_indexes";
+Variable_name	Value
+log_queries_not_using_indexes	OFF
+select 1 from information_schema.tables limit 1;
+1
+1
+show status like 'slow_queries';
+Variable_name	Value
+Slow_queries	1
+set global log_queries_not_using_indexes=ON;
+show variables like "log_queries_not_using_indexes";
+Variable_name	Value
+log_queries_not_using_indexes	ON
+select 1 from information_schema.tables limit 1;
+1
+1
+show status like 'slow_queries';
+Variable_name	Value
+Slow_queries	2
 End of 5.0 tests
diff -Nrup a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
--- a/mysql-test/t/show_check.test	2007-06-28 14:24:51 +05:00
+++ b/mysql-test/t/show_check.test	2007-07-05 15:34:10 +05:00
@@ -766,4 +766,20 @@ DROP VIEW v1;
 DROP PROCEDURE p1;
 DROP FUNCTION f1;
 
+#
+# Bug #28808: log_queries_not_using_indexes variable dynamic change is ignored
+#
+flush status;
+show variables like "log_queries_not_using_indexes";
+select 1 from information_schema.tables limit 1;
+show status like 'slow_queries';
+set global log_queries_not_using_indexes=OFF;
+show variables like "log_queries_not_using_indexes";
+select 1 from information_schema.tables limit 1;
+show status like 'slow_queries';
+set global log_queries_not_using_indexes=ON;
+show variables like "log_queries_not_using_indexes";
+select 1 from information_schema.tables limit 1;
+show status like 'slow_queries';
+
 --echo End of 5.0 tests
diff -Nrup a/sql/mysqld.cc b/sql/mysqld.cc
--- a/sql/mysqld.cc	2007-06-21 07:30:08 +05:00
+++ b/sql/mysqld.cc	2007-07-05 15:34:10 +05:00
@@ -7461,8 +7461,6 @@ static void get_options(int argc,char **
 
   if (opt_short_log_format)
     opt_specialflag|= SPECIAL_SHORT_LOG_FORMAT;
-  if (opt_log_queries_not_using_indexes)
-    opt_specialflag|= SPECIAL_LOG_QUERIES_NOT_USING_INDEXES;
 
   if (init_global_datetime_format(MYSQL_TIMESTAMP_DATE,
 				  &global_system_variables.date_format) ||
diff -Nrup a/sql/sql_parse.cc b/sql/sql_parse.cc
--- a/sql/sql_parse.cc	2007-07-02 03:01:02 +05:00
+++ b/sql/sql_parse.cc	2007-07-05 15:34:10 +05:00
@@ -2207,7 +2207,7 @@ void log_slow_statement(THD *thd)
 	thd->variables.long_query_time ||
         (thd->server_status &
 	  (SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED)) &&
-        (specialflag & SPECIAL_LOG_QUERIES_NOT_USING_INDEXES) &&
+        opt_log_queries_not_using_indexes &&
         /* == SQLCOM_END unless this is a SHOW command */
         thd->lex->orig_sql_command == SQLCOM_END)
     {
diff -Nrup a/sql/unireg.h b/sql/unireg.h
--- a/sql/unireg.h	2007-06-07 14:50:20 +05:00
+++ b/sql/unireg.h	2007-07-05 15:34:11 +05:00
@@ -120,7 +120,7 @@
 #define SPECIAL_NO_HOST_CACHE	512		/* Don't cache hosts */
 #define SPECIAL_SHORT_LOG_FORMAT 1024
 #define SPECIAL_SAFE_MODE	2048
-#define SPECIAL_LOG_QUERIES_NOT_USING_INDEXES 4096 /* Log q not using indexes */
+#define SPECIAL_LOG_QUERIES_NOT_USING_INDEXES 4096 /* Obsolete */
 
 	/* Extern defines */
 #define store_record(A,B) bmove_align((A)->B,(A)->record[0],(size_t) (A)->s->reclength)
Thread
bk commit into 5.0 tree (ramil:1.2519) BUG#28808ramil5 Jul
  • Re: bk commit into 5.0 tree (ramil:1.2519) BUG#28808Sergei Golubchik8 Jul