List:Commits« Previous MessageNext Message »
From:vasil.dimov Date:August 3 2011 4:42pm
Subject:bzr commit into mysql-trunk branch (vasil.dimov:3344) WL#5533
View as plain text  
#At file:///usr/local/devel/bzrroot/server/mysql-trunk/ based on revid:marc.alff@stripped

 3344 Vasil Dimov	2011-08-03
      Implement part of WL#5533 Deprecate features in Fuchsia
      
      Print a deprecation warning if innodb_stats_sample_pages is used.

    modified:
      mysql-test/suite/innodb/r/innodb-analyze.result
      mysql-test/suite/innodb/t/innodb-analyze.test
      mysql-test/suite/sys_vars/r/innodb_stats_sample_pages_basic.result
      storage/innobase/handler/ha_innodb.cc
=== modified file 'mysql-test/suite/innodb/r/innodb-analyze.result'
--- a/mysql-test/suite/innodb/r/innodb-analyze.result	revid:marc.alff@stripped
+++ b/mysql-test/suite/innodb/r/innodb-analyze.result	revid:vasil.dimov@stripped
@@ -1,2 +1,2 @@
 Variable_name	Value
-innodb_stats_sample_pages	1
+innodb_stats_transient_sample_pages	1

=== modified file 'mysql-test/suite/innodb/t/innodb-analyze.test'
--- a/mysql-test/suite/innodb/t/innodb-analyze.test	revid:marc.alff@stripped
+++ b/mysql-test/suite/innodb/t/innodb-analyze.test	revid:vasil.dimov@stripped
@@ -1,6 +1,6 @@
 #
 # Test that mysqld does not crash when running ANALYZE TABLE with
-# different values of the parameter innodb_stats_sample_pages.
+# different values of the parameter innodb_stats_transient_sample_pages.
 #
 
 -- source include/have_innodb.inc
@@ -11,12 +11,12 @@
 -- disable_result_log
 -- enable_warnings
 
-let $sample_pages=`select @@innodb_stats_sample_pages`;
-SET GLOBAL innodb_stats_sample_pages=0;
+let $sample_pages=`select @@innodb_stats_transient_sample_pages`;
+SET GLOBAL innodb_stats_transient_sample_pages=0;
 
 # check that the value has been adjusted to 1
 -- enable_result_log
