List:Commits« Previous MessageNext Message »
From:Tatjana A Nuernberg Date:December 1 2007 6:55pm
Subject:bk commit into 5.1 tree (tnurnberg:1.2616) BUG#31177
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of tnurnberg. When tnurnberg 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-12-01 19:55:06+01:00, tnurnberg@stripped +8 -0
  Bug#31177: Server variables can't be set to their current values
  
  5.1+ specific fixes (plugins etc.)

  include/my_getopt.h@stripped, 2007-12-01 19:55:04+01:00, tnurnberg@stripped +2 -1
    make both ull and ll global

  mysql-test/r/index_merge_myisam.result@stripped, 2007-12-01 19:55:04+01:00, tnurnberg@stripped +2 -0
    we throw warnings to the client, yea, verily

  mysql-test/r/innodb.result@stripped, 2007-12-01 19:55:04+01:00, tnurnberg@stripped +2 -2
    we throw warnings to the client, yea, verily

  mysql-test/r/variables.result@stripped, 2007-12-01 19:55:04+01:00, tnurnberg@stripped +30 -4
    we throw warnings to the client, yea, verily

  mysql-test/t/variables.test@stripped, 2007-12-01 19:55:04+01:00, tnurnberg@stripped +1 -1
    correct result, is multiple of variable's block_size now

  mysys/my_getopt.c@stripped, 2007-12-01 19:55:04+01:00, tnurnberg@stripped +35 -13
    export getopt_ll_limit_value(), check for integer wrap-around
    in it, same as in ull variant.  Only print warnings to reporter
    when caller didn't ask for diagnostics, otherwise assume caller
    will handle any warnings (id est, throw them client-wards)

  sql/mysqld.cc@stripped, 2007-12-01 19:55:04+01:00, tnurnberg@stripped +1 -1
    correct signedness of "concurrent-insert"

  sql/sql_plugin.cc@stripped, 2007-12-01 19:55:04+01:00, tnurnberg@stripped +31 -4
    Throw sys-var out-of-range warnings client-wards for
    plugins, too.

diff -Nrup a/include/my_getopt.h b/include/my_getopt.h
--- a/include/my_getopt.h	2007-11-30 14:52:49 +01:00
+++ b/include/my_getopt.h	2007-12-01 19:55:04 +01:00
@@ -75,7 +75,8 @@ extern void my_getopt_register_get_addr(
 							   const struct my_option *));
 
 ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp,
-                                 bool *fixed);
+                                 bool *fix);
+longlong getopt_ll_limit_value(longlong, const struct my_option *,bool *fix);
 my_bool getopt_compare_strings(const char *s, const char *t, uint length);
 
 C_MODE_END
diff -Nrup a/mysql-test/r/index_merge_myisam.result b/mysql-test/r/index_merge_myisam.result
--- a/mysql-test/r/index_merge_myisam.result	2007-07-18 17:08:02 +02:00
+++ b/mysql-test/r/index_merge_myisam.result	2007-12-01 19:55:04 +01:00
@@ -342,6 +342,8 @@ create table t4 (a int);
 insert into t4 values (1),(4),(3);
 set @save_join_buffer_size=@@join_buffer_size;
 set join_buffer_size= 4000;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '4000'
 explain select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5)
 from t0 as A force index(i1,i2), t0 as B force index (i1,i2)
 where (A.key1 < 500000 or A.key2 < 3)
diff -Nrup a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
--- a/mysql-test/r/innodb.result	2007-11-30 14:52:49 +01:00
+++ b/mysql-test/r/innodb.result	2007-12-01 19:55:04 +01:00
@@ -1793,7 +1793,7 @@ Variable_name	Value
 innodb_thread_concurrency	8
 set global innodb_thread_concurrency=1001;
 Warnings:
-Warning	1292	Truncated incorrect innodb_thread_concurrency value: '1001'
+Warning	1292	Truncated incorrect thread_concurrency value: '1001'
 show variables like "innodb_thread_concurrency";
 Variable_name	Value
 innodb_thread_concurrency	1000
