1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Fixed Bug#11226 and reverted fix for Bug#6993.

Using 8 bytes for data pointer does not work at least on
all computers. The result may become 0 or negative number.
(mysqld, myisamchk)
 


myisam/mi_create.c:
  Fixed Bug#11226, "Dynamic table >4GB issue".
mysql-test/r/variables.result:
  Restricted myisam_data_pointer_size back to 7.
mysql-test/t/variables.test:
  Restricted myisam_data_pointer_size back to 7.
sql/mysqld.cc:
  Restricted myisam_data_pointer_size back to 7.
This commit is contained in:
unknown
2005-06-30 16:13:22 +03:00
parent 3378673653
commit 5a13f2a8a6
4 changed files with 11 additions and 8 deletions

View File

@ -194,11 +194,10 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
test(test_all_bits(options, HA_OPTION_CHECKSUM | HA_PACK_RECORD)); test(test_all_bits(options, HA_OPTION_CHECKSUM | HA_PACK_RECORD));
min_pack_length+=packed; min_pack_length+=packed;
if (!ci->data_file_length) if (!ci->data_file_length && ci->max_rows)
{ {
if (ci->max_rows == 0 || pack_reclength == INT_MAX32) if (pack_reclength == INT_MAX32 ||
ci->data_file_length= INT_MAX32-1; /* Should be enough */ (~(ulonglong) 0)/ci->max_rows < (ulonglong) pack_reclength)
else if ((~(ulonglong) 0)/ci->max_rows < (ulonglong) pack_reclength)
ci->data_file_length= ~(ulonglong) 0; ci->data_file_length= ~(ulonglong) 0;
else else
ci->data_file_length=(ulonglong) ci->max_rows*pack_reclength; ci->data_file_length=(ulonglong) ci->max_rows*pack_reclength;

View File

@ -482,10 +482,10 @@ t1 CREATE TABLE `t1` (
`c3` longtext `c3` longtext
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1; drop table t1;
SET GLOBAL MYISAM_DATA_POINTER_SIZE= 8; SET GLOBAL MYISAM_DATA_POINTER_SIZE= 7;
SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE'; SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE';
Variable_name Value Variable_name Value
myisam_data_pointer_size 8 myisam_data_pointer_size 7
SET GLOBAL table_cache=-1; SET GLOBAL table_cache=-1;
SHOW VARIABLES LIKE 'table_cache'; SHOW VARIABLES LIKE 'table_cache';
Variable_name Value Variable_name Value

View File

@ -363,9 +363,13 @@ drop table t1;
# #
# Bug #6993: myisam_data_pointer_size # Bug #6993: myisam_data_pointer_size
# Wrong bug report, data pointer size must be restricted to 7,
# setting to 8 will not work on all computers, myisamchk and
# the server may see a wrong value, such as 0 or negative number
# if 8 bytes is set.
# #
SET GLOBAL MYISAM_DATA_POINTER_SIZE= 8; SET GLOBAL MYISAM_DATA_POINTER_SIZE= 7;
SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE'; SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE';
# #

View File

@ -5153,7 +5153,7 @@ The minimum value for this variable is 4096.",
"Default pointer size to be used for MyISAM tables.", "Default pointer size to be used for MyISAM tables.",
(gptr*) &myisam_data_pointer_size, (gptr*) &myisam_data_pointer_size,
(gptr*) &myisam_data_pointer_size, 0, GET_ULONG, REQUIRED_ARG, (gptr*) &myisam_data_pointer_size, 0, GET_ULONG, REQUIRED_ARG,
4, 2, 8, 0, 1, 0}, 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,