diff options
author | Sergey Vojtovich <svoj@sun.com> | 2010-03-25 16:08:21 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@sun.com> | 2010-03-25 16:08:21 +0400 |
commit | 412798658a5ede71651ed9112791d055a42edef7 (patch) | |
tree | 8a9f456988aff49c5dd5d915427810c19bad01c7 /mysql-test/suite | |
parent | 7297ec560ee8ab09c796de81b482f73b8f83eb4a (diff) | |
download | mariadb-git-412798658a5ede71651ed9112791d055a42edef7.tar.gz |
BUG#51866 - crash with repair by sort and fulltext keys
Repairing MyISAM table with fulltext indexes and low
myisam_sort_buffer_size may crash the server.
Estimation of number of index entries was done incorrectly,
causing further assertion failure or server crash.
Docs note: min value for myisam_sort_buffer_size has been
changed from 4 to 4096.
mysql-test/r/fulltext.result:
A test case for BUG#51866.
mysql-test/r/myisam.result:
Min value for myisam_sort_buffer_size is 4096.
mysql-test/r/variables.result:
Min value for myisam_sort_buffer_size is 4096.
mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result:
Min value for myisam_sort_buffer_size is 4096.
mysql-test/t/fulltext.test:
A test case for BUG#51866.
sql/mysqld.cc:
Min value for myisam_sort_buffer_size is 4096.
storage/myisam/mi_check.c:
When estimating number of index entries for external
fulltext parser, take into account that key_length may
be bigger than myisam_sort_buffer_size. Reuse logic
from _create_index_by_sort(): force MIN_SORT_BUFFER to
be min value for myisam_sort_buffer_size.
Another problem is that ftkey_nr has no other meaning
than serial number of fulltext index starting with 1.
We can't say if this key using built-in or external
parser basing on it's value. In other words we always
entered if-branch for external parser. At this point,
the only way to check if we use default parser is to
compare keyinfo::parser with &ft_default_parser.
storage/myisam/sort.c:
Get rid of MIN_SORT_MEMORY, use MIN_SORT_BUFFER instead
(defined in myisamdef.h, has the same value and purpose).
Diffstat (limited to 'mysql-test/suite')
-rw-r--r-- | mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result index 2657d599df7..cdc73b99316 100644 --- a/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result +++ b/mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result @@ -8,11 +8,15 @@ SELECT @start_session_value; 8388608 '#--------------------FN_DYNVARS_005_01-------------------------#' SET @@global.myisam_sort_buffer_size = 100; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '100' SET @@global.myisam_sort_buffer_size = DEFAULT; SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size 8388608 SET @@session.myisam_sort_buffer_size = 200; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '200' SET @@session.myisam_sort_buffer_size = DEFAULT; SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size @@ -28,9 +32,11 @@ SELECT @@session.myisam_sort_buffer_size = 8388608; 1 '#--------------------FN_DYNVARS_005_03-------------------------#' SET @@global.myisam_sort_buffer_size = 4; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '4' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 SET @@global.myisam_sort_buffer_size = 4294967295; SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size @@ -41,9 +47,11 @@ SELECT @@global.myisam_sort_buffer_size ; 655354 '#--------------------FN_DYNVARS_005_04-------------------------#' SET @@session.myisam_sort_buffer_size = 4; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '4' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = 4294967295; SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size @@ -58,13 +66,13 @@ Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 SET @@global.myisam_sort_buffer_size = -1024; Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '-1024' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 SET @@global.myisam_sort_buffer_size = 429496729533; Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '429496729533' @@ -101,28 +109,28 @@ Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = -2; Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '-2' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = 65530.34.; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = test; ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 SET @@session.myisam_sort_buffer_size = "test"; ERROR 42000: Incorrect argument type to variable 'myisam_sort_buffer_size' SELECT @@session.myisam_sort_buffer_size ; @@session.myisam_sort_buffer_size -4 +4096 '#------------------FN_DYNVARS_005_06-----------------------#' SELECT @@global.myisam_sort_buffer_size = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES @@ -141,20 +149,24 @@ Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '1' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 SET @@global.myisam_sort_buffer_size = FALSE; Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '0' SELECT @@global.myisam_sort_buffer_size ; @@global.myisam_sort_buffer_size -4 +4096 '#---------------------FN_DYNVARS_001_09----------------------#' SET @@global.myisam_sort_buffer_size = 10; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '10' SELECT @@myisam_sort_buffer_size = @@global.myisam_sort_buffer_size ; @@myisam_sort_buffer_size = @@global.myisam_sort_buffer_size -0 +1 '#---------------------FN_DYNVARS_001_10----------------------#' SET @@myisam_sort_buffer_size = 100; +Warnings: +Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '100' SELECT @@myisam_sort_buffer_size = @@local.myisam_sort_buffer_size ; @@myisam_sort_buffer_size = @@local.myisam_sort_buffer_size 1 @@ -167,7 +179,7 @@ Warnings: Warning 1292 Truncated incorrect myisam_sort_buffer_size value: '1' SELECT @@myisam_sort_buffer_size ; @@myisam_sort_buffer_size -4 +4096 SELECT local.myisam_sort_buffer_size ; ERROR 42S02: Unknown table 'local' in field list SELECT session.myisam_sort_buffer_size ; |