@@ -1814,7 +1814,7 @@ Variable_name	Value
 innodb_concurrency_tickets	1000
 set global innodb_concurrency_tickets=0;
 Warnings:
-Warning	1292	Truncated incorrect innodb_concurrency_tickets value: '0'
+Warning	1292	Truncated incorrect concurrency_tickets value: '0'
 show variables like "innodb_concurrency_tickets";
 Variable_name	Value
 innodb_concurrency_tickets	1
diff -Nrup a/mysql-test/r/variables.result b/mysql-test/r/variables.result
--- a/mysql-test/r/variables.result	2007-11-30 15:04:38 +01:00
+++ b/mysql-test/r/variables.result	2007-12-01 19:55:04 +01:00
@@ -279,6 +279,8 @@ NET_READ_TIMEOUT	600
 NET_RETRY_COUNT	10
 NET_WRITE_TIMEOUT	500
 set net_buffer_length=1;
+Warnings:
+Warning	1292	Truncated incorrect net_buffer_length value: '1'
 show variables like 'net_buffer_length';
 Variable_name	Value
 net_buffer_length	1024
@@ -312,14 +314,14 @@ show variables like '%alloc%';
 Variable_name	Value
 query_alloc_block_size	8192
 query_prealloc_size	8192
-range_alloc_block_size	2048
+range_alloc_block_size	4096
 transaction_alloc_block_size	8192
 transaction_prealloc_size	4096
 select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
 VARIABLE_NAME	VARIABLE_VALUE
 QUERY_ALLOC_BLOCK_SIZE	8192
 QUERY_PREALLOC_SIZE	8192
-RANGE_ALLOC_BLOCK_SIZE	2048
+RANGE_ALLOC_BLOCK_SIZE	4096
 TRANSACTION_ALLOC_BLOCK_SIZE	8192
 TRANSACTION_PREALLOC_SIZE	4096
 set @@range_alloc_block_size=1024*16;
@@ -351,14 +353,14 @@ show variables like '%alloc%';
 Variable_name	Value
 query_alloc_block_size	8192
 query_prealloc_size	8192
-range_alloc_block_size	2048
+range_alloc_block_size	4096
 transaction_alloc_block_size	8192
 transaction_prealloc_size	4096
 select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
 VARIABLE_NAME	VARIABLE_VALUE
 QUERY_ALLOC_BLOCK_SIZE	8192
 QUERY_PREALLOC_SIZE	8192
-RANGE_ALLOC_BLOCK_SIZE	2048
+RANGE_ALLOC_BLOCK_SIZE	4096
 TRANSACTION_ALLOC_BLOCK_SIZE	8192
 TRANSACTION_PREALLOC_SIZE	4096
 SELECT @@version LIKE 'non-existent';
@@ -416,6 +418,8 @@ select @@autocommit, @@big_tables;
 @@autocommit	@@big_tables
 1	1
 set global binlog_cache_size=100;
+Warnings:
+Warning	1292	Truncated incorrect binlog_cache_size value: '100'
 set bulk_insert_buffer_size=100;
 set character set cp1251_koi8;
 set character set default;
@@ -444,6 +448,8 @@ set global flush_time=100;
 set insert_id=1;
 set interactive_timeout=100;
 set join_buffer_size=100;
+Warnings:
+Warning	1292	Truncated incorrect join_buffer_size value: '100'
 set last_insert_id=1;
 set global local_infile=1;
 set long_query_time=0.000001;
@@ -456,12 +462,20 @@ select @@long_query_time;
 100.000001
 set low_priority_updates=1;
 set max_allowed_packet=100;
+Warnings:
+Warning	1292	Truncated incorrect max_allowed_packet value: '100'
 set global max_binlog_cache_size=100;
