Commit 7df9f7d6 authored by serg@serg.mylan's avatar serg@serg.mylan

myisam_data_pointer_size

parent d2d08960
...@@ -192,7 +192,7 @@ extern uint myisam_block_size; ...@@ -192,7 +192,7 @@ extern uint myisam_block_size;
extern my_bool myisam_flush,myisam_delay_key_write,myisam_single_user; extern my_bool myisam_flush,myisam_delay_key_write,myisam_single_user;
extern my_bool myisam_concurrent_insert; extern my_bool myisam_concurrent_insert;
extern my_off_t myisam_max_temp_length,myisam_max_extra_temp_length; extern my_off_t myisam_max_temp_length,myisam_max_extra_temp_length;
extern ulong myisam_bulk_insert_tree_size; extern ulong myisam_bulk_insert_tree_size, myisam_data_pointer_size;
/* Prototypes for myisam-functions */ /* Prototypes for myisam-functions */
......
...@@ -120,7 +120,7 @@ typedef unsigned long long my_ulonglong; ...@@ -120,7 +120,7 @@ typedef unsigned long long my_ulonglong;
typedef struct st_mysql_rows { typedef struct st_mysql_rows {
struct st_mysql_rows *next; /* list of rows */ struct st_mysql_rows *next; /* list of rows */
MYSQL_ROW data; MYSQL_ROW data;
ulong length; unsigned long length;
} MYSQL_ROWS; } MYSQL_ROWS;
typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; /* offset to current row */ typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; /* offset to current row */
......
...@@ -206,9 +206,9 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, ...@@ -206,9 +206,9 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
3 : 0))); 3 : 0)));
if (options & (HA_OPTION_COMPRESS_RECORD | HA_OPTION_PACK_RECORD)) if (options & (HA_OPTION_COMPRESS_RECORD | HA_OPTION_PACK_RECORD))
pointer=mi_get_pointer_length(ci->data_file_length,4); pointer=mi_get_pointer_length(ci->data_file_length,myisam_data_pointer_size);
else else
pointer=mi_get_pointer_length(ci->max_rows,4); pointer=mi_get_pointer_length(ci->max_rows,myisam_data_pointer_size);
if (!(max_rows=(ulonglong) ci->max_rows)) if (!(max_rows=(ulonglong) ci->max_rows))
max_rows= ((((ulonglong) 1 << (pointer*8)) -1) / min_pack_length); max_rows= ((((ulonglong) 1 << (pointer*8)) -1) / min_pack_length);
......
...@@ -75,7 +75,8 @@ int mi_status(MI_INFO *info, register MI_ISAMINFO *x, uint flag) ...@@ -75,7 +75,8 @@ int mi_status(MI_INFO *info, register MI_ISAMINFO *x, uint flag)
x->filenr = info->dfile; x->filenr = info->dfile;
x->options = share->options; x->options = share->options;
x->create_time=share->state.create_time; x->create_time=share->state.create_time;
x->reflength= mi_get_pointer_length(share->base.max_data_file_length,4); x->reflength= mi_get_pointer_length(share->base.max_data_file_length,
myisam_data_pointer_size);
x->record_offset= ((share->options & x->record_offset= ((share->options &
(HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD)) ? (HA_OPTION_PACK_RECORD | HA_OPTION_COMPRESS_RECORD)) ?
0L : share->base.pack_reclength); 0L : share->base.pack_reclength);
......
...@@ -41,6 +41,7 @@ my_bool myisam_concurrent_insert=0; ...@@ -41,6 +41,7 @@ my_bool myisam_concurrent_insert=0;
my_off_t myisam_max_extra_temp_length= MI_MAX_TEMP_LENGTH; my_off_t myisam_max_extra_temp_length= MI_MAX_TEMP_LENGTH;
my_off_t myisam_max_temp_length= MAX_FILE_SIZE; my_off_t myisam_max_temp_length= MAX_FILE_SIZE;
ulong myisam_bulk_insert_tree_size=8192*1024; ulong myisam_bulk_insert_tree_size=8192*1024;
ulong myisam_data_pointer_size=4;
/* /*
read_vec[] is used for converting between P_READ_KEY.. and SEARCH_ read_vec[] is used for converting between P_READ_KEY.. and SEARCH_
......
...@@ -3661,7 +3661,7 @@ enum options_mysqld ...@@ -3661,7 +3661,7 @@ enum options_mysqld
OPT_MAX_SEEKS_FOR_KEY, OPT_MAX_TMP_TABLES, OPT_MAX_USER_CONNECTIONS, OPT_MAX_SEEKS_FOR_KEY, OPT_MAX_TMP_TABLES, OPT_MAX_USER_CONNECTIONS,
OPT_MAX_LENGTH_FOR_SORT_DATA, OPT_MAX_LENGTH_FOR_SORT_DATA,
OPT_MAX_WRITE_LOCK_COUNT, OPT_BULK_INSERT_BUFFER_SIZE, OPT_MAX_WRITE_LOCK_COUNT, OPT_BULK_INSERT_BUFFER_SIZE,
OPT_MAX_ERROR_COUNT, OPT_MAX_ERROR_COUNT, OPT_MYISAM_DATA_POINTER_SIZE,
OPT_MYISAM_BLOCK_SIZE, OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE, OPT_MYISAM_BLOCK_SIZE, OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE,
OPT_MYISAM_MAX_SORT_FILE_SIZE, OPT_MYISAM_SORT_BUFFER_SIZE, OPT_MYISAM_MAX_SORT_FILE_SIZE, OPT_MYISAM_SORT_BUFFER_SIZE,
OPT_NET_BUFFER_LENGTH, OPT_NET_RETRY_COUNT, OPT_NET_BUFFER_LENGTH, OPT_NET_RETRY_COUNT,
...@@ -4515,6 +4515,11 @@ The minimum value for this variable is 4096.", ...@@ -4515,6 +4515,11 @@ The minimum value for this variable is 4096.",
(gptr*) &opt_myisam_block_size, 0, GET_ULONG, REQUIRED_ARG, (gptr*) &opt_myisam_block_size, 0, GET_ULONG, REQUIRED_ARG,
MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH, MI_MAX_KEY_BLOCK_LENGTH, MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH, MI_MAX_KEY_BLOCK_LENGTH,
0, MI_MIN_KEY_BLOCK_LENGTH, 0}, 0, MI_MIN_KEY_BLOCK_LENGTH, 0},
{"myisam_data_pointer_size", OPT_MYISAM_DATA_POINTER_SIZE,
"Default pointer size to be used for MyISAM tables.",
(gptr*) &myisam_data_pointer_size,
(gptr*) &myisam_data_pointer_size, 0, GET_ULONG, REQUIRED_ARG,
4, 2, 7, 0, 1, 0},
{"myisam_max_extra_sort_file_size", OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE, {"myisam_max_extra_sort_file_size", OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE,
"Used to help MySQL to decide when to use the slow but safe key cache index create method.", "Used to help MySQL to decide when to use the slow but safe key cache index create method.",
(gptr*) &global_system_variables.myisam_max_extra_sort_file_size, (gptr*) &global_system_variables.myisam_max_extra_sort_file_size,
......
...@@ -242,6 +242,8 @@ sys_var_thd_ulong sys_max_tmp_tables("max_tmp_tables", ...@@ -242,6 +242,8 @@ sys_var_thd_ulong sys_max_tmp_tables("max_tmp_tables",
&SV::max_tmp_tables); &SV::max_tmp_tables);
sys_var_long_ptr sys_max_write_lock_count("max_write_lock_count", sys_var_long_ptr sys_max_write_lock_count("max_write_lock_count",
&max_write_lock_count); &max_write_lock_count);
sys_var_long_ptr sys_myisam_data_pointer_size("myisam_data_pointer_size",
&myisam_data_pointer_size);
sys_var_thd_ulonglong sys_myisam_max_extra_sort_file_size("myisam_max_extra_sort_file_size", &SV::myisam_max_extra_sort_file_size, fix_myisam_max_extra_sort_file_size, 1); sys_var_thd_ulonglong sys_myisam_max_extra_sort_file_size("myisam_max_extra_sort_file_size", &SV::myisam_max_extra_sort_file_size, fix_myisam_max_extra_sort_file_size, 1);
sys_var_thd_ulonglong sys_myisam_max_sort_file_size("myisam_max_sort_file_size", &SV::myisam_max_sort_file_size, fix_myisam_max_sort_file_size, 1); sys_var_thd_ulonglong sys_myisam_max_sort_file_size("myisam_max_sort_file_size", &SV::myisam_max_sort_file_size, fix_myisam_max_sort_file_size, 1);
sys_var_thd_ulong sys_myisam_repair_threads("myisam_repair_threads", &SV::myisam_repair_threads); sys_var_thd_ulong sys_myisam_repair_threads("myisam_repair_threads", &SV::myisam_repair_threads);
...@@ -521,6 +523,7 @@ sys_var *sys_variables[]= ...@@ -521,6 +523,7 @@ sys_var *sys_variables[]=
&sys_max_tmp_tables, &sys_max_tmp_tables,
&sys_max_user_connections, &sys_max_user_connections,
&sys_max_write_lock_count, &sys_max_write_lock_count,
&sys_myisam_data_pointer_size,
&sys_myisam_max_extra_sort_file_size, &sys_myisam_max_extra_sort_file_size,
&sys_myisam_max_sort_file_size, &sys_myisam_max_sort_file_size,
&sys_myisam_repair_threads, &sys_myisam_repair_threads,
...@@ -721,6 +724,7 @@ struct show_var_st init_vars[]= { ...@@ -721,6 +724,7 @@ struct show_var_st init_vars[]= {
{sys_max_tmp_tables.name, (char*) &sys_max_tmp_tables, SHOW_SYS}, {sys_max_tmp_tables.name, (char*) &sys_max_tmp_tables, SHOW_SYS},
{sys_max_user_connections.name,(char*) &sys_max_user_connections, SHOW_SYS}, {sys_max_user_connections.name,(char*) &sys_max_user_connections, SHOW_SYS},
{sys_max_write_lock_count.name, (char*) &sys_max_write_lock_count,SHOW_SYS}, {sys_max_write_lock_count.name, (char*) &sys_max_write_lock_count,SHOW_SYS},
{sys_myisam_data_pointer_size.name, (char*) &sys_myisam_data_pointer_size, SHOW_SYS},
{sys_myisam_max_extra_sort_file_size.name, {sys_myisam_max_extra_sort_file_size.name,
(char*) &sys_myisam_max_extra_sort_file_size, (char*) &sys_myisam_max_extra_sort_file_size,
SHOW_SYS}, SHOW_SYS},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment