summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorramil/ram@ramil.myoffice.izhnet.ru <>2007-07-09 10:17:04 +0500
committerramil/ram@ramil.myoffice.izhnet.ru <>2007-07-09 10:17:04 +0500
commita10759d0702c5be6245371f98b927ee246061702 (patch)
tree602477ef6c98590359726f0f6f09c068b0e5b98f
parent483bd10de84a653038266c860d356d3dc0020fca (diff)
parentfca06fbc68215fec57834d39bff2f243f1b519cb (diff)
downloadmariadb-git-a10759d0702c5be6245371f98b927ee246061702.tar.gz
Merge mysql.com:/home/ram/work/mysql-5.0-maint
into mysql.com:/home/ram/work/b28808/b28808.5.0
-rw-r--r--mysql-test/r/show_check.result30
-rw-r--r--mysql-test/t/show_check.test16
-rw-r--r--sql/mysqld.cc2
-rw-r--r--sql/sql_parse.cc2
-rw-r--r--sql/unireg.h2
5 files changed, 48 insertions, 4 deletions
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index e2450c98202..e4cdd4f183b 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -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 --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index 1db40b0c17c..a58d81a414b 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -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 --git a/sql/mysqld.cc b/sql/mysqld.cc
index afeb3b82a01..61980fa1887 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -7461,8 +7461,6 @@ static void get_options(int argc,char **argv)
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 --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index b65ad705a36..c679135f858 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -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 --git a/sql/unireg.h b/sql/unireg.h
index 0f7c1709c6c..81ca18c1d32 100644
--- a/sql/unireg.h
+++ b/sql/unireg.h
@@ -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)