summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorunknown <ingo@mysql.com>2005-12-02 16:27:18 +0100
committerunknown <ingo@mysql.com>2005-12-02 16:27:18 +0100
commit65d412db6e45423aaf6889fd902ce844d71ff751 (patch)
tree0c8cfb24444d1fcb19a7bf0773a7e6cb7d435c33 /include
parente77da4fc83cc2cbacad9be4c9efc4704224cf660 (diff)
downloadmariadb-git-65d412db6e45423aaf6889fd902ce844d71ff751.tar.gz
Bug#10932 - Building server with key limit of 128, makes test cases fail
Allow for configuration of the maximum number of indexes per table. Added and used a configure.in macro. Replaced fixed limits by the configurable limit. Limited MyISAM indexes to its hard limit. Fixed a bug in opt_range.cc for many indexes with InnoDB. Tested for 2, 63, 64, 65, 127, 128, 129, 255, 256, and 257 indexes. Testing this part of the bugfix requires rebuilding of the server with different options. This cannot be done with our test suite. Therefore I added the necessary test files to the bug report. If you repeat the tests, please note that the ps_* tests fail for everything but 64 indexes. This is because of differences in the meta data, namely field lengths for index names etc. config/ac-macros/misc.m4: Bug#10932 - Building server with key limit of 128, makes test cases fail Allow for configuration of the maximum number of indexes per table. Added a macro for the new build option. configure.in: Bug#10932 - Building server with key limit of 128, makes test cases fail Allow for configuration of the maximum number of indexes per table. Added a call for the new macro. include/myisam.h: Bug#10932 - Building server with key limit of 128, makes test cases fail Allow for configuration of the maximum number of indexes per table. Limit the number of keys for MyISAM to its hard limit. sql/mysql_priv.h: Bug#10932 - Building server with key limit of 128, makes test cases fail Allow for configuration of the maximum number of indexes per table. Stick with the optimized Bitmap<64> if indexes are limited to 64 or lower. Otherwise use a bigger bitmap. It must be defined as a multiple of 8. sql/opt_range.cc: Bug#10932 - Building server with key limit of 128, makes test cases fail Allow for configuration of the maximum number of indexes per table. Initialize an object element to avoid a crash when using InnoDB with many indexes. sql/unireg.h: Bug#10932 - Building server with key limit of 128, makes test cases fail Allow for configuration of the maximum number of indexes per table. Replace the fixed limit by the configurable limit. tests/mysql_client_test.c: Bug#10932 - Building server with key limit of 128, makes test cases fail Allow for configuration of the maximum number of indexes per table. Replace the fixed limit by the configurable limit.
Diffstat (limited to 'include')
-rw-r--r--include/myisam.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/include/myisam.h b/include/myisam.h
index 56717524bb2..96c1e7e192e 100644
--- a/include/myisam.h
+++ b/include/myisam.h
@@ -33,8 +33,6 @@ extern "C" {
#endif
#include "my_handler.h"
- /* defines used by myisam-funktions */
-
/*
There is a hard limit for the maximum number of keys as there are only
8 bits in the index file header for the number of keys in a table.
@@ -45,14 +43,19 @@ extern "C" {
running myisamchk compiled for 128 keys on a table with 255 keys.
*/
#define MI_MAX_POSSIBLE_KEY 255 /* For myisam_chk */
+#if MAX_INDEXES > MI_MAX_POSSIBLE_KEY
+#define MI_MAX_KEY MI_MAX_POSSIBLE_KEY /* Max allowed keys */
+#else
+#define MI_MAX_KEY MAX_INDEXES /* Max allowed keys */
+#endif
+
#define MI_MAX_POSSIBLE_KEY_BUFF (1024+6+6) /* For myisam_chk */
/*
The following defines can be increased if necessary.
- BUT: MI_MAX_KEY must be <= MI_MAX_POSSIBLE_KEY.
+ But beware the dependency of MI_MAX_POSSIBLE_KEY_BUFF and MI_MAX_KEY_LENGTH.
*/
-#define MI_MAX_KEY 64 /* Max allowed keys */
+#define MI_MAX_KEY_LENGTH 1000 /* Max length in bytes */
#define MI_MAX_KEY_SEG 16 /* Max segments for key */
-#define MI_MAX_KEY_LENGTH 1000
#define MI_MAX_KEY_BUFF (MI_MAX_KEY_LENGTH+MI_MAX_KEY_SEG*6+8+8)
#define MI_MAX_MSG_BUF 1024 /* used in CHECK TABLE, REPAIR TABLE */