+Warnings:
+Warning	1292	Truncated incorrect max_binlog_cache_size value: '100'
 set global max_binlog_size=100;
+Warnings:
+Warning	1292	Truncated incorrect max_binlog_size value: '100'
 set global max_connect_errors=100;
 set global max_connections=100;
 set global max_delayed_threads=100;
 set max_heap_table_size=100;
+Warnings:
+Warning	1292	Truncated incorrect max_heap_table_size value: '100'
 set max_join_size=100;
 set max_sort_length=100;
 set max_tmp_tables=100;
@@ -472,17 +486,25 @@ select @@max_user_connections;
 set global max_write_lock_count=100;
 set myisam_sort_buffer_size=100;
 set net_buffer_length=100;
+Warnings:
+Warning	1292	Truncated incorrect net_buffer_length value: '100'
 set net_read_timeout=100;
 set net_write_timeout=100;
 set global query_cache_limit=100;
 set global query_cache_size=100;
 set global query_cache_type=demand;
 set read_buffer_size=100;
+Warnings:
+Warning	1292	Truncated incorrect read_buffer_size value: '100'
 set read_rnd_buffer_size=100;
+Warnings:
+Warning	1292	Truncated incorrect read_rnd_buffer_size value: '100'
 set global rpl_recovery_rank=100;
 set global server_id=100;
 set global slow_launch_time=100;
 set sort_buffer_size=100;
+Warnings:
+Warning	1292	Truncated incorrect sort_buffer_size value: '100'
 set @@max_sp_recursion_depth=10;
 select @@max_sp_recursion_depth;
 @@max_sp_recursion_depth
@@ -522,6 +544,8 @@ set storage_engine=myisam;
 set global thread_cache_size=100;
 set timestamp=1, timestamp=default;
 set tmp_table_size=100;
+Warnings:
+Warning	1292	Truncated incorrect tmp_table_size value: '100'
 set tx_isolation="READ-COMMITTED";
 set wait_timeout=100;
 set log_warnings=1;
@@ -691,6 +715,8 @@ SELECT * FROM INFORMATION_SCHEMA.SESSION
 VARIABLE_NAME	VARIABLE_VALUE
 MYISAM_DATA_POINTER_SIZE	7
 SET GLOBAL table_open_cache=-1;
+Warnings:
+Warning	1292	Truncated incorrect table_open_cache value: '0'
 SHOW VARIABLES LIKE 'table_open_cache';
 Variable_name	Value
 table_open_cache	1
diff -Nrup a/mysql-test/t/variables.test b/mysql-test/t/variables.test
--- a/mysql-test/t/variables.test	2007-11-30 14:52:49 +01:00
+++ b/mysql-test/t/variables.test	2007-12-01 19:55:04 +01:00
@@ -141,7 +141,7 @@ set GLOBAL myisam_max_sort_file_size=200
 show global variables like 'myisam_max_sort_file_size';
 select * from information_schema.global_variables where variable_name like 'myisam_max_sort_file_size';
 set GLOBAL myisam_max_sort_file_size=default;
---replace_result 2147482624 FILE_SIZE 2146435072 FILE_SIZE
+--replace_result 2147483647 FILE_SIZE 2146435072 FILE_SIZE
 show variables like 'myisam_max_sort_file_size';
 --replace_result 2147483647 FILE_SIZE 9223372036854775807 FILE_SIZE
 select * from information_schema.session_variables where variable_name like 'myisam_max_sort_file_size';
diff -Nrup a/mysys/my_getopt.c b/mysys/my_getopt.c
--- a/mysys/my_getopt.c	2007-12-01 15:53:54 +01:00
+++ b/mysys/my_getopt.c	2007-12-01 19:55:04 +01:00
@@ -34,7 +34,6 @@ my_bool getopt_compare_strings(const cha
 			       const char *t,
 			       uint length);
 static longlong getopt_ll(char *arg, const struct my_option *optp, int *err);
