#At file:///home/tomas/mysql_src/mysql-5.1-telco-6.3/
2729 Tomas Ulin 2008-10-31
Bug #40457 not possible to set ndb_optimized_node_selection in session
added:
mysql-test/suite/ndb/r/ndb_optimized_node_selection.result
mysql-test/suite/ndb/t/ndb_optimized_node_selection.test
modified:
sql/mysqld.cc
=== added file 'mysql-test/suite/ndb/r/ndb_optimized_node_selection.result'
--- a/mysql-test/suite/ndb/r/ndb_optimized_node_selection.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/r/ndb_optimized_node_selection.result 2008-10-31 14:22:11 +0000
@@ -0,0 +1,29 @@
+SET @global_start_value = @@global.ndb_optimized_node_selection;
+SELECT @global_start_value;
+@global_start_value
+3
+set session ndb_optimized_node_selection=3;
+show variables like 'ndb_optimized_node_selection';
+Variable_name Value
+ndb_optimized_node_selection 3
+set session ndb_optimized_node_selection=0;
+show variables like 'ndb_optimized_node_selection';
+Variable_name Value
+ndb_optimized_node_selection 0
+set session ndb_optimized_node_selection=4;
+Warnings:
+Warning 1292 Truncated incorrect ndb_optimized_node_selection value: '4'
+show variables like 'ndb_optimized_node_selection';
+Variable_name Value
+ndb_optimized_node_selection 3
+set global ndb_optimized_node_selection=1;
+show variables like 'ndb_optimized_node_selection';
+Variable_name Value
+ndb_optimized_node_selection 3
+show variables like 'ndb_optimized_node_selection';
+Variable_name Value
+ndb_optimized_node_selection 1
+set global ndb_optimized_node_selection=3;
+SELECT @@global.ndb_optimized_node_selection;
+@@global.ndb_optimized_node_selection
+3
=== added file 'mysql-test/suite/ndb/t/ndb_optimized_node_selection.test'
--- a/mysql-test/suite/ndb/t/ndb_optimized_node_selection.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ndb/t/ndb_optimized_node_selection.test 2008-10-31 14:22:11 +0000
@@ -0,0 +1,32 @@
+-- source include/have_ndb.inc
+
+# store start value
+SET @global_start_value = @@global.ndb_optimized_node_selection;
+SELECT @global_start_value;
+
+# max value
+set session ndb_optimized_node_selection=3;
+show variables like 'ndb_optimized_node_selection';
+
+# min value
+set session ndb_optimized_node_selection=0;
+show variables like 'ndb_optimized_node_selection';
+
+# out of range
+set session ndb_optimized_node_selection=4;
+show variables like 'ndb_optimized_node_selection';
+
+# global
+set global ndb_optimized_node_selection=1;
+show variables like 'ndb_optimized_node_selection';
+
+# check it
+--connect (another_con, localhost, root,,)
+--connection another_con
+show variables like 'ndb_optimized_node_selection';
+
+# reset
+set global ndb_optimized_node_selection=3;
+# does not work for some reason
+#SET @@global.ndb_optimized_node_selection = @global_start_value;
+SELECT @@global.ndb_optimized_node_selection;
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc 2008-10-28 19:40:45 +0000
+++ b/sql/mysqld.cc 2008-10-31 14:22:11 +0000
@@ -6058,7 +6058,7 @@ master-ssl",
{"ndb-optimized-node-selection", OPT_NDB_OPTIMIZED_NODE_SELECTION,
"Select nodes for transactions in a more optimal way.",
(uchar**) &global_system_variables.ndb_optimized_node_selection,
- (uchar**) &global_system_variables.ndb_optimized_node_selection,
+ (uchar**) &max_system_variables.ndb_optimized_node_selection,
0, GET_ULONG, OPT_ARG, 3, 0, 3, 0, 0, 0},
{"ndb-cache-check-time", OPT_NDB_CACHE_CHECK_TIME,
"A dedicated thread is created to, at the given millisecons interval, invalidate the
query cache if another MySQL server in the cluster has changed the data in the
database.",
| Thread |
|---|
| • bzr commit into mysql-5.1 branch (tomas.ulin:2729) Bug#40457 | Tomas Ulin | 3 Nov |