-SHOW VARIABLES LIKE 'innodb_stats_sample_pages';
+SHOW VARIABLES LIKE 'innodb_stats_transient_sample_pages';
 -- disable_result_log
 
 CREATE TABLE innodb_analyze (
@@ -30,36 +30,36 @@ CREATE TABLE innodb_analyze (
 
 ANALYZE TABLE innodb_analyze;
 
-SET GLOBAL innodb_stats_sample_pages=2;
+SET GLOBAL innodb_stats_transient_sample_pages=2;
 ANALYZE TABLE innodb_analyze;
 
-SET GLOBAL innodb_stats_sample_pages=4;
+SET GLOBAL innodb_stats_transient_sample_pages=4;
 ANALYZE TABLE innodb_analyze;
 
-SET GLOBAL innodb_stats_sample_pages=8;
+SET GLOBAL innodb_stats_transient_sample_pages=8;
 ANALYZE TABLE innodb_analyze;
 
-SET GLOBAL innodb_stats_sample_pages=16;
+SET GLOBAL innodb_stats_transient_sample_pages=16;
 ANALYZE TABLE innodb_analyze;
 
 INSERT INTO innodb_analyze VALUES
 (1,1), (1,1), (1,2), (1,3), (1,4), (1,5),
 (8,1), (8,8), (8,2), (7,1), (1,4), (3,5);
 
-SET GLOBAL innodb_stats_sample_pages=1;
+SET GLOBAL innodb_stats_transient_sample_pages=1;
 ANALYZE TABLE innodb_analyze;
 
-SET GLOBAL innodb_stats_sample_pages=2;
+SET GLOBAL innodb_stats_transient_sample_pages=2;
 ANALYZE TABLE innodb_analyze;
 
-SET GLOBAL innodb_stats_sample_pages=4;
+SET GLOBAL innodb_stats_transient_sample_pages=4;
 ANALYZE TABLE innodb_analyze;
 
-SET GLOBAL innodb_stats_sample_pages=8;
+SET GLOBAL innodb_stats_transient_sample_pages=8;
 ANALYZE TABLE innodb_analyze;
 
-SET GLOBAL innodb_stats_sample_pages=16;
+SET GLOBAL innodb_stats_transient_sample_pages=16;
 ANALYZE TABLE innodb_analyze;
 
 DROP TABLE innodb_analyze;
-EVAL SET GLOBAL innodb_stats_sample_pages=$sample_pages;
+EVAL SET GLOBAL innodb_stats_transient_sample_pages=$sample_pages;

=== modified file 'mysql-test/suite/sys_vars/r/innodb_stats_sample_pages_basic.result'
--- a/mysql-test/suite/sys_vars/r/innodb_stats_sample_pages_basic.result	revid:marc.alff@stripped
+++ b/mysql-test/suite/sys_vars/r/innodb_stats_sample_pages_basic.result	revid:vasil.dimov@stripped
@@ -24,6 +24,8 @@ select * from information_schema.session
 VARIABLE_NAME	VARIABLE_VALUE
 INNODB_STATS_SAMPLE_PAGES	8
 set global innodb_stats_sample_pages=10;
+Warnings:
+Warning	131	Using innodb_stats_sample_pages is deprecated and the variable may be removed in future releases. Please use innodb_stats_transient_sample_pages instead.
 select @@global.innodb_stats_sample_pages;
 @@global.innodb_stats_sample_pages
 10
@@ -44,6 +46,7 @@ ERROR 42000: Incorrect argument type to 
 set global innodb_stats_sample_pages=-7;
 Warnings:
 Warning	1292	Truncated incorrect innodb_stats_sample_pages value: '-7'
+Warning	131	Using innodb_stats_sample_pages is deprecated and the variable may be removed in future releases. Please use innodb_stats_transient_sample_pages instead.
 select @@global.innodb_stats_sample_pages;
 @@global.innodb_stats_sample_pages
 1
@@ -51,6 +54,8 @@ select * from information_schema.global_
 VARIABLE_NAME	VARIABLE_VALUE
 INNODB_STATS_SAMPLE_PAGES	1
 SET @@global.innodb_stats_sample_pages = @start_global_value;
+Warnings:
+Warning	131	Using innodb_stats_sample_pages is deprecated and the variable may be removed in future releases. Please use innodb_stats_transient_sample_pages instead.
 SELECT @@global.innodb_stats_sample_pages;
 @@global.innodb_stats_sample_pages
 8

=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc	revid:marc.alff@stripped
+++ b/storage/innobase/handler/ha_innodb.cc	revid:vasil.dimov@stripped
@@ -11497,6 +11497,39 @@ innodb_change_buffering_update(
 		 *static_cast<const char*const*>(save);
 }
 
+/*************************************************************//**
+Just emit a warning that the usage of the variable is deprecated.
+@return	0 */
+static
+void
+innodb_stats_sample_pages_update(
+/*=============================*/
+	THD*				thd,	/*!< in: thread handle */
+	struct st_mysql_sys_var*	var,	/*!< in: pointer to
+						system variable */
+	void*				var_ptr,/*!< out: where the
+						formal string goes */
+	const void*			save)	/*!< in: immediate result
+						from check function */
+{
+#define STATS_SAMPLE_PAGES_DEPRECATED_MSG \
+	"Using innodb_stats_sample_pages is deprecated and " \
+	"the variable may be removed in future releases. " \
+	"Please use innodb_stats_transient_sample_pages " \
+	"instead."
+
+	push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
+		     HA_ERR_WRONG_COMMAND, STATS_SAMPLE_PAGES_DEPRECATED_MSG);
+
+	ut_print_timestamp(stderr);
+	fprintf(stderr,
+		" InnoDB: Warning: %s\n",
+		STATS_SAMPLE_PAGES_DEPRECATED_MSG);
+
+	srv_stats_transient_sample_pages =
+		*static_cast<const unsigned long long*>(save);
+}
+
 /****************************************************************//**
 Update the monitor counter according to the "set_option",  turn
 on/off or reset specified monitor counter. */
@@ -12316,7 +12349,7 @@ static MYSQL_SYSVAR_BOOL(stats_on_metada
 static MYSQL_SYSVAR_ULONGLONG(stats_sample_pages, srv_stats_transient_sample_pages,
   PLUGIN_VAR_RQCMDARG,
   "Deprecated, use innodb_stats_transient_sample_pages instead",
-  NULL, NULL, 8, 1, ~0ULL, 0);
+  NULL, innodb_stats_sample_pages_update, 8, 1, ~0ULL, 0);
 
 static MYSQL_SYSVAR_ULONGLONG(stats_transient_sample_pages,
   srv_stats_transient_sample_pages,


Attachment: [text/bzr-bundle] bzr/vasil.dimov@oracle.com-20110803163956-294y8ai4uvfa82jw.bundle
Thread
bzr commit into mysql-trunk branch (vasil.dimov:3344) WL#5533vasil.dimov4 Aug