-static longlong getopt_ll_limit_value(longlong, const struct my_option *);
 static ulonglong getopt_ull(char *arg, const struct my_option *optp,
 			    int *err);
 static double getopt_double(char *arg, const struct my_option *optp, int *err);
@@ -87,7 +86,7 @@ static void default_reporter(enum loglev
     fprintf(stderr, "%s", "Info: ");
   vfprintf(stderr, format, args);
   va_end(args);
-  fputs('\n', stderr);
+  fputc('\n', stderr);
   fflush(stderr);
 }
 
@@ -785,7 +784,7 @@ static longlong eval_num_suffix(char *ar
 static longlong getopt_ll(char *arg, const struct my_option *optp, int *err)
 {
   longlong num=eval_num_suffix(arg, err, (char*) optp->name);
-  return getopt_ll_limit_value(num, optp);
+  return getopt_ll_limit_value(num, optp, NULL);
 }
 
 /*
@@ -795,11 +794,11 @@ static longlong getopt_ll(char *arg, con
   Returns "fixed" value.
 */
 
-static longlong getopt_ll_limit_value(longlong num,
-                                      const struct my_option *optp)
+longlong getopt_ll_limit_value(longlong num, const struct my_option *optp,
+                               bool *fix)
 {
   longlong old= num;
-  bool trunc= FALSE;
+  bool adjusted= FALSE;
   char buf1[255], buf2[255];
   ulonglong block_size= (optp->block_size ? (ulonglong) optp->block_size : 1L);
 
@@ -807,7 +806,29 @@ static longlong getopt_ll_limit_value(lo
       optp->max_value) /* if max value is not set -> no upper limit */
   {
     num= (ulonglong) optp->max_value;
-    trunc= TRUE;
+    adjusted= TRUE;
+  }
+
+  switch ((optp->var_type & GET_TYPE_MASK)) {
+  case GET_INT:
+    if (num > (longlong) INT_MAX)
+    {
+      num= ((longlong) INT_MAX);
+      adjusted= TRUE;
+    }
+    break;
+  case GET_LONG:
+#if SIZEOF_LONG < SIZEOF_LONG_LONG
+    if (num > (longlong) LONG_MAX)
+    {
+      num= ((longlong) LONG_MAX);
+      adjusted= TRUE;
+    }
+#endif
+    break;
+  default:
+    DBUG_ASSERT((optp->var_type & GET_TYPE_MASK) == GET_LL);
+    break;
   }
 
   num= ((num - optp->sub_size) / block_size);
@@ -816,10 +837,12 @@ static longlong getopt_ll_limit_value(lo
   if (num < optp->min_value)
   {
     num= optp->min_value;
-    trunc= TRUE;
+    adjusted= TRUE;
   }
 
-  if (trunc)
+  if (fix)
+    *fix= adjusted;
+  else if (adjusted)
     my_getopt_error_reporter(WARNING_LEVEL,
                              "option '%s': signed value %s adjusted to %s",
                              optp->name, llstr(old, buf1), llstr(num, buf2));
@@ -888,13 +911,12 @@ ulonglong getopt_ull_limit_value(ulonglo
     adjusted= TRUE;
   }
 
-  if (adjusted)
+  if (fix)
+    *fix= adjusted;
+  else if (adjusted)
     my_getopt_error_reporter(WARNING_LEVEL,
                              "option '%s': unsigned value %s adjusted to %s",
                              optp->name, ullstr(old, buf1), ullstr(num, buf2));
-
-  if (fix)
-    *fix= adjusted;
 
   return num;
 }
diff -Nrup a/sql/mysqld.cc b/sql/mysqld.cc
--- a/sql/mysqld.cc	2007-12-01 15:53:54 +01:00
+++ b/sql/mysqld.cc	2007-12-01 19:55:04 +01:00
@@ -5216,7 +5216,7 @@ struct my_option my_long_options[] =
   {"concurrent-insert", OPT_CONCURRENT_INSERT,
    "Use concurrent insert with MyISAM. Disable with --concurrent-insert=0",
    (uchar**) &myisam_concurrent_insert, (uchar**) &myisam_concurrent_insert,
-   0, GET_LONG, OPT_ARG, 1, 0, 2, 0, 0, 0},
+   0, GET_ULONG, OPT_ARG, 1, 0, 2, 0, 0, 0},
   {"console", OPT_CONSOLE, "Write error output on screen; Don't remove the console window on windows.",
    (uchar**) &opt_console, (uchar**) &opt_console, 0, GET_BOOL, NO_ARG, 0, 0, 0,
    0, 0, 0},
diff -Nrup a/sql/sql_plugin.cc b/sql/sql_plugin.cc
--- a/sql/sql_plugin.cc	2007-10-05 02:34:23 +02:00
+++ b/sql/sql_plugin.cc	2007-12-01 19:55:04 +01:00
@@ -1874,11 +1874,20 @@ err:
 static int check_func_int(THD *thd, struct st_mysql_sys_var *var,
                           void *save, st_mysql_value *value)
 {
+  bool fixed;
   long long tmp;
   struct my_option options;
   value->val_int(value, &tmp);
   plugin_opt_set_limits(&options, var);
-  *(int *)save= (int) getopt_ull_limit_value(tmp, &options);
+  *(int *)save= (int) getopt_ull_limit_value(tmp, &options, &fixed);
+  if (fixed)
+  {
+    char buf[22];
+    push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+                        ER_TRUNCATED_WRONG_VALUE,
+                        ER(ER_TRUNCATED_WRONG_VALUE), var->name,
+                        ullstr(tmp, buf));
+  }
   return (thd->variables.sql_mode & MODE_STRICT_ALL_TABLES) &&
          (*(int *)save != (int) tmp);
 }
