MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Ignacio Galarza Date:September 5 2007 8:14pm
Subject:bk commit into 5.0 tree (iggy:1.2522) BUG#23327
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of iggy. When iggy 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-09-05 16:14:40-04:00, iggy@amd64.(none) +3 -0
  Bug#23327 Strange mapping of certain values for system variable
  - Negative values assigned to system variabeles should default 
  to minimum value for that variable. 

  mysql-test/r/variables.result@stripped, 2007-09-05 16:14:38-04:00, iggy@amd64.(none) +14 -0
    Bug#23327 Strange mapping of certain values for system variable
    - Added new result.

  mysql-test/t/variables.test@stripped, 2007-09-05 16:14:38-04:00, iggy@amd64.(none) +12 -0
    Bug#23327 Strange mapping of certain values for system variable
    - Added new test.

  sql/set_var.cc@stripped, 2007-09-05 16:14:38-04:00, iggy@amd64.(none) +2 -1
    Bug#23327 Strange mapping of certain values for system variable
    - Check for negative value before storing in unsigned data type.

diff -Nrup a/mysql-test/r/variables.result b/mysql-test/r/variables.result
--- a/mysql-test/r/variables.result	2007-04-09 08:58:53 -04:00
+++ b/mysql-test/r/variables.result	2007-09-05 16:14:38 -04:00
@@ -791,6 +791,20 @@ ERROR HY000: Variable 'hostname' is a re
 show variables like 'hostname';
 Variable_name	Value
 hostname	#
+set @bug_23327_max_sort_length =@@global.max_sort_length;
+set @@global.max_sort_length=0;
+select @@global.max_sort_length;
+@@global.max_sort_length
+4
+set @@global.max_sort_length=-1;
+select @@global.max_sort_length;
+@@global.max_sort_length
+4
+set @@global.max_sort_length=4+2-7;
+select @@global.max_sort_length;
+@@global.max_sort_length
+4
+set @@global.max_sort_length =@bug_23327_max_sort_length;
 End of 5.0 tests
 set global binlog_cache_size         =@my_binlog_cache_size;
 set global connect_timeout           =@my_connect_timeout;
diff -Nrup a/mysql-test/t/variables.test b/mysql-test/t/variables.test
--- a/mysql-test/t/variables.test	2007-04-09 08:58:53 -04:00
+++ b/mysql-test/t/variables.test	2007-09-05 16:14:38 -04:00
@@ -674,6 +674,18 @@ set @@hostname= "anothername";
 --replace_column 2 #
 show variables like 'hostname';
 
+#
+# Bug#23327 Strange mapping of certain values for system variable
+#
+set @bug_23327_max_sort_length =@@global.max_sort_length;
+set @@global.max_sort_length=0;
+select @@global.max_sort_length;
+set @@global.max_sort_length=-1;
+select @@global.max_sort_length;
+set @@global.max_sort_length=4+2-7;
+select @@global.max_sort_length;
+set @@global.max_sort_length =@bug_23327_max_sort_length;
+
 --echo End of 5.0 tests
 
 # This is at the very after the versioned tests, since it involves doing
diff -Nrup a/sql/set_var.cc b/sql/set_var.cc
--- a/sql/set_var.cc	2007-07-30 11:27:30 -04:00
+++ b/sql/set_var.cc	2007-09-05 16:14:38 -04:00
@@ -1118,7 +1118,8 @@ struct show_var_st init_vars[]= {
 
 bool sys_var::check(THD *thd, set_var *var)
 {
-  var->save_result.ulonglong_value= var->value->val_int();
+  longlong tmp= var->value->val_int();
+  var->save_result.ulonglong_value= (tmp < 0) ? 0 : tmp;
   return 0;
 }
 
Thread
bk commit into 5.0 tree (iggy:1.2522) BUG#23327Ignacio Galarza5 Sep