diff options
Diffstat (limited to 'storage/myisam')
-rw-r--r-- | storage/myisam/ft_boolean_search.c | 59 | ||||
-rw-r--r-- | storage/myisam/ft_nlq_search.c | 6 | ||||
-rw-r--r-- | storage/myisam/ft_parser.c | 41 | ||||
-rw-r--r-- | storage/myisam/ft_stopwords.c | 21 | ||||
-rw-r--r-- | storage/myisam/ftdefs.h | 14 | ||||
-rw-r--r-- | storage/myisam/ha_myisam.cc | 11 | ||||
-rw-r--r-- | storage/myisam/mi_check.c | 2 | ||||
-rw-r--r-- | storage/myisam/mi_create.c | 2 | ||||
-rw-r--r-- | storage/myisam/mi_extra.c | 2 | ||||
-rw-r--r-- | storage/myisam/mi_locking.c | 10 | ||||
-rw-r--r-- | storage/myisam/mi_open.c | 4 | ||||
-rw-r--r-- | storage/myisam/mi_rkey.c | 4 | ||||
-rw-r--r-- | storage/myisam/mi_rnext.c | 2 | ||||
-rw-r--r-- | storage/myisam/mi_rprev.c | 2 | ||||
-rw-r--r-- | storage/myisam/mi_test2.c | 2 | ||||
-rw-r--r-- | storage/myisam/myisamchk.c | 2 | ||||
-rw-r--r-- | storage/myisam/myisamdef.h | 5 |
17 files changed, 82 insertions, 107 deletions
diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c index 7d615d837d3..bf0af370838 100644 --- a/storage/myisam/ft_boolean_search.c +++ b/storage/myisam/ft_boolean_search.c @@ -182,7 +182,7 @@ typedef struct st_my_ftb_param static int ftb_query_add_word(MYSQL_FTPARSER_PARAM *param, - const uchar *word, mysql_ft_size_t word_len, + const char *word, int word_len, MYSQL_FTPARSER_BOOLEAN_INFO *info) { MY_FTB_PARAM *ftb_param= param->mysql_ftparam; @@ -284,24 +284,24 @@ static int ftb_query_add_word(MYSQL_FTPARSER_PARAM *param, static int ftb_parse_query_internal(MYSQL_FTPARSER_PARAM *param, - const uchar *query, mysql_ft_size_t len) + const char *query, int len) { MY_FTB_PARAM *ftb_param= param->mysql_ftparam; MYSQL_FTPARSER_BOOLEAN_INFO info; CHARSET_INFO *cs= ftb_param->ftb->charset; - const uchar **start= &query; - const uchar *end= query + len; + const uchar **start= (const uchar**) &query; + uchar *end= (uchar*) query + len; FT_WORD w; info.prev= ' '; info.quot= 0; while (ft_get_word(cs, start, end, &w, &info)) - param->mysql_add_word(param, w.pos, w.len, &info); + param->mysql_add_word(param, (char*) w.pos, w.len, &info); return(0); } -static int _ftb_parse_query(FTB *ftb, uchar *query, mysql_ft_size_t len, +static int _ftb_parse_query(FTB *ftb, uchar *query, uint len, struct st_mysql_ftparser *parser) { MYSQL_FTPARSER_PARAM *param; @@ -323,7 +323,7 @@ static int _ftb_parse_query(FTB *ftb, uchar *query, mysql_ft_size_t len, param->mysql_add_word= ftb_query_add_word; param->mysql_ftparam= (void *)&ftb_param; param->cs= ftb->charset; - param->doc= query; + param->doc= (char*) query; param->length= len; param->flags= 0; param->mode= MYSQL_FTPARSER_FULL_BOOLEAN_INFO; @@ -484,7 +484,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search) static void _ftb_init_index_search(FT_INFO *ftb) { - uint i; + int i; FTB_WORD *ftbw; if (ftb->state == UNINITIALIZED || ftb->keynr == NO_SUCH_KEY) @@ -492,7 +492,7 @@ static void _ftb_init_index_search(FT_INFO *ftb) ftb->state=INDEX_SEARCH; for (i= queue_last_element(&ftb->queue); - (int) i >= (int) queue_first_element(&ftb->queue); + i >= (int) queue_first_element(&ftb->queue); i--) { ftbw=(FTB_WORD *)(queue_element(&ftb->queue, i)); @@ -554,7 +554,7 @@ static void _ftb_init_index_search(FT_INFO *ftb) FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, uchar *query, - mysql_ft_size_t query_len, CHARSET_INFO *cs) + uint query_len, CHARSET_INFO *cs) { FTB *ftb; FTB_EXPR *ftbe; @@ -606,7 +606,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, uchar *query, sizeof(FTB_WORD *)*ftb->queue.elements); memcpy(ftb->list, &queue_top(&ftb->queue), sizeof(FTB_WORD *)*ftb->queue.elements); my_qsort2(ftb->list, ftb->queue.elements, sizeof(FTB_WORD *), - (qsort2_cmp)FTB_WORD_cmp_list, (void*) ftb->charset); + (qsort2_cmp)FTB_WORD_cmp_list, (void*)ftb->charset); if (ftb->queue.elements<2) ftb->with_scan &= ~FTB_FLAG_TRUNC; ftb->state=READY; return ftb; @@ -629,7 +629,7 @@ typedef struct st_my_ftb_phrase_param static int ftb_phrase_add_word(MYSQL_FTPARSER_PARAM *param, - const uchar *word, mysql_ft_size_t word_len, + const char *word, int word_len, MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info __attribute__((unused))) { MY_FTB_PHRASE_PARAM *phrase_param= param->mysql_ftparam; @@ -661,16 +661,15 @@ static int ftb_phrase_add_word(MYSQL_FTPARSER_PARAM *param, static int ftb_check_phrase_internal(MYSQL_FTPARSER_PARAM *param, - const uchar *document, - mysql_ft_size_t len) + const char *document, int len) { FT_WORD word; MY_FTB_PHRASE_PARAM *phrase_param= param->mysql_ftparam; const uchar *docend= (uchar*) document + len; - while (ft_simple_get_word(phrase_param->cs, &document, docend, + while (ft_simple_get_word(phrase_param->cs, (uchar**) &document, docend, &word, FALSE)) { - param->mysql_add_word(param, word.pos, word.len, 0); + param->mysql_add_word(param, (char*) word.pos, word.len, 0); if (phrase_param->match) break; } @@ -693,8 +692,7 @@ static int ftb_check_phrase_internal(MYSQL_FTPARSER_PARAM *param, -1 is returned if error occurs. */ -static int _ftb_check_phrase(FTB *ftb, const uchar *document, - mysql_ft_size_t len, +static int _ftb_check_phrase(FTB *ftb, const uchar *document, uint len, FTB_EXPR *ftbe, struct st_mysql_ftparser *parser) { MY_FTB_PHRASE_PARAM ftb_param; @@ -716,7 +714,7 @@ static int _ftb_check_phrase(FTB *ftb, const uchar *document, param->mysql_add_word= ftb_phrase_add_word; param->mysql_ftparam= (void *)&ftb_param; param->cs= ftb->charset; - param->doc= document; + param->doc= (char *) document; param->length= len; param->flags= 0; param->mode= MYSQL_FTPARSER_WITH_STOPWORDS; @@ -889,9 +887,8 @@ typedef struct st_my_ftb_find_param static int ftb_find_relevance_add_word(MYSQL_FTPARSER_PARAM *param, - const uchar *word, mysql_ft_size_t len, - MYSQL_FTPARSER_BOOLEAN_INFO - *boolean_info __attribute__((unused))) + const char *word, int len, + MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info __attribute__((unused))) { MY_FTB_FIND_PARAM *ftb_param= param->mysql_ftparam; FT_INFO *ftb= ftb_param->ftb; @@ -904,8 +901,8 @@ static int ftb_find_relevance_add_word(MYSQL_FTPARSER_PARAM *param, for (a= 0, b= ftb->queue.elements, c= (a+b)/2; b-a>1; c= (a+b)/2) { ftbw= ftb->list[c]; - if (ha_compare_text(ftb->charset, word, len, - ftbw->word+1, ftbw->len-1, + if (ha_compare_text(ftb->charset, (uchar*)word, len, + (uchar*)ftbw->word+1, ftbw->len-1, (my_bool) (ftbw->flags & FTB_FLAG_TRUNC), 0) < 0) b= c; else @@ -931,8 +928,8 @@ static int ftb_find_relevance_add_word(MYSQL_FTPARSER_PARAM *param, for (; c >= 0; c--) { ftbw= ftb->list[c]; - if (ha_compare_text(ftb->charset, word, len, - ftbw->word + 1,ftbw->len - 1, + if (ha_compare_text(ftb->charset, (uchar*)word, len, + (uchar*)ftbw->word + 1,ftbw->len - 1, (my_bool)(ftbw->flags & FTB_FLAG_TRUNC), 0)) { if (ftb->with_scan & FTB_FLAG_TRUNC) @@ -951,14 +948,14 @@ static int ftb_find_relevance_add_word(MYSQL_FTPARSER_PARAM *param, static int ftb_find_relevance_parse(MYSQL_FTPARSER_PARAM *param, - const uchar *doc, mysql_ft_size_t len) + const char *doc, int len) { MY_FTB_FIND_PARAM *ftb_param= param->mysql_ftparam; FT_INFO *ftb= ftb_param->ftb; - const uchar *end= doc + len; + uchar *end= (uchar*) doc + len; FT_WORD w; - while (ft_simple_get_word(ftb->charset, &doc, end, &w, TRUE)) - param->mysql_add_word(param, w.pos, w.len, 0); + while (ft_simple_get_word(ftb->charset, (uchar**) &doc, end, &w, TRUE)) + param->mysql_add_word(param, (char*) w.pos, w.len, 0); return(0); } @@ -1014,7 +1011,7 @@ float ft_boolean_find_relevance(FT_INFO *ftb, uchar *record, uint length) { if (!ftsi.pos) continue; - param->doc= ftsi.pos; + param->doc= (char *)ftsi.pos; param->length= ftsi.len; if (unlikely(parser->parse(param))) return 0; diff --git a/storage/myisam/ft_nlq_search.c b/storage/myisam/ft_nlq_search.c index e19765efe3e..deb645b3b15 100644 --- a/storage/myisam/ft_nlq_search.c +++ b/storage/myisam/ft_nlq_search.c @@ -199,14 +199,12 @@ static int walk_and_push(FT_SUPERDOC *from, static int FT_DOC_cmp(void *unused __attribute__((unused)), FT_DOC *a, FT_DOC *b) { - double c= b->weight - a->weight; - return ((c < 0) ? -1 : (c > 0) ? 1 : 0); + return CMP_NUM(b->weight, a->weight); } FT_INFO *ft_init_nlq_search(MI_INFO *info, uint keynr, uchar *query, - mysql_ft_size_t query_len, uint flags, - uchar *record) + uint query_len, uint flags, uchar *record) { TREE wtree; ALL_IN_ONE aio; diff --git a/storage/myisam/ft_parser.c b/storage/myisam/ft_parser.c index af16240bca2..31e72e8e0a6 100644 --- a/storage/myisam/ft_parser.c +++ b/storage/myisam/ft_parser.c @@ -109,7 +109,7 @@ my_bool ft_boolean_check_syntax_string(const uchar *str) uchar ft_get_word(CHARSET_INFO *cs, const uchar **start, const uchar *end, FT_WORD *word, MYSQL_FTPARSER_BOOLEAN_INFO *param) { - const uchar *doc= *start; + const uchar *doc=*start; int ctype; uint mwc, length; int mbl; @@ -174,7 +174,7 @@ uchar ft_get_word(CHARSET_INFO *cs, const uchar **start, const uchar *end, if ((param->trunc=(doc<end && *doc == FTB_TRUNC))) doc++; - if (((length >= ft_min_word_len && !is_stopword(word->pos, + if (((length >= ft_min_word_len && !is_stopword((char*) word->pos, word->len)) || param->trunc) && length < ft_max_word_len) { @@ -199,11 +199,10 @@ ret: return param->type; } -uchar ft_simple_get_word(CHARSET_INFO *cs, const uchar **start, - const uchar *end, FT_WORD *word, - my_bool skip_stopwords) +uchar ft_simple_get_word(CHARSET_INFO *cs, uchar **start, const uchar *end, + FT_WORD *word, my_bool skip_stopwords) { - const uchar *doc= *start; + uchar *doc= *start; uint mwc, length; int mbl; int ctype; @@ -215,7 +214,7 @@ uchar ft_simple_get_word(CHARSET_INFO *cs, const uchar **start, { if (doc >= end) DBUG_RETURN(0); - mbl= cs->cset->ctype(cs, &ctype, doc, end); + mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end); if (true_word_char(ctype, *doc)) break; } @@ -224,7 +223,7 @@ uchar ft_simple_get_word(CHARSET_INFO *cs, const uchar **start, for (word->pos= doc; doc < end; length++, doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1))) { - mbl= cs->cset->ctype(cs, &ctype, doc, end); + mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end); if (true_word_char(ctype, *doc)) mwc= 0; else if (!misc_word_char(*doc) || mwc) @@ -237,7 +236,7 @@ uchar ft_simple_get_word(CHARSET_INFO *cs, const uchar **start, if (skip_stopwords == FALSE || (length >= ft_min_word_len && length < ft_max_word_len && - !is_stopword(word->pos, word->len))) + !is_stopword((char*) word->pos, word->len))) { *start= doc; DBUG_RETURN(1); @@ -250,16 +249,14 @@ void ft_parse_init(TREE *wtree, CHARSET_INFO *cs) { DBUG_ENTER("ft_parse_init"); if (!is_tree_inited(wtree)) - init_tree(wtree,0,0,sizeof(FT_WORD),(qsort_cmp2)&FT_WORD_cmp,0,NULL, - (void*) cs); + init_tree(wtree,0,0,sizeof(FT_WORD),(qsort_cmp2)&FT_WORD_cmp,0,0,(void*)cs); DBUG_VOID_RETURN; } static int ft_add_word(MYSQL_FTPARSER_PARAM *param, - const uchar *word, mysql_ft_size_t word_len, - MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info - __attribute__((unused))) + const char *word, int word_len, + MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info __attribute__((unused))) { TREE *wtree; FT_WORD w; @@ -287,23 +284,23 @@ static int ft_add_word(MYSQL_FTPARSER_PARAM *param, static int ft_parse_internal(MYSQL_FTPARSER_PARAM *param, - const uchar *doc_arg, mysql_ft_size_t doc_len) + const char *doc_arg, int doc_len) { - const uchar *doc= doc_arg; - const uchar *end= doc + doc_len; + uchar *doc= (uchar*) doc_arg; + uchar *end= doc + doc_len; MY_FT_PARSER_PARAM *ft_param=param->mysql_ftparam; TREE *wtree= ft_param->wtree; FT_WORD w; DBUG_ENTER("ft_parse_internal"); while (ft_simple_get_word(wtree->custom_arg, &doc, end, &w, TRUE)) - if (param->mysql_add_word(param, w.pos, w.len, 0)) + if (param->mysql_add_word(param, (char*) w.pos, w.len, 0)) DBUG_RETURN(1); DBUG_RETURN(0); } -int ft_parse(TREE *wtree, const uchar *doc, mysql_ft_size_t doclen, +int ft_parse(TREE *wtree, uchar *doc, int doclen, struct st_mysql_ftparser *parser, MYSQL_FTPARSER_PARAM *param, MEM_ROOT *mem_root) { @@ -318,7 +315,7 @@ int ft_parse(TREE *wtree, const uchar *doc, mysql_ft_size_t doclen, param->mysql_add_word= ft_add_word; param->mysql_ftparam= &my_param; param->cs= wtree->custom_arg; - param->doc= doc; + param->doc= (char*) doc; param->length= doclen; param->mode= MYSQL_FTPARSER_SIMPLE_MODE; DBUG_RETURN(parser->parse(param)); @@ -378,8 +375,8 @@ MYSQL_FTPARSER_PARAM *ftparser_call_initializer(MI_INFO *info, mysql_add_word != 0 - parser is initialized, or no initialization needed. */ info->ftparser_param[ftparser_nr].mysql_add_word= - (int (*)(struct st_mysql_ftparser_param *, const uchar *, - mysql_ft_size_t, MYSQL_FTPARSER_BOOLEAN_INFO *)) 1; + (int (*)(struct st_mysql_ftparser_param *, const char *, int, + MYSQL_FTPARSER_BOOLEAN_INFO *)) 1; if (parser->init && parser->init(&info->ftparser_param[ftparser_nr])) return 0; } diff --git a/storage/myisam/ft_stopwords.c b/storage/myisam/ft_stopwords.c index 1079cf83417..b0911403996 100644 --- a/storage/myisam/ft_stopwords.c +++ b/storage/myisam/ft_stopwords.c @@ -24,8 +24,8 @@ static CHARSET_INFO *ft_stopword_cs= NULL; typedef struct st_ft_stopwords { - const uchar* pos; - size_t len; + const char * pos; + uint len; } FT_STOPWORD; static TREE *stopwords3=NULL; @@ -34,8 +34,8 @@ static int FT_STOPWORD_cmp(void* cmp_arg __attribute__((unused)), FT_STOPWORD *w1, FT_STOPWORD *w2) { return ha_compare_text(ft_stopword_cs, - w1->pos, w1->len, - w2->pos, w2->len, 0, 0); + (uchar *)w1->pos,w1->len, + (uchar *)w2->pos,w2->len,0,0); } static void FT_STOPWORD_free(FT_STOPWORD *w, TREE_FREE action, @@ -48,10 +48,9 @@ static void FT_STOPWORD_free(FT_STOPWORD *w, TREE_FREE action, static int ft_add_stopword(const char *w) { FT_STOPWORD sw; - return (!w || - (((sw.len= (uint) strlen((char*) (sw.pos=(const uchar *)w))) >= - ft_min_word_len) && - (tree_insert(stopwords3, &sw, 0, stopwords3->custom_arg)==NULL))); + return !w || + (((sw.len= (uint) strlen(sw.pos=w)) >= ft_min_word_len) && + (tree_insert(stopwords3, &sw, 0, stopwords3->custom_arg)==NULL)); } int ft_init_stopwords() @@ -79,8 +78,7 @@ int ft_init_stopwords() { File fd; uint len; - uchar *buffer; - const uchar *start, *end; + uchar *buffer, *start, *end; FT_WORD w; int error=-1; @@ -122,8 +120,7 @@ err0: DBUG_RETURN(0); } - -int is_stopword(const uchar *word, size_t len) +int is_stopword(const char *word, size_t len) { FT_STOPWORD sw; sw.pos=word; diff --git a/storage/myisam/ftdefs.h b/storage/myisam/ftdefs.h index b26fa523b42..cf00594629c 100644 --- a/storage/myisam/ftdefs.h +++ b/storage/myisam/ftdefs.h @@ -101,18 +101,17 @@ typedef struct st_ft_word { size_t len; } FT_WORD; -int is_stopword(const uchar *word, size_t len); +int is_stopword(const char *word, size_t len); uint _ft_make_key(MI_INFO *, uint , uchar *, FT_WORD *, my_off_t); uchar ft_get_word(CHARSET_INFO *, const uchar **, const uchar *, FT_WORD *, MYSQL_FTPARSER_BOOLEAN_INFO *); -uchar ft_simple_get_word(CHARSET_INFO *, const uchar **, const uchar *, +uchar ft_simple_get_word(CHARSET_INFO *, uchar **, const uchar *, FT_WORD *, my_bool); typedef struct _st_ft_seg_iterator { - uint num; - mysql_ft_size_t len; + uint num, len; HA_KEYSEG *seg; const uchar *rec, *pos; } FT_SEG_ITERATOR; @@ -122,16 +121,15 @@ void _mi_ft_segiterator_dummy_init(const uchar *, uint, FT_SEG_ITERATOR *); uint _mi_ft_segiterator(FT_SEG_ITERATOR *); void ft_parse_init(TREE *, CHARSET_INFO *); -int ft_parse(TREE *, const uchar *, int, struct st_mysql_ftparser *parser, +int ft_parse(TREE *, uchar *, int, struct st_mysql_ftparser *parser, MYSQL_FTPARSER_PARAM *, MEM_ROOT *); FT_WORD * ft_linearize(TREE *, MEM_ROOT *); FT_WORD * _mi_ft_parserecord(MI_INFO *, uint, const uchar *, MEM_ROOT *); uint _mi_ft_parse(TREE *, MI_INFO *, uint, const uchar *, MYSQL_FTPARSER_PARAM *, MEM_ROOT *); -FT_INFO *ft_init_nlq_search(MI_INFO *, uint, uchar *, mysql_ft_size_t, uint, - uchar *); -FT_INFO *ft_init_boolean_search(MI_INFO *, uint, uchar *, mysql_ft_size_t, CHARSET_INFO *); +FT_INFO *ft_init_nlq_search(MI_INFO *, uint, uchar *, uint, uint, uchar *); +FT_INFO *ft_init_boolean_search(MI_INFO *, uint, uchar *, uint, CHARSET_INFO *); extern const struct _ft_vft _ft_vft_nlq; int ft_nlq_read_next(FT_INFO *, char *); diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index fc6a9829072..2913cdc421d 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -68,7 +68,7 @@ static MYSQL_SYSVAR_SET(recover_options, myisam_recover_options, PLUGIN_VAR_OPCMDARG|PLUGIN_VAR_READONLY, "Syntax: myisam-recover-options[=option[,option...]], where option can be " "DEFAULT, BACKUP, FORCE, QUICK, or OFF", - NULL, NULL, 0, &myisam_recover_typelib); + NULL, NULL, 1, &myisam_recover_typelib); static MYSQL_THDVAR_ULONG(repair_threads, PLUGIN_VAR_RQCMDARG, "If larger than 1, when repairing a MyISAM table all indexes will be " @@ -706,8 +706,6 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked) if (!(file=mi_open(name, mode, test_if_locked | HA_OPEN_FROM_SQL_LAYER))) return (my_errno ? my_errno : -1); - file->s->chst_invalidator= query_cache_invalidate_by_MyISAM_filename_ref; - if (!table->s->tmp_table) /* No need to perform a check for tmp table */ { if ((my_errno= table2myisam(table, &keyinfo, &recinfo, &recs))) @@ -1678,7 +1676,6 @@ int ha_myisam::index_last(uchar *buf) DBUG_ASSERT(inited==INDEX); int error=mi_rlast(file, buf, active_index); MYSQL_INDEX_READ_ROW_DONE(error); -#warning move that to wrappers return error; } @@ -2113,7 +2110,7 @@ static int myisam_init(void *p) #endif /* Set global variables based on startup options */ - if (myisam_recover_options) + if (myisam_recover_options && myisam_recover_options != HA_RECOVER_OFF) ha_open_options|=HA_OPEN_ABORT_IF_CRASHED; else myisam_recover_options= HA_RECOVER_OFF; @@ -2222,13 +2219,13 @@ maria_declare_plugin(myisam) &myisam_storage_engine, "MyISAM", "MySQL AB", - "Default engine as of MySQL 3.23 with great performance", + "MyISAM storage engine", PLUGIN_LICENSE_GPL, myisam_init, /* Plugin Init */ NULL, /* Plugin Deinit */ 0x0100, /* 1.0 */ NULL, /* status variables */ - NULL, /* system variables */ + myisam_sysvars, /* system variables */ "1.0", /* string version */ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ } diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 89644e5f978..a69ed41f67d 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -1333,7 +1333,7 @@ int chk_data_link(HA_CHECK *param, MI_INFO *info, my_bool extend) if (splits != info->s->state.split) { mi_check_print_warning(param, - "Found %10s parts. Should be: %s", + "Found %10s key parts. Should be: %s", llstr(splits,llbuff), llstr(info->s->state.split,llbuff2)); } diff --git a/storage/myisam/mi_create.c b/storage/myisam/mi_create.c index 3a842b966ab..7222542847d 100644 --- a/storage/myisam/mi_create.c +++ b/storage/myisam/mi_create.c @@ -633,7 +633,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, */ if (test_if_reopen(filename)) { - my_printf_error(0, "MyISAM table '%s' is in use " + my_printf_error(HA_ERR_TABLE_EXIST, "MyISAM table '%s' is in use " "(most likely by a MERGE table). Try FLUSH TABLES.", MYF(0), name + dirname_length(name)); my_errno= HA_ERR_TABLE_EXIST; diff --git a/storage/myisam/mi_extra.c b/storage/myisam/mi_extra.c index 16ec536dbc6..d1512970683 100644 --- a/storage/myisam/mi_extra.c +++ b/storage/myisam/mi_extra.c @@ -258,7 +258,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) break; case HA_EXTRA_PREPARE_FOR_DROP: /* Signals about intent to delete this table */ - share->deleting= TRUE; + //share->deleting= TRUE; share->global_changed= FALSE; /* force writing changed flag */ _mi_mark_file_changed(info); /* Fall trough */ diff --git a/storage/myisam/mi_locking.c b/storage/myisam/mi_locking.c index be308797286..aa4a01db3bc 100644 --- a/storage/myisam/mi_locking.c +++ b/storage/myisam/mi_locking.c @@ -328,12 +328,6 @@ void mi_update_status(void* param) (long) info->s->state.state.data_file_length)); #endif info->s->state.state= *info->state; -#ifdef HAVE_QUERY_CACHE - DBUG_PRINT("info", ("invalidator... '%s' (status update)", - info->filename)); - DBUG_ASSERT(info->s->chst_invalidator != NULL); - (*info->s->chst_invalidator)((const char *)info->filename); -#endif } info->state= &info->s->state.state; info->append_insert_at_end= 0; @@ -365,11 +359,11 @@ static void mi_update_status_with_lock(MI_INFO *info) if (info->state == &info->save_state) { locked= 1; - pthread_mutex_lock(&info->s->lock.mutex); + mysql_mutex_lock(&info->s->lock.mutex); } mi_update_status(info); if (locked) - pthread_mutex_unlock(&info->s->lock.mutex); + mysql_mutex_unlock(&info->s->lock.mutex); } diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c index 2403bf70434..abc731aead6 100644 --- a/storage/myisam/mi_open.c +++ b/storage/myisam/mi_open.c @@ -648,7 +648,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) mysql_mutex_unlock(&THR_LOCK_myisam); bzero(info.buff, share->base.max_key_block_length * 2); - my_free(rec_per_key_part, MYF(MY_ALLOW_ZERO_PTR)); + my_free(rec_per_key_part); if (myisam_log_file >= 0) { @@ -678,7 +678,7 @@ err: case 3: if (! lock_error) (void) my_lock(kfile, F_UNLCK, 0L, F_TO_EOF, MYF(MY_SEEK_NOT_DONE)); - my_free(rec_per_key_part, MYF(MY_ALLOW_ZERO_PTR)); + my_free(rec_per_key_part); /* fall through */ case 2: my_afree(disk_cache); diff --git a/storage/myisam/mi_rkey.c b/storage/myisam/mi_rkey.c index f5b3514faf6..3ca6cdd257f 100644 --- a/storage/myisam/mi_rkey.c +++ b/storage/myisam/mi_rkey.c @@ -87,7 +87,7 @@ int mi_rkey(MI_INFO *info, uchar *buf, int inx, const uchar *key, mi_print_error(info->s, HA_ERR_CRASHED); my_errno=HA_ERR_CRASHED; if (share->concurrent_insert) - rw_unlock(&share->key_root_lock[inx]); + mysql_rwlock_unlock(&share->key_root_lock[inx]); goto err; } break; @@ -150,7 +150,7 @@ int mi_rkey(MI_INFO *info, uchar *buf, int inx, const uchar *key, { info->lastpos= HA_OFFSET_ERROR; if (share->concurrent_insert) - rw_unlock(&share->key_root_lock[inx]); + mysql_rwlock_unlock(&share->key_root_lock[inx]); DBUG_RETURN((my_errno= HA_ERR_KEY_NOT_FOUND)); } /* diff --git a/storage/myisam/mi_rnext.c b/storage/myisam/mi_rnext.c index 43b071bc464..29de0e98d3d 100644 --- a/storage/myisam/mi_rnext.c +++ b/storage/myisam/mi_rnext.c @@ -118,7 +118,7 @@ int mi_rnext(MI_INFO *info, uchar *buf, int inx) if (!error && res == ICP_OUT_OF_RANGE) { if (info->s->concurrent_insert) - rw_unlock(&info->s->key_root_lock[inx]); + mysql_rwlock_unlock(&info->s->key_root_lock[inx]); info->lastpos= HA_OFFSET_ERROR; DBUG_RETURN(my_errno= HA_ERR_END_OF_FILE); } diff --git a/storage/myisam/mi_rprev.c b/storage/myisam/mi_rprev.c index 89612b5a661..95aa8069e1d 100644 --- a/storage/myisam/mi_rprev.c +++ b/storage/myisam/mi_rprev.c @@ -72,7 +72,7 @@ int mi_rprev(MI_INFO *info, uchar *buf, int inx) if (!error && res == 2) { if (share->concurrent_insert) - rw_unlock(&share->key_root_lock[inx]); + mysql_rwlock_unlock(&share->key_root_lock[inx]); info->lastpos= HA_OFFSET_ERROR; DBUG_RETURN(my_errno= HA_ERR_END_OF_FILE); } diff --git a/storage/myisam/mi_test2.c b/storage/myisam/mi_test2.c index 9babf7ad4f0..a3303428a08 100644 --- a/storage/myisam/mi_test2.c +++ b/storage/myisam/mi_test2.c @@ -775,7 +775,7 @@ int main(int argc, char *argv[]) { ulong blob_length,pos; uchar *ptr; - memcpy_fixed(&ptr, read_record+blob_pos+4, sizeof(ptr)); + memcpy(&ptr, read_record+blob_pos+4, sizeof(ptr)); blob_length= uint4korr(read_record+blob_pos); for (pos=0 ; pos < blob_length ; pos++) { diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c index f8eb3cb1bde..70406203f63 100644 --- a/storage/myisam/myisamchk.c +++ b/storage/myisam/myisamchk.c @@ -1276,7 +1276,7 @@ static void descript(HA_CHECK *param, register MI_INFO *info, char * name) printf("Recordlength: %13d\n",(int) share->base.pack_reclength); if (! mi_is_all_keys_active(share->state.key_map, share->base.keys)) { - longlong2str(share->state.key_map,buff,2,1); + longlong2str(share->state.key_map,buff,2); printf("Using only keys '%s' of %d possibly keys\n", buff, share->base.keys); } diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h index 304150601d7..894ec827b85 100644 --- a/storage/myisam/myisamdef.h +++ b/storage/myisam/myisamdef.h @@ -191,10 +191,7 @@ typedef struct st_mi_isam_share const uchar *record, my_off_t pos); size_t (*file_read) (MI_INFO *, uchar *, size_t, my_off_t, myf); size_t (*file_write) (MI_INFO *, const uchar *, size_t, my_off_t, myf); - /* query cache invalidator for merged tables */ - invalidator_by_filename invalidator; - /* query cache invalidator for changing state */ - invalidator_by_filename chst_invalidator; + invalidator_by_filename invalidator; /* query cache invalidator */ ulong this_process; /* processid */ ulong last_process; /* For table-change-check */ ulong last_version; /* Version on start */ |