diff options
author | unknown <tnurnberg@mysql.com/white.intern.koehntopp.de> | 2007-11-30 06:32:04 +0100 |
---|---|---|
committer | unknown <tnurnberg@mysql.com/white.intern.koehntopp.de> | 2007-11-30 06:32:04 +0100 |
commit | 89a208850a714d5653207cffa2d654e86063a7e7 (patch) | |
tree | d9c1641496d14878b7f46428eea3f65b3a7aeb9b /mysql-test | |
parent | 9e6bb07d3845566ffa7274bb14df544c8147f594 (diff) | |
download | mariadb-git-89a208850a714d5653207cffa2d654e86063a7e7.tar.gz |
Bug#31177: Server variables can't be set to their current values
Default values of variables were not subject to upper/lower bounds
and step, while setting variables was. Bounds and step are also
applied to defaults now; defaults are corrected quietly, values
given by the user are corrected, and a correction-warning is thrown
as needed. Lastly, very large values could wrap around, starting
from 0 again. They are bounded at the maximum value for the
respective data-type now if no lower maximum is specified in the
variable's definition.
client/mysql.cc:
correct maxima in options array
client/mysqltest.c:
adjust minimum for "sleep" option so default value is no longer
out of bounds.
include/m_string.h:
ullstr() - the unsigned brother of llstr()
include/my_getopt.h:
Flag if we bounded the value (that is, correct anything aside from
making value a multiple of block-size)
mysql-test/r/delayed.result:
We throw a warning now when we adjust out of range parameters.
mysql-test/r/index_merge.result:
We throw a warning now when we adjust out of range parameters.
mysql-test/r/innodb.result:
We throw a warning now when we adjust out of range parameters.
mysql-test/r/innodb_mysql.result:
We throw a warning now when we adjust out of range parameters.
mysql-test/r/key_cache.result:
We throw a warning now when we adjust out of range parameters.
mysql-test/r/packet.result:
We throw a warning now when we adjust out of range parameters.
mysql-test/r/ps.result:
We throw a warning now when we adjust out of range parameters.
mysql-test/r/subselect.result:
We throw a warning now when we adjust out of range parameters.
mysql-test/r/type_bit.result:
We throw a warning now when we adjust out of range parameters.
mysql-test/r/type_bit_innodb.result:
We throw a warning now when we adjust out of range parameters.
mysql-test/r/variables.result:
correct results: bounds and step apply to variables' default values, too
mysql-test/t/variables.test:
correct results: bounds and step apply to variables' default values, too
mysys/my_getopt.c:
- apply bounds/step to default values of variables (based on work by serg)
- print complaints about incorrect values for variables (truncation etc.,
by requestion of consulting)
- if no lower maximum is specified in variable definition, bound unsigned
values at their maximum to prevent wrap-around
- some calls to error_reporter had a \n, some didn't. remove \n from calls,
let reporter-function handle it, so the default reporter behaves like that
in mysqld
sql/mysql_priv.h:
correct RANGE_ALLOC_BLOCK_SIZE (cleared with monty)
sql/mysqld.cc:
correct maxima to correct data-type.
correct minima where higher than default.
correct range-alloc-block-size.
correct inno variables so GET_* corresponds to actual variable's type.
sql/set_var.cc:
When the new value for a variable is out of bounds, we'll send the
client a warning (but not if the value was simply not a multiple of
'blocksize'). sys_var_thd_ulong had this, sys_var_long_ptr_global
didn't; broken out and streamlined to avoid duplication of code.
strings/llstr.c:
ullstr() - the unsigned brother of llstr()
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/delayed.result | 16 | ||||
-rw-r--r-- | mysql-test/r/index_merge.result | 2 | ||||
-rw-r--r-- | mysql-test/r/innodb.result | 4 | ||||
-rw-r--r-- | mysql-test/r/innodb_mysql.result | 2 | ||||
-rw-r--r-- | mysql-test/r/key_cache.result | 2 | ||||
-rw-r--r-- | mysql-test/r/packet.result | 8 | ||||
-rw-r--r-- | mysql-test/r/ps.result | 2 | ||||
-rw-r--r-- | mysql-test/r/subselect.result | 4 | ||||
-rw-r--r-- | mysql-test/r/type_bit.result | 2 | ||||
-rw-r--r-- | mysql-test/r/type_bit_innodb.result | 2 | ||||
-rw-r--r-- | mysql-test/r/variables.result | 30 | ||||
-rw-r--r-- | mysql-test/t/variables.test | 2 |
12 files changed, 73 insertions, 3 deletions
diff --git a/mysql-test/r/delayed.result b/mysql-test/r/delayed.result index b37679847be..3b2a5027af5 100644 --- a/mysql-test/r/delayed.result +++ b/mysql-test/r/delayed.result @@ -109,12 +109,20 @@ c1 DROP TABLE t1; SET @@auto_increment_offset= @bug20627_old_auto_increment_offset; +Warnings: +Warning 1292 Truncated incorrect auto-increment-offset value: '0' SET @@auto_increment_increment= @bug20627_old_auto_increment_increment; +Warnings: +Warning 1292 Truncated incorrect auto-increment-increment value: '0' SET @@session.auto_increment_offset= @bug20627_old_session_auto_increment_offset; +Warnings: +Warning 1292 Truncated incorrect auto-increment-offset value: '0' SET @@session.auto_increment_increment= @bug20627_old_session_auto_increment_increment; +Warnings: +Warning 1292 Truncated incorrect auto-increment-increment value: '0' SET @bug20830_old_auto_increment_offset= @@auto_increment_offset= 2; SET @bug20830_old_auto_increment_increment= @@ -237,12 +245,20 @@ SUM(c1) DROP TABLE t1; SET @@auto_increment_offset= @bug20830_old_auto_increment_offset; +Warnings: +Warning 1292 Truncated incorrect auto-increment-offset value: '0' SET @@auto_increment_increment= @bug20830_old_auto_increment_increment; +Warnings: +Warning 1292 Truncated incorrect auto-increment-increment value: '0' SET @@session.auto_increment_offset= @bug20830_old_session_auto_increment_offset; +Warnings: +Warning 1292 Truncated incorrect auto-increment-offset value: '0' SET @@session.auto_increment_increment= @bug20830_old_session_auto_increment_increment; +Warnings: +Warning 1292 Truncated incorrect auto-increment-increment value: '0' CREATE TABLE t1(a BIT); INSERT DELAYED INTO t1 VALUES(1); FLUSH TABLE t1; diff --git a/mysql-test/r/index_merge.result b/mysql-test/r/index_merge.result index 15aa636d740..3a152fb2327 100644 --- a/mysql-test/r/index_merge.result +++ b/mysql-test/r/index_merge.result @@ -340,6 +340,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 --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 6082a30bce3..d27bf8df2fa 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1833,6 +1833,8 @@ show variables like "innodb_thread_concurrency"; Variable_name Value innodb_thread_concurrency 8 set global innodb_thread_concurrency=1001; +Warnings: +Warning 1292 Truncated incorrect innodb_thread_concurrency value: '1001' show variables like "innodb_thread_concurrency"; Variable_name Value innodb_thread_concurrency 1000 @@ -1852,6 +1854,8 @@ show variables like "innodb_concurrency_tickets"; Variable_name Value innodb_concurrency_tickets 1000 set global innodb_concurrency_tickets=0; +Warnings: +Warning 1292 Truncated incorrect innodb_concurrency_tickets value: '0' show variables like "innodb_concurrency_tickets"; Variable_name Value innodb_concurrency_tickets 1 diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result index d5f014b6840..b073e4bd6ce 100644 --- a/mysql-test/r/innodb_mysql.result +++ b/mysql-test/r/innodb_mysql.result @@ -712,6 +712,8 @@ INSERT INTO t1(b,c) SELECT b,c FROM t2; UPDATE t2 SET c='2007-01-03'; INSERT INTO t1(b,c) SELECT b,c FROM t2; set @@sort_buffer_size=8192; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '8192' SELECT COUNT(*) FROM t1; COUNT(*) 3072 diff --git a/mysql-test/r/key_cache.result b/mysql-test/r/key_cache.result index 08d8059f61b..9ada5dc0784 100644 --- a/mysql-test/r/key_cache.result +++ b/mysql-test/r/key_cache.result @@ -276,6 +276,8 @@ Variable_name Value Key_blocks_unused KEY_BLOCKS_UNUSED set global keycache2.key_buffer_size=0; set global keycache3.key_buffer_size=100; +Warnings: +Warning 1292 Truncated incorrect key_buffer_size value: '100' set global keycache3.key_buffer_size=0; create table t1 (mytext text, FULLTEXT (mytext)); insert t1 values ('aaabbb'); diff --git a/mysql-test/r/packet.result b/mysql-test/r/packet.result index dfb5595e02d..df0d9ff9adc 100644 --- a/mysql-test/r/packet.result +++ b/mysql-test/r/packet.result @@ -1,7 +1,15 @@ set global max_allowed_packet=100; +Warnings: +Warning 1292 Truncated incorrect max_allowed_packet value: '100' set max_allowed_packet=100; +Warnings: +Warning 1292 Truncated incorrect max_allowed_packet value: '100' set global net_buffer_length=100; +Warnings: +Warning 1292 Truncated incorrect net_buffer_length value: '100' set net_buffer_length=100; +Warnings: +Warning 1292 Truncated incorrect net_buffer_length value: '100' SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len; len 1024 diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 4db588e5cac..648d6468c0a 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -806,6 +806,8 @@ select @@max_prepared_stmt_count; @@max_prepared_stmt_count 0 set global max_prepared_stmt_count=10000000000000000; +Warnings: +Warning 1292 Truncated incorrect max_prepared_stmt_count value: '10000000000000000' select @@max_prepared_stmt_count; @@max_prepared_stmt_count 1048576 diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index be99bdb1afc..42381e2768e 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -3666,6 +3666,8 @@ CREATE TABLE t1 (a int, b int auto_increment, PRIMARY KEY (b)); CREATE TABLE t2 (x int auto_increment, y int, z int, PRIMARY KEY (x), FOREIGN KEY (y) REFERENCES t1 (b)); SET SESSION sort_buffer_size = 32 * 1024; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '32768' SELECT SQL_NO_CACHE COUNT(*) FROM (SELECT a, b, (SELECT x FROM t2 WHERE y=b ORDER BY z DESC LIMIT 1) c FROM t1) t; @@ -4101,6 +4103,8 @@ INSERT INTO `t1` VALUES ('asdf','2007-02-08 01:11:26'); INSERT INTO `t2` VALUES ('abcdefghijk'); INSERT INTO `t2` VALUES ('asdf'); SET session sort_buffer_size=8192; +Warnings: +Warning 1292 Truncated incorrect sort_buffer_size value: '8192' SELECT (SELECT 1 FROM t1 WHERE t1.a=t2.a ORDER BY t1.b LIMIT 1) AS d1 FROM t2; d1 1 diff --git a/mysql-test/r/type_bit.result b/mysql-test/r/type_bit.result index 4c1b80c2fd5..0ee38426fbf 100644 --- a/mysql-test/r/type_bit.result +++ b/mysql-test/r/type_bit.result @@ -269,6 +269,8 @@ a+0 b+0 56 379 68 454 set @@max_length_for_sort_data=0; +Warnings: +Warning 1292 Truncated incorrect max_length_for_sort_data value: '0' select a+0, b+0 from t1 where a > 40 and a < 70 order by 2; a+0 b+0 57 135 diff --git a/mysql-test/r/type_bit_innodb.result b/mysql-test/r/type_bit_innodb.result index c4506231f27..d0cf15e59a5 100644 --- a/mysql-test/r/type_bit_innodb.result +++ b/mysql-test/r/type_bit_innodb.result @@ -269,6 +269,8 @@ a+0 b+0 56 379 68 454 set @@max_length_for_sort_data=0; +Warnings: +Warning 1292 Truncated incorrect max_length_for_sort_data value: '0' select a+0, b+0 from t1 where a > 40 and a < 70 order by 2; a+0 b+0 57 135 diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 47cd96b90b7..9c360ef4ab3 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -214,6 +214,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 @@ -238,7 +240,7 @@ 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 set @@range_alloc_block_size=1024*16; @@ -263,7 +265,7 @@ 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 @@version LIKE 'non-existent'; @@ -321,6 +323,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; @@ -349,17 +353,27 @@ 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=100; 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; @@ -370,17 +384,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 @@ -420,6 +442,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; @@ -570,6 +594,8 @@ SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE'; Variable_name Value myisam_data_pointer_size 7 SET GLOBAL table_cache=-1; +Warnings: +Warning 1292 Truncated incorrect table_cache value: '0' SHOW VARIABLES LIKE 'table_cache'; Variable_name Value table_cache 1 diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index a352665379e..be7e7c2b413 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -126,7 +126,7 @@ set GLOBAL query_cache_size=100000; set GLOBAL myisam_max_sort_file_size=2000000; show global variables like 'myisam_max_sort_file_size'; set GLOBAL myisam_max_sort_file_size=default; ---replace_result 2147483647 FILE_SIZE 9223372036854775807 FILE_SIZE +--replace_result 2147482624 FILE_SIZE 2146435072 FILE_SIZE show variables like 'myisam_max_sort_file_size'; set global net_retry_count=10, session net_retry_count=10; |