@@ -1887,24 +1896,42 @@ static int check_func_int(THD *thd, stru
 static int check_func_long(THD *thd, struct st_mysql_sys_var *var,
                           void *save, st_mysql_value *value)
 {
+  bool fixed;
   long long tmp;
   struct my_option options;
   value->val_int(value, &tmp);
   plugin_opt_set_limits(&options, var);
-  *(long *)save= (long) getopt_ull_limit_value(tmp, &options);
+  *(long *)save= (long) getopt_ull_limit_value(tmp, &options, &fixed);
+  if (fixed)
+  {
+    char buf[22];
+    push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+                        ER_TRUNCATED_WRONG_VALUE,
+                        ER(ER_TRUNCATED_WRONG_VALUE), var->name,
+                        ullstr(tmp, buf));
+  }
   return (thd->variables.sql_mode & MODE_STRICT_ALL_TABLES) &&
          (*(long *)save != (long) tmp);
 }
 
 
 static int check_func_longlong(THD *thd, struct st_mysql_sys_var *var,
-                          void *save, st_mysql_value *value)
+                               void *save, st_mysql_value *value)
 {
+  bool fixed;
   long long tmp;
   struct my_option options;
   value->val_int(value, &tmp);
   plugin_opt_set_limits(&options, var);
-  *(ulonglong *)save= getopt_ull_limit_value(tmp, &options);
+  *(ulonglong *)save= getopt_ull_limit_value(tmp, &options, &fixed);
+  if (fixed)
+  {
+    char buf[22];
+    push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+                        ER_TRUNCATED_WRONG_VALUE,
+                        ER(ER_TRUNCATED_WRONG_VALUE), var->name,
+                        ullstr(tmp, buf));
+  }
   return (thd->variables.sql_mode & MODE_STRICT_ALL_TABLES) &&
          (*(long long *)save != tmp);
 }
Thread
bk commit into 5.1 tree (tnurnberg:1.2616) BUG#31177Tatjana A Nuernberg1 Dec
  • Re: bk commit into 5.1 tree (tnurnberg:1.2616) BUG#31177Sergei Golubchik1 Dec