#At file:///home/hf/work/mysql_common/45702/ based on revid:holyfoot@stripped
2940 Alexey Botchkov 2009-11-05
Bug#45702 Impossibe to specify myisam_sort_buffer > 4GB on 64 bit machines
myisam_sort_buffer_size and related variables became ulonglong.
The limitation of the buffer size is MAX_SIZE_T as the size_t type
specifies the parameter for malloc.
Also the not_partition test fixed as it doesn't actually pass.
per-file comments:
include/myisam.h
Bug#45702 Impossibe to specify myisam_sort_buffer > 4GB on 64 bit machines
buffer size variables became ulonglong
mysql-test/r/not_partition.result
test result updated as the error message changed
mysql-test/t/not_partition.test
error numbers changed so the test should be modified
sql/handler.h
Bug#45702 Impossibe to specify myisam_sort_buffer > 4GB on 64 bit machines
buffer size variables became ulonglong
sql/mysqld.cc
Bug#45702 Impossibe to specify myisam_sort_buffer > 4GB on 64 bit machines
buffer size variables became ulonglong
sql/set_var.cc
Bug#45702 Impossibe to specify myisam_sort_buffer > 4GB on 64 bit machines
buffer size variables became ulonglong
sql/sql_class.h
Bug#45702 Impossibe to specify myisam_sort_buffer > 4GB on 64 bit machines
buffer size variables became ulonglong
sql/sql_sort.h
Bug#45702 Impossibe to specify myisam_sort_buffer > 4GB on 64 bit machines
buffer size variables became ulonglong
storage/myisam/sort.c
Bug#45702 Impossibe to specify myisam_sort_buffer > 4GB on 64 bit machines
variable types changed with the ulonglong
modified:
include/myisam.h
mysql-test/r/not_partition.result
mysql-test/t/not_partition.test
sql/handler.h
sql/mysqld.cc
sql/set_var.cc
sql/sql_class.h
sql/sql_sort.h
storage/myisam/sort.c
=== modified file 'include/myisam.h'
--- a/include/myisam.h 2009-10-15 10:17:32 +0000
+++ b/include/myisam.h 2009-11-05 16:29:23 +0000
@@ -406,7 +406,8 @@ typedef struct st_mi_check_param
ha_checksum record_checksum,glob_crc;
ulonglong use_buffers;
ulong read_buffer_length,write_buffer_length,
- sort_buffer_length,sort_key_blocks;
+ sort_key_blocks;
+ ulonglong sort_buffer_length;
uint out_flag,warning_printed,error_printed,verbose;
uint opt_sort_key,total_files,max_level;
uint testflag, key_cache_block_size;
=== modified file 'mysql-test/r/not_partition.result'
--- a/mysql-test/r/not_partition.result 2009-01-08 14:16:44 +0000
+++ b/mysql-test/r/not_partition.result 2009-11-05 16:29:23 +0000
@@ -52,9 +52,9 @@ joined DATE NOT NULL
)
PARTITION BY KEY(joined)
PARTITIONS 6;
-ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-partition' to have it working
+ERROR HY000: The MySQL server is running with the --skip-partition option so it cannot execute this statement
ALTER TABLE t1 PARTITION BY KEY(joined) PARTITIONS 2;
-ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-partition' to have it working
+ERROR HY000: The MySQL server is running with the --skip-partition option so it cannot execute this statement
drop table t1;
ERROR 42S02: Unknown table 't1'
CREATE TABLE t1 (
@@ -71,7 +71,7 @@ PARTITION p2 VALUES LESS THAN (1980),
PARTITION p3 VALUES LESS THAN (1990),
PARTITION p4 VALUES LESS THAN MAXVALUE
);
-ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-partition' to have it working
+ERROR HY000: The MySQL server is running with the --skip-partition option so it cannot execute this statement
drop table t1;
ERROR 42S02: Unknown table 't1'
CREATE TABLE t1 (id INT, purchased DATE)
@@ -82,7 +82,7 @@ PARTITION p0 VALUES LESS THAN (1990),
PARTITION p1 VALUES LESS THAN (2000),
PARTITION p2 VALUES LESS THAN MAXVALUE
);
-ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-partition' to have it working
+ERROR HY000: The MySQL server is running with the --skip-partition option so it cannot execute this statement
drop table t1;
ERROR 42S02: Unknown table 't1'
create table t1 (a varchar(10) charset latin1 collate latin1_bin);
=== modified file 'mysql-test/t/not_partition.test'
--- a/mysql-test/t/not_partition.test 2009-09-22 21:41:37 +0000
+++ b/mysql-test/t/not_partition.test 2009-11-05 16:29:23 +0000
@@ -31,7 +31,7 @@ ALTER TABLE t1 ENGINE Memory;
ALTER TABLE t1 ADD (new INT);
DROP TABLE t1;
---error ER_FEATURE_DISABLED
+--error ER_OPTION_PREVENTS_STATEMENT
CREATE TABLE t1 (
firstname VARCHAR(25) NOT NULL,
lastname VARCHAR(25) NOT NULL,
@@ -42,13 +42,13 @@ CREATE TABLE t1 (
PARTITION BY KEY(joined)
PARTITIONS 6;
---error ER_FEATURE_DISABLED
+--error ER_OPTION_PREVENTS_STATEMENT
ALTER TABLE t1 PARTITION BY KEY(joined) PARTITIONS 2;
--error ER_BAD_TABLE_ERROR
drop table t1;
---error ER_FEATURE_DISABLED
+--error ER_OPTION_PREVENTS_STATEMENT
CREATE TABLE t1 (
firstname VARCHAR(25) NOT NULL,
lastname VARCHAR(25) NOT NULL,
@@ -66,7 +66,7 @@ PARTITION BY RANGE( YEAR(joined) ) (
--error ER_BAD_TABLE_ERROR
drop table t1;
---error ER_FEATURE_DISABLED
+--error ER_OPTION_PREVENTS_STATEMENT
CREATE TABLE t1 (id INT, purchased DATE)
PARTITION BY RANGE( YEAR(purchased) )
SUBPARTITION BY HASH( TO_DAYS(purchased) )
=== modified file 'sql/handler.h'
--- a/sql/handler.h 2009-10-22 22:30:28 +0000
+++ b/sql/handler.h 2009-11-05 16:29:23 +0000
@@ -1014,7 +1014,7 @@ typedef class Item COND;
typedef struct st_ha_check_opt
{
st_ha_check_opt() {} /* Remove gcc warning */
- ulong sort_buffer_size;
+ ulonglong sort_buffer_size;
uint flags; /* isam layer flags (e.g. for myisamchk) */
uint sql_flags; /* sql layer flags - for something myisamchk cannot do */
KEY_CACHE *key_cache; /* new key cache when changing key cache */
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc 2009-11-03 13:54:41 +0000
+++ b/sql/mysqld.cc 2009-11-05 16:29:23 +0000
@@ -6832,7 +6832,7 @@ The minimum value for this variable is 4
"The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE.",
(uchar**) &global_system_variables.myisam_sort_buff_size,
(uchar**) &max_system_variables.myisam_sort_buff_size, 0,
- GET_ULONG, REQUIRED_ARG, 8192*1024, 4, ~0L, 0, 1, 0},
+ GET_ULL, REQUIRED_ARG, 8192*1024, 4, ~((size_t)0), 0, 1, 0},
{"myisam_use_mmap", OPT_MYISAM_USE_MMAP,
"Use memory mapping for reading and writing MyISAM tables",
(uchar**) &opt_myisam_use_mmap,
=== modified file 'sql/set_var.cc'
--- a/sql/set_var.cc 2009-10-27 09:59:09 +0000
+++ b/sql/set_var.cc 2009-11-05 16:29:23 +0000
@@ -425,7 +425,7 @@ static sys_var_const sys_myisam_recover_
(uchar*)
&myisam_recover_options_str);
static sys_var_thd_ulong sys_myisam_repair_threads(&vars, "myisam_repair_threads", &SV::myisam_repair_threads);
-static sys_var_thd_ulong sys_myisam_sort_buffer_size(&vars, "myisam_sort_buffer_size", &SV::myisam_sort_buff_size);
+static sys_var_thd_ulonglong sys_myisam_sort_buffer_size(&vars, "myisam_sort_buffer_size", &SV::myisam_sort_buff_size);
static sys_var_bool_ptr sys_myisam_use_mmap(&vars, "myisam_use_mmap",
&opt_myisam_use_mmap);
=== modified file 'sql/sql_class.h'
--- a/sql/sql_class.h 2009-10-22 22:30:28 +0000
+++ b/sql/sql_class.h 2009-11-05 16:29:23 +0000
@@ -352,7 +352,7 @@ struct system_variables
ulong min_examined_row_limit;
ulong multi_range_count;
ulong myisam_repair_threads;
- ulong myisam_sort_buff_size;
+ ulonglong myisam_sort_buff_size;
ulong myisam_stats_method;
ulong net_buffer_length;
ulong net_interactive_timeout;
=== modified file 'sql/sql_sort.h'
--- a/sql/sql_sort.h 2009-09-23 21:32:31 +0000
+++ b/sql/sql_sort.h 2009-11-05 16:29:23 +0000
@@ -50,7 +50,7 @@ typedef struct st_buffpek { /* Struktur
uchar *base,*key; /* key pointers */
ha_rows count; /* Number of rows in table */
ulong mem_count; /* numbers of keys in memory */
- ulong max_keys; /* Max keys in buffert */
+ ha_rows max_keys; /* Max keys in buffert */
} BUFFPEK;
struct BUFFPEK_COMPARE_CONTEXT
=== modified file 'storage/myisam/sort.c'
--- a/storage/myisam/sort.c 2009-10-09 16:16:29 +0000
+++ b/storage/myisam/sort.c 2009-11-05 16:29:23 +0000
@@ -58,13 +58,13 @@ static int NEAR_F write_key(MI_SORT_PARA
IO_CACHE *tempfile);
static int NEAR_F write_index(MI_SORT_PARAM *info,uchar * *sort_keys,
uint count);
-static int NEAR_F merge_many_buff(MI_SORT_PARAM *info,uint keys,
+static int NEAR_F merge_many_buff(MI_SORT_PARAM *info,ulonglong keys,
uchar * *sort_keys,
BUFFPEK *buffpek,int *maxbuffer,
IO_CACHE *t_file);
static uint NEAR_F read_to_buffer(IO_CACHE *fromfile,BUFFPEK *buffpek,
uint sort_length);
-static int NEAR_F merge_buffers(MI_SORT_PARAM *info,uint keys,
+static int NEAR_F merge_buffers(MI_SORT_PARAM *info,ulonglong keys,
IO_CACHE *from_file, IO_CACHE *to_file,
uchar * *sort_keys, BUFFPEK *lastbuff,
BUFFPEK *Fb, BUFFPEK *Tb);
@@ -489,7 +489,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_p
{
SORT_INFO *sort_info=sort_param->sort_info;
MI_CHECK *param=sort_info->param;
- ulong UNINIT_VAR(length), keys;
+ ulonglong UNINIT_VAR(length), keys;
ulong *rec_per_key_part=param->rec_per_key_part;
int got_error=sort_info->got_error;
uint i;
@@ -749,7 +749,7 @@ static int NEAR_F write_index(MI_SORT_PA
/* Merge buffers to make < MERGEBUFF2 buffers */
-static int NEAR_F merge_many_buff(MI_SORT_PARAM *info, uint keys,
+static int NEAR_F merge_many_buff(MI_SORT_PARAM *info, ulonglong keys,
uchar **sort_keys, BUFFPEK *buffpek,
int *maxbuffer, IO_CACHE *t_file)
{
@@ -893,12 +893,13 @@ static int NEAR_F write_merge_key(MI_SOR
*/
static int NEAR_F
-merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
+merge_buffers(MI_SORT_PARAM *info, ulonglong keys, IO_CACHE *from_file,
IO_CACHE *to_file, uchar **sort_keys, BUFFPEK *lastbuff,
BUFFPEK *Fb, BUFFPEK *Tb)
{
int error;
- uint sort_length,maxcount;
+ uint sort_length;
+ ulonglong maxcount;
ha_rows count;
my_off_t UNINIT_VAR(to_start_filepos);
uchar *strpos;
Attachment: [text/bzr-bundle] bzr/holyfoot@mysql.com-20091105162923-1wbxyz82fpfqlobb.bundle
| Thread |
|---|
| • bzr commit into mysql-5.5-next-mr-bugfixing branch (holyfoot:2940)Bug#45702 | Alexey Botchkov | 5 Nov |