diff options
author | Mikael Ronstrom <mikael@mysql.com> | 2009-06-11 12:07:59 +0200 |
---|---|---|
committer | Mikael Ronstrom <mikael@mysql.com> | 2009-06-11 12:07:59 +0200 |
commit | 506c7fd47dd28e5726852e47d117bfbb37677005 (patch) | |
tree | 796cc97d1d103e18e0672d9b57dee4c54857073c /storage/myisam | |
parent | 4557f4ee9e9975966be6fa7c4fa553b30992ca6d (diff) | |
parent | fbb96b339ae5fcce19446fd27a2fb75e49b960f8 (diff) | |
download | mariadb-git-506c7fd47dd28e5726852e47d117bfbb37677005.tar.gz |
Merge MySQL 5.1.35 into MySQL 5.4
Diffstat (limited to 'storage/myisam')
-rwxr-xr-x | storage/myisam/CMakeLists.txt | 2 | ||||
-rw-r--r-- | storage/myisam/ft_boolean_search.c | 21 | ||||
-rw-r--r-- | storage/myisam/ha_myisam.cc | 91 | ||||
-rw-r--r-- | storage/myisam/mi_check.c | 6 | ||||
-rw-r--r-- | storage/myisam/mi_close.c | 7 | ||||
-rw-r--r-- | storage/myisam/mi_delete.c | 6 | ||||
-rw-r--r-- | storage/myisam/mi_dynrec.c | 6 | ||||
-rw-r--r-- | storage/myisam/mi_locking.c | 2 | ||||
-rw-r--r-- | storage/myisam/mi_open.c | 3 | ||||
-rw-r--r-- | storage/myisam/mi_packrec.c | 18 | ||||
-rw-r--r-- | storage/myisam/mi_search.c | 2 | ||||
-rw-r--r-- | storage/myisam/mi_write.c | 9 | ||||
-rw-r--r-- | storage/myisam/myisamchk.c | 3 | ||||
-rw-r--r-- | storage/myisam/myisamdef.h | 1 | ||||
-rw-r--r-- | storage/myisam/rt_index.c | 10 |
15 files changed, 149 insertions, 38 deletions
diff --git a/storage/myisam/CMakeLists.txt b/storage/myisam/CMakeLists.txt index 4436c8fa7c4..fdc0b64f86a 100755 --- a/storage/myisam/CMakeLists.txt +++ b/storage/myisam/CMakeLists.txt @@ -51,6 +51,8 @@ IF(NOT SOURCE_SUBLIBS) ADD_EXECUTABLE(myisampack myisampack.c) TARGET_LINK_LIBRARIES(myisampack myisam mysys debug dbug strings zlib wsock32) + SET_TARGET_PROPERTIES(myisamchk myisampack PROPERTIES LINK_FLAGS "setargv.obj") + IF(EMBED_MANIFESTS) MYSQL_EMBED_MANIFEST("myisam_ftdump" "asInvoker") MYSQL_EMBED_MANIFEST("myisamchk" "asInvoker") diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c index 66097864622..58363894cff 100644 --- a/storage/myisam/ft_boolean_search.c +++ b/storage/myisam/ft_boolean_search.c @@ -335,7 +335,23 @@ static int _ftb_no_dupes_cmp(void* not_used __attribute__((unused)), return CMP_NUM((*((my_off_t*)a)), (*((my_off_t*)b))); } -/* returns 1 if the search was finished (must-word wasn't found) */ +/* + When performing prefix search (a word with truncation operator), we + must preserve original prefix to ensure that characters which may be + expanded/contracted do not break the prefix. This is done by storing + newly found key immediatly after the original word in ftbw->word + buffer. + + ftbw->word= LENGTH WORD [ LENGTH1 WORD1 ] WEIGHT REFERENCE + LENGTH - 1 byte, length of the WORD + WORD - LENGTH bytes, the word itself + LENGTH1 - 1 byte, length of the WORD1, present in case of prefix search + WORD1 - LENGTH bytes, the word itself, present in case of prefix search + WEIGHT - 4 bytes (HA_FT_WLEN), either weight or number of subkeys + REFERENCE - rec_reflength bytes, pointer to the record + + returns 1 if the search was finished (must-word wasn't found) +*/ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search) { int r; @@ -369,7 +385,8 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search) if (ftbw->docid[0] < max_docid) { sflag|= SEARCH_SAME; - _mi_dpointer(info, (uchar *)(ftbw->word + ftbw->len + HA_FT_WLEN), + _mi_dpointer(info, (uchar*) (lastkey_buf + HA_FT_WLEN + + (ftbw->off ? 0 : lastkey_buf[0] + 1)), max_docid); } r=_mi_search(info, ftbw->keyinfo, (uchar*) lastkey_buf, diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index c6411a6a273..c14aa2254a3 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -44,6 +44,28 @@ TYPELIB myisam_stats_method_typelib= { array_elements(myisam_stats_method_names) - 1, "", myisam_stats_method_names, NULL}; +#ifndef DBUG_OFF +/** + Causes the thread to wait in a spin lock for a query kill signal. + This function is used by the test frame work to identify race conditions. + + The signal is caught and ignored and the thread is not killed. +*/ + +static void debug_wait_for_kill(const char *info) +{ + DBUG_ENTER("debug_wait_for_kill"); + const char *prev_info; + THD *thd; + thd= current_thd; + prev_info= thd_proc_info(thd, info); + while(!thd->killed) + my_sleep(1000); + DBUG_PRINT("info", ("Exit debug_wait_for_kill")); + thd_proc_info(thd, prev_info); + DBUG_VOID_RETURN; +} +#endif /***************************************************************************** ** MyISAM tables @@ -63,7 +85,7 @@ static void mi_check_print_msg(MI_CHECK *param, const char* msg_type, { THD* thd = (THD*)param->thd; Protocol *protocol= thd->protocol; - uint length, msg_length; + size_t length, msg_length; char msgbuf[MI_MAX_MSG_BUF]; char name[NAME_LEN*2+2]; @@ -316,6 +338,7 @@ int table2myisam(TABLE *table_arg, MI_KEYDEF **keydef_out, t2_keys in Number of keys in second table t2_recs in Number of records in second table strict in Strict check switch + table in handle to the table object DESCRIPTION This function compares two MyISAM definitions. By intention it was done @@ -331,6 +354,10 @@ int table2myisam(TABLE *table_arg, MI_KEYDEF **keydef_out, Otherwise 'strict' flag must be set to 1 and it is not required to pass converted dot-frm definition as t1_*. + For compatibility reasons we relax some checks, specifically: + - 4.0 (and earlier versions) always set key_alg to 0. + - 4.0 (and earlier versions) have the same language for all keysegs. + RETURN VALUE 0 - Equal definitions. 1 - Different definitions. @@ -345,10 +372,11 @@ int table2myisam(TABLE *table_arg, MI_KEYDEF **keydef_out, int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo, uint t1_keys, uint t1_recs, MI_KEYDEF *t2_keyinfo, MI_COLUMNDEF *t2_recinfo, - uint t2_keys, uint t2_recs, bool strict) + uint t2_keys, uint t2_recs, bool strict, TABLE *table_arg) { uint i, j; DBUG_ENTER("check_definition"); + my_bool mysql_40_compat= table_arg && table_arg->s->frm_version < FRM_VER_TRUE_VARCHAR; if ((strict ? t1_keys != t2_keys : t1_keys > t2_keys)) { DBUG_PRINT("error", ("Number of keys differs: t1_keys=%u, t2_keys=%u", @@ -387,8 +415,9 @@ int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo, test(t2_keyinfo[i].flag & HA_SPATIAL))); DBUG_RETURN(1); } - if (t1_keyinfo[i].keysegs != t2_keyinfo[i].keysegs || - t1_keyinfo[i].key_alg != t2_keyinfo[i].key_alg) + if ((!mysql_40_compat && + t1_keyinfo[i].key_alg != t2_keyinfo[i].key_alg) || + t1_keyinfo[i].keysegs != t2_keyinfo[i].keysegs) { DBUG_PRINT("error", ("Key %d has different definition", i)); DBUG_PRINT("error", ("t1_keysegs=%d, t1_key_alg=%d", @@ -418,8 +447,9 @@ int check_definition(MI_KEYDEF *t1_keyinfo, MI_COLUMNDEF *t1_recinfo, t1_keysegs_j__type= HA_KEYTYPE_VARBINARY1; /* purecov: inspected */ } - if (t1_keysegs_j__type != t2_keysegs[j].type || - t1_keysegs[j].language != t2_keysegs[j].language || + if ((!mysql_40_compat && + t1_keysegs[j].language != t2_keysegs[j].language) || + t1_keysegs_j__type != t2_keysegs[j].type || t1_keysegs[j].null_bit != t2_keysegs[j].null_bit || t1_keysegs[j].length != t2_keysegs[j].length) { @@ -672,7 +702,8 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked) } if (check_definition(keyinfo, recinfo, table->s->keys, recs, file->s->keyinfo, file->s->rec, - file->s->base.keys, file->s->base.fields, true)) + file->s->base.keys, file->s->base.fields, + true, table)) { /* purecov: begin inspected */ my_errno= HA_ERR_CRASHED; @@ -1390,6 +1421,9 @@ int ha_myisam::enable_indexes(uint mode) { int error; + DBUG_EXECUTE_IF("wait_in_enable_indexes", + debug_wait_for_kill("wait_in_enable_indexes"); ); + if (mi_is_all_keys_active(file->s->state.key_map, file->s->base.keys)) { /* All indexes are enabled already. */ @@ -1503,8 +1537,9 @@ void ha_myisam::start_bulk_insert(ha_rows rows) /* Only disable old index if the table was empty and we are inserting a lot of rows. - We should not do this for only a few rows as this is slower and - we don't want to update the key statistics based of only a few rows. + Note that in end_bulk_insert() we may truncate the table if + enable_indexes() failed, thus it's essential that indexes are + disabled ONLY for an empty table. */ if (file->state->records == 0 && can_enable_indexes && (!rows || rows >= MI_MIN_ROWS_TO_DISABLE_INDEXES)) @@ -1536,8 +1571,27 @@ int ha_myisam::end_bulk_insert() { mi_end_bulk_insert(file); int err=mi_extra(file, HA_EXTRA_NO_CACHE, 0); - return err ? err : can_enable_indexes ? - enable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE) : 0; + if (!err) + { + if (can_enable_indexes) + { + /* + Truncate the table when enable index operation is killed. + After truncating the table we don't need to enable the + indexes, because the last repair operation is aborted after + setting the indexes as active and trying to recreate them. + */ + + if (((err= enable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE)) != 0) && + current_thd->killed) + { + delete_all_rows(); + /* not crashed, despite being killed during repair */ + file->s->state.changed&= ~(STATE_CRASHED|STATE_CRASHED_ON_REPAIR); + } + } + } + return err; } @@ -1561,7 +1615,7 @@ bool ha_myisam::check_and_repair(THD *thd) old_query_length= thd->query_length; pthread_mutex_lock(&LOCK_thread_count); thd->query= table->s->table_name.str; - thd->query_length= table->s->table_name.length; + thd->query_length= (uint) table->s->table_name.length; pthread_mutex_unlock(&LOCK_thread_count); if ((marked_crashed= mi_is_crashed(file)) || check(thd, &check_opt)) @@ -1779,7 +1833,7 @@ int ha_myisam::info(uint flag) if (share->key_parts) memcpy((char*) table->key_info[0].rec_per_key, (char*) misam_info.rec_per_key, - sizeof(table->key_info[0].rec_per_key)*share->key_parts); + sizeof(table->key_info[0].rec_per_key[0])*share->key_parts); if (share->tmp_table == NO_TMP_TABLE) pthread_mutex_unlock(&share->mutex); @@ -1815,6 +1869,8 @@ int ha_myisam::extra(enum ha_extra_function operation) { if ((specialflag & SPECIAL_SAFE_MODE) && operation == HA_EXTRA_KEYREAD) return 0; + if (operation == HA_EXTRA_MMAP && !opt_myisam_use_mmap) + return 0; return mi_extra(file, operation, 0); } @@ -2178,6 +2234,15 @@ my_bool ha_myisam::register_query_cache_table(THD *thd, char *table_name, } } + /* + This query execution might have started after the query cache was flushed + by a concurrent INSERT. In this case, don't cache this statement as the + data file length difference might not be visible yet if the tables haven't + been unlocked by the concurrent insert thread. + */ + if (file->state->uncacheable) + DBUG_RETURN(FALSE); + /* It is ok to try to cache current statement. */ DBUG_RETURN(TRUE); } diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index bdca1a1f0b8..535b4f7f537 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -660,7 +660,7 @@ void mi_collect_stats_nonulls_first(HA_KEYSEG *keyseg, ulonglong *notnull, uchar *key) { uint first_null, kp; - first_null= ha_find_null(keyseg, key) - keyseg; + first_null= (uint) (ha_find_null(keyseg, key) - keyseg); /* All prefix tuples that don't include keypart_{first_null} are not-null tuples (and all others aren't), increment counters for them. @@ -716,7 +716,7 @@ int mi_collect_stats_nonulls_next(HA_KEYSEG *keyseg, ulonglong *notnull, seg= keyseg + diffs[0] - 1; /* Find first NULL in last_key */ - first_null_seg= ha_find_null(seg, last_key + diffs[1]) - keyseg; + first_null_seg= (uint) (ha_find_null(seg, last_key + diffs[1]) - keyseg); for (kp= 0; kp < first_null_seg; kp++) notnull[kp]++; @@ -3952,7 +3952,7 @@ static int sort_ft_key_write(MI_SORT_PARAM *sort_param, const void *a) key_block++; sort_info->key_block=key_block; sort_param->keyinfo=& sort_info->info->s->ft2_keyinfo; - ft_buf->count=(ft_buf->buf - p)/val_len; + ft_buf->count=(uint) (ft_buf->buf - p)/val_len; /* flushing buffer to second-level tree */ for (error=0; !error && p < ft_buf->buf; p+= val_len) diff --git a/storage/myisam/mi_close.c b/storage/myisam/mi_close.c index 07105aea88d..2066d092e1f 100644 --- a/storage/myisam/mi_close.c +++ b/storage/myisam/mi_close.c @@ -35,9 +35,6 @@ int mi_close(register MI_INFO *info) if (info->lock_type == F_EXTRA_LCK) info->lock_type=F_UNLCK; /* HA_EXTRA_NO_USER_CHANGE */ - if (share->reopen == 1 && share->kfile >= 0) - _mi_decrement_open_count(info); - if (info->lock_type != F_UNLCK) { if (mi_lock_database(info,F_UNLCK)) @@ -63,6 +60,8 @@ int mi_close(register MI_INFO *info) my_free(mi_get_rec_buff_ptr(info, info->rec_buff), MYF(MY_ALLOW_ZERO_PTR)); if (flag) { + DBUG_EXECUTE_IF("crash_before_flush_keys", + if (share->kfile >= 0) abort();); if (share->kfile >= 0 && flush_key_blocks(share->key_cache, share->kfile, share->temporary ? FLUSH_IGNORE_CHANGED : @@ -78,6 +77,8 @@ int mi_close(register MI_INFO *info) */ if (share->mode != O_RDONLY && mi_is_crashed(info)) mi_state_info_write(share->kfile, &share->state, 1); + /* Decrement open count must be last I/O on this file. */ + _mi_decrement_open_count(info); if (my_close(share->kfile,MYF(0))) error = my_errno; } diff --git a/storage/myisam/mi_delete.c b/storage/myisam/mi_delete.c index 6fe31f30c19..aa09216ce89 100644 --- a/storage/myisam/mi_delete.c +++ b/storage/myisam/mi_delete.c @@ -250,7 +250,11 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, if (info->ft1_to_ft2) { /* we're in ft1->ft2 conversion mode. Saving key data */ - insert_dynamic(info->ft1_to_ft2, (lastkey+off)); + if (insert_dynamic(info->ft1_to_ft2, (lastkey+off))) + { + DBUG_PRINT("error",("Out of memory")); + DBUG_RETURN(-1); + } } else { diff --git a/storage/myisam/mi_dynrec.c b/storage/myisam/mi_dynrec.c index 3433c26f98b..d1cbd6955dd 100644 --- a/storage/myisam/mi_dynrec.c +++ b/storage/myisam/mi_dynrec.c @@ -66,7 +66,7 @@ static int _mi_cmp_buffer(File file, const uchar *buff, my_off_t filepos, my_bool mi_dynmap_file(MI_INFO *info, my_off_t size) { DBUG_ENTER("mi_dynmap_file"); - if (size > (my_off_t) (~((size_t) 0)) - MEMMAP_EXTRA_MARGIN) + if (size > (my_off_t) (~((size_t) 0))) { DBUG_PRINT("warning", ("File is too large for mmap")); DBUG_RETURN(1); @@ -80,7 +80,7 @@ my_bool mi_dynmap_file(MI_INFO *info, my_off_t size) upon a write if no physical memory is available. */ info->s->file_map= (uchar*) - my_mmap(0, (size_t)(size + MEMMAP_EXTRA_MARGIN), + my_mmap(0, (size_t) size, info->s->mode==O_RDONLY ? PROT_READ : PROT_READ | PROT_WRITE, MAP_SHARED | MAP_NORESERVE, @@ -113,7 +113,7 @@ void mi_remap_file(MI_INFO *info, my_off_t size) if (info->s->file_map) { VOID(my_munmap((char*) info->s->file_map, - (size_t) info->s->mmaped_length + MEMMAP_EXTRA_MARGIN)); + (size_t) info->s->mmaped_length)); mi_dynmap_file(info, size); } } diff --git a/storage/myisam/mi_locking.c b/storage/myisam/mi_locking.c index ec359d13a14..6a4c21160f4 100644 --- a/storage/myisam/mi_locking.c +++ b/storage/myisam/mi_locking.c @@ -293,6 +293,8 @@ void mi_get_status(void* param, int concurrent_insert) info->save_state=info->s->state.state; info->state= &info->save_state; info->append_insert_at_end= concurrent_insert; + if (concurrent_insert) + info->s->state.state.uncacheable= TRUE; DBUG_VOID_RETURN; } diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c index 78749d50fe5..328cde20923 100644 --- a/storage/myisam/mi_open.c +++ b/storage/myisam/mi_open.c @@ -1160,7 +1160,8 @@ uchar *mi_keyseg_read(uchar *ptr, HA_KEYSEG *keyseg) keyseg->null_pos = mi_uint4korr(ptr); ptr +=4; keyseg->charset=0; /* Will be filled in later */ if (keyseg->null_bit) - keyseg->bit_pos= (uint16)(keyseg->null_pos + (keyseg->null_bit == 7)); + /* We adjust bit_pos if null_bit is last in the byte */ + keyseg->bit_pos= (uint16)(keyseg->null_pos + (keyseg->null_bit == (1 << 7))); else { keyseg->bit_pos= (uint16)keyseg->null_pos; diff --git a/storage/myisam/mi_packrec.c b/storage/myisam/mi_packrec.c index 2c4444d67c6..d9abcbce050 100644 --- a/storage/myisam/mi_packrec.c +++ b/storage/myisam/mi_packrec.c @@ -209,10 +209,17 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) This segment will be reallocated after construction of the tables. */ length=(uint) (elements*2+trees*(1 << myisam_quick_table_bits)); + /* + To keep some algorithms simpler, we accept that they access + bytes beyond the end of the input data. This can affect up to + one byte less than the "word size" size used in this file, + which is BITS_SAVED / 8. To avoid accessing non-allocated + data, we add (BITS_SAVED / 8) - 1 bytes to the buffer size. + */ if (!(share->decode_tables=(uint16*) my_malloc((length + OFFSET_TABLE_SIZE) * sizeof(uint16) + - (uint) (share->pack.header_length - sizeof(header)), - MYF(MY_WME | MY_ZEROFILL)))) + (uint) (share->pack.header_length - sizeof(header) + + (BITS_SAVED / 8) - 1), MYF(MY_WME | MY_ZEROFILL)))) goto err1; tmp_buff=share->decode_tables+length; disk_cache= (uchar*) (tmp_buff+OFFSET_TABLE_SIZE); @@ -255,7 +262,7 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) MYF(MY_HOLD_ON_ERROR)); /* Fix the table addresses in the tree heads. */ { - long diff=PTR_BYTE_DIFF(decode_table,share->decode_tables); + my_ptrdiff_t diff=PTR_BYTE_DIFF(decode_table,share->decode_tables); share->decode_tables=decode_table; for (i=0 ; i < trees ; i++) share->decode_trees[i].table=ADD_TO_PTR(share->decode_trees[i].table, @@ -1431,6 +1438,7 @@ static void fill_buffer(MI_BIT_BUFF *bit_buff) bit_buff->current_byte=0; return; } + #if BITS_SAVED == 64 bit_buff->current_byte= ((((uint) ((uchar) bit_buff->pos[7]))) + (((uint) ((uchar) bit_buff->pos[6])) << 8) + @@ -1494,7 +1502,9 @@ my_bool _mi_memmap_file(MI_INFO *info) DBUG_PRINT("warning",("File isn't extended for memmap")); DBUG_RETURN(0); } - if (mi_dynmap_file(info, share->state.state.data_file_length)) + if (mi_dynmap_file(info, + share->state.state.data_file_length + + MEMMAP_EXTRA_MARGIN)) DBUG_RETURN(0); } info->opt_flag|= MEMMAP_USED; diff --git a/storage/myisam/mi_search.c b/storage/myisam/mi_search.c index 89fabfa46d0..1dd6c6b5f0d 100644 --- a/storage/myisam/mi_search.c +++ b/storage/myisam/mi_search.c @@ -409,7 +409,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, } from+=keyseg->length; page=from+nod_flag; - length=from-vseg; + length= (uint) (from - vseg); } if (page > end) diff --git a/storage/myisam/mi_write.c b/storage/myisam/mi_write.c index be67b7a5982..91cc146e706 100644 --- a/storage/myisam/mi_write.c +++ b/storage/myisam/mi_write.c @@ -562,7 +562,14 @@ int _mi_insert(register MI_INFO *info, register MI_KEYDEF *keyinfo, we cannot easily dispatch an empty page here */ b+=blen+ft2len+2; for (a=anc_buff+a_length ; b < a ; b+=ft2len+2) - insert_dynamic(info->ft1_to_ft2, b); + { + if (insert_dynamic(info->ft1_to_ft2, b)) + { + mi_print_error(info->s, HA_ERR_OUT_OF_MEM); + my_errno= HA_ERR_OUT_OF_MEM; + DBUG_RETURN(-1); + } + } /* fixing the page's length - it contains only one key now */ mi_putint(anc_buff,2+blen+ft2len+2,0); diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c index f8fcdcb6fab..ac0be2f01cc 100644 --- a/storage/myisam/myisamchk.c +++ b/storage/myisam/myisamchk.c @@ -363,6 +363,7 @@ static void usage(void) -#, --debug=... Output debug log. Often this is 'd:t:o,filename'.\n"); #endif printf("\ + -H, --HELP Display this help and exit.\n\ -?, --help Display this help and exit.\n\ -O, --set-variable var=option.\n\ Change the value of a variable. Please note that\n\ @@ -1305,7 +1306,7 @@ static void descript(MI_CHECK *param, register MI_INFO *info, char * name) share->base.max_key_file_length != HA_OFFSET_ERROR) printf("Max datafile length: %13s Max keyfile length: %13s\n", llstr(share->base.max_data_file_length-1,llbuff), - llstr(share->base.max_key_file_length-1,llbuff2)); + ullstr(share->base.max_key_file_length - 1, llbuff2)); } } diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h index 9af3f652c5f..b64c7f6bd7f 100644 --- a/storage/myisam/myisamdef.h +++ b/storage/myisam/myisamdef.h @@ -38,6 +38,7 @@ typedef struct st_mi_status_info my_off_t key_file_length; my_off_t data_file_length; ha_checksum checksum; + my_bool uncacheable; /* Active concurrent insert */ } MI_STATUS_INFO; typedef struct st_mi_state_info diff --git a/storage/myisam/rt_index.c b/storage/myisam/rt_index.c index 0b472f4fb0e..e094c302f92 100644 --- a/storage/myisam/rt_index.c +++ b/storage/myisam/rt_index.c @@ -95,7 +95,7 @@ static int rtree_find_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint search_flag, _mi_kpos(nod_flag, k), level + 1))) { case 0: /* found - exit from recursion */ - *saved_key = k - page_buf; + *saved_key = (uint) (k - page_buf); goto ok; case 1: /* not found - continue searching */ info->rtree_recursion_depth = level; @@ -117,7 +117,7 @@ static int rtree_find_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint search_flag, info->lastkey_length = k_len + info->s->base.rec_reflength; memcpy(info->lastkey, k, info->lastkey_length); info->rtree_recursion_depth = level; - *saved_key = last - page_buf; + *saved_key = (uint) (last - page_buf); if (after_key < last) { @@ -314,7 +314,7 @@ static int rtree_get_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint key_length, _mi_kpos(nod_flag, k), level + 1))) { case 0: /* found - exit from recursion */ - *saved_key = k - page_buf; + *saved_key = (uint) (k - page_buf); goto ok; case 1: /* not found - continue searching */ info->rtree_recursion_depth = level; @@ -333,7 +333,7 @@ static int rtree_get_req(MI_INFO *info, MI_KEYDEF *keyinfo, uint key_length, memcpy(info->lastkey, k, info->lastkey_length); info->rtree_recursion_depth = level; - *saved_key = k - page_buf; + *saved_key = (uint) (k - page_buf); if (after_key < last) { @@ -420,7 +420,7 @@ int rtree_get_next(MI_INFO *info, uint keynr, uint key_length) info->lastkey_length = k_len + info->s->base.rec_reflength; memcpy(info->lastkey, key, k_len + info->s->base.rec_reflength); - *(int*)info->int_keypos = key - info->buff; + *(uint*)info->int_keypos = (uint) (key - info->buff); if (after_key >= info->int_maxpos) { info->buff_used = 1; |