Commit eaff0f3b authored by marko's avatar marko

branches/zip: ha_innobase::create(): Remove the dependences on

DICT_TF_ZSSIZE_MAX, so that the code can be compiled with a different
uncompressed page size by redefining UNIV_PAGE_SIZE_SHIFT in univ.i.
Currently, the allowed values are 12, 13, or 14 (4k, 8k, 16k).

Make the default compressed page size half the uncompressed page size.
The previous default was 8 kilobytes, which is the same when compiling
with the default 16k uncompressed page size.

rb://50 approved by Pekka Lampio and Sunny Bains.
parent a33bdbe7
...@@ -5973,40 +5973,21 @@ ha_innobase::create( ...@@ -5973,40 +5973,21 @@ ha_innobase::create(
if (create_info->key_block_size if (create_info->key_block_size
|| (create_info->used_fields & HA_CREATE_USED_KEY_BLOCK_SIZE)) { || (create_info->used_fields & HA_CREATE_USED_KEY_BLOCK_SIZE)) {
switch (create_info->key_block_size) { /* Determine the page_zip.ssize corresponding to the
case 1: requested page size (key_block_size) in kilobytes. */
flags = 1 << DICT_TF_ZSSIZE_SHIFT
| DICT_TF_COMPACT ulint ssize, ksize;
| DICT_TF_FORMAT_ZIP ulint key_block_size = create_info->key_block_size;
<< DICT_TF_FORMAT_SHIFT;
break; for (ssize = ksize = 1; ssize <= DICT_TF_ZSSIZE_MAX;
case 2: ssize++, ksize <<= 1) {
flags = 2 << DICT_TF_ZSSIZE_SHIFT if (key_block_size == ksize) {
| DICT_TF_COMPACT flags = ssize << DICT_TF_ZSSIZE_SHIFT
| DICT_TF_FORMAT_ZIP | DICT_TF_COMPACT
<< DICT_TF_FORMAT_SHIFT; | DICT_TF_FORMAT_ZIP
break; << DICT_TF_FORMAT_SHIFT;
case 4: break;
flags = 3 << DICT_TF_ZSSIZE_SHIFT }
| DICT_TF_COMPACT
| DICT_TF_FORMAT_ZIP
<< DICT_TF_FORMAT_SHIFT;
break;
case 8:
flags = 4 << DICT_TF_ZSSIZE_SHIFT
| DICT_TF_COMPACT
| DICT_TF_FORMAT_ZIP
<< DICT_TF_FORMAT_SHIFT;
break;
case 16:
flags = 5 << DICT_TF_ZSSIZE_SHIFT
| DICT_TF_COMPACT
| DICT_TF_FORMAT_ZIP
<< DICT_TF_FORMAT_SHIFT;
break;
#if DICT_TF_ZSSIZE_MAX != 5
# error "DICT_TF_ZSSIZE_MAX != 5"
#endif
} }
if (!srv_file_per_table) { if (!srv_file_per_table) {
...@@ -6058,12 +6039,16 @@ ha_innobase::create( ...@@ -6058,12 +6039,16 @@ ha_innobase::create(
/* No KEY_BLOCK_SIZE */ /* No KEY_BLOCK_SIZE */
if (form->s->row_type == ROW_TYPE_COMPRESSED) { if (form->s->row_type == ROW_TYPE_COMPRESSED) {
/* ROW_FORMAT=COMPRESSED without /* ROW_FORMAT=COMPRESSED without
KEY_BLOCK_SIZE implies KEY_BLOCK_SIZE implies half the
KEY_BLOCK_SIZE=8. */ maximum KEY_BLOCK_SIZE. */
flags = 4 << DICT_TF_ZSSIZE_SHIFT flags = (DICT_TF_ZSSIZE_MAX - 1)
<< DICT_TF_ZSSIZE_SHIFT
| DICT_TF_COMPACT | DICT_TF_COMPACT
| DICT_TF_FORMAT_ZIP | DICT_TF_FORMAT_ZIP
<< DICT_TF_FORMAT_SHIFT; << DICT_TF_FORMAT_SHIFT;
#if DICT_TF_ZSSIZE_MAX < 1
# error "DICT_TF_ZSSIZE_MAX < 1"
#endif
} }
} }
......
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