From: Date: July 29 2005 3:22am Subject: bk commit into 5.0 tree (jimw:1.1896) BUG#10351 List-Archive: http://lists.mysql.com/internals/27705 X-Bug: 10351 Message-Id: <20050729012255.F2449A8A52@rama.trainedmonkey.com> Below is the list of changes that have just been committed into a local 5.0 repository of jimw. When jimw 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 1.1896 05/07/28 18:22:49 jimw@stripped +6 -0 Fix for handling of unsigned long options on 32-bit platforms that allowed unintended overflows. (Bug #10351) sql/set_var.cc 1.127 05/07/28 18:22:46 jimw@stripped +6 -0 On platforms where SIZEOF_LONG != SIZEOF_LONGLONG, make sure to handle max values for ulong-sized options correctly. sql/mysqld.cc 1.487 05/07/28 18:22:45 jimw@stripped +1 -1 Undo unnecessary change to default and max of max_seeks_for_key mysql-test/t/variables.test 1.44 05/07/28 18:22:45 jimw@stripped +3 -5 Fix test for #10351 to test the actual problem mysql-test/t/select_safe.test 1.9 05/07/28 18:22:45 jimw@stripped +0 -1 Remove "SELECT @@MAX_SEEKS_FOR_KEY;" because it depends on size of unsigned long of the system. mysql-test/r/variables.result 1.68 05/07/28 18:22:45 jimw@stripped +6 -10 Update results mysql-test/r/select_safe.result 1.16 05/07/28 18:22:45 jimw@stripped +0 -3 Update results # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: jimw # Host: rama.(none) # Root: /home/jimw/my/mysql-5.0-10351 --- 1.486/sql/mysqld.cc 2005-07-22 16:18:28 -07:00 +++ 1.487/sql/mysqld.cc 2005-07-28 18:22:45 -07:00 @@ -5371,7 +5371,7 @@ "Limit assumed max number of seeks when looking up rows based on a key", (gptr*) &global_system_variables.max_seeks_for_key, (gptr*) &max_system_variables.max_seeks_for_key, 0, GET_ULONG, - REQUIRED_ARG, UINT_MAX32, 1, UINT_MAX32, 0, 1, 0 }, + REQUIRED_ARG, ~0L, 1, ~0L, 0, 1, 0 }, {"max_sort_length", OPT_MAX_SORT_LENGTH, "The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored).", (gptr*) &global_system_variables.max_sort_length, --- 1.15/mysql-test/r/select_safe.result 2005-02-28 09:21:19 -08:00 +++ 1.16/mysql-test/r/select_safe.result 2005-07-28 18:22:45 -07:00 @@ -60,9 +60,6 @@ 3 a 4 a 5 a -SELECT @@MAX_SEEKS_FOR_KEY; -@@MAX_SEEKS_FOR_KEY -4294967295 analyze table t1; Table Op Msg_type Msg_text test.t1 analyze status OK --- 1.67/mysql-test/r/variables.result 2005-07-22 16:18:28 -07:00 +++ 1.68/mysql-test/r/variables.result 2005-07-28 18:22:45 -07:00 @@ -526,14 +526,10 @@ set @@global.error_count=1; ERROR HY000: Variable 'error_count' is a read only variable set @@max_heap_table_size= 4294967296; -select @@max_heap_table_size; -@@max_heap_table_size -4294967296 +select @@max_heap_table_size > 0; +@@max_heap_table_size > 0 +1 set global max_heap_table_size= 4294967296; -select @@max_heap_table_size; -@@max_heap_table_size -4294967296 -set @@max_heap_table_size= 4294967296; -select @@max_heap_table_size; -@@max_heap_table_size -4294967296 +select @@global.max_heap_table_size > 0; +@@global.max_heap_table_size > 0 +1 --- 1.8/mysql-test/t/select_safe.test 2005-02-28 09:21:19 -08:00 +++ 1.9/mysql-test/t/select_safe.test 2005-07-28 18:22:45 -07:00 @@ -56,7 +56,6 @@ # # Test MAX_SEEKS_FOR_KEY # -SELECT @@MAX_SEEKS_FOR_KEY; analyze table t1; insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"); explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; --- 1.43/mysql-test/t/variables.test 2005-07-22 16:18:28 -07:00 +++ 1.44/mysql-test/t/variables.test 2005-07-28 18:22:45 -07:00 @@ -408,11 +408,9 @@ set @@global.error_count=1; # -# Bug #10351: Setting max_heap_table_size to 4G fails +# Bug #10351: Setting ulong variable to > MAX_ULONG fails on 32-bit platform # set @@max_heap_table_size= 4294967296; -select @@max_heap_table_size; +select @@max_heap_table_size > 0; set global max_heap_table_size= 4294967296; -select @@max_heap_table_size; -set @@max_heap_table_size= 4294967296; -select @@max_heap_table_size; +select @@global.max_heap_table_size > 0; --- 1.126/sql/set_var.cc 2005-07-22 16:18:28 -07:00 +++ 1.127/sql/set_var.cc 2005-07-28 18:22:46 -07:00 @@ -1422,6 +1422,12 @@ { ulonglong tmp= var->save_result.ulonglong_value; +#if SIZEOF_LONG != SIZEOF_LONGLONG + /* Avoid overflow on 32-bit platforms. */ + if (tmp > ULONG_MAX) + tmp= ULONG_MAX; +#endif + /* Don't use bigger value than given with --maximum-variable-name=.. */ if ((ulong) tmp > max_system_variables.*offset) tmp= max_system_variables.*offset;