svnno****@sourc*****
svnno****@sourc*****
2008年 2月 15日 (金) 15:43:05 JST
Revision: 108 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=tritonn&view=rev&rev=108 Author: mir Date: 2008-02-15 15:43:05 +0900 (Fri, 15 Feb 2008) Log Message: ----------- merged from sql/sql_show.cc. Modified Paths: -------------- tags/tritonn-1.1.0-mysql-5.0.51a/libmysqld/sql_show.cc Modified: tags/tritonn-1.1.0-mysql-5.0.51a/libmysqld/sql_show.cc =================================================================== --- tags/tritonn-1.1.0-mysql-5.0.51a/libmysqld/sql_show.cc 2008-02-15 06:42:09 UTC (rev 107) +++ tags/tritonn-1.1.0-mysql-5.0.51a/libmysqld/sql_show.cc 2008-02-15 06:43:05 UTC (rev 108) @@ -29,6 +29,7 @@ #endif #ifdef ENABLE_SENNA +#define SECTIONALIZE 0x00080000 #ifdef HAVE_ISAM #include "ha_myisam.h" // For isam #endif @@ -1005,6 +1006,45 @@ !(key_info->flags & HA_SPATIAL)) packet->append(STRING_WITH_LEN(" USING RTREE")); +#ifdef ENABLE_SENNA + { + char ins[32]; + char *insp; + int inslen; + if (key_info->is_senna) + { + if (key_info->senna_flags & SEN_INDEX_NGRAM) + packet->append(STRING_WITH_LEN(" USING NGRAM")); + else if (key_info->senna_flags & SEN_INDEX_DELIMITED) + packet->append(STRING_WITH_LEN(" USING DELIMITED")); + else + packet->append(STRING_WITH_LEN(" USING MECAB")); + + if (key_info->senna_flags & SEN_INDEX_NORMALIZE) + packet->append(STRING_WITH_LEN(", NORMALIZE")); + else + packet->append(STRING_WITH_LEN(", NO NORMALIZE")); + + if (key_info->senna_flags & SECTIONALIZE) + packet->append(STRING_WITH_LEN(", SECTIONALIZE")); + + if (key_info->senna_flags & SEN_INDEX_SPLIT_ALPHA) + packet->append(STRING_WITH_LEN(", SPLIT_ALPHA")); + if (key_info->senna_flags & SEN_INDEX_SPLIT_DIGIT) + packet->append(STRING_WITH_LEN(", SPLIT_DIGIT")); + if (key_info->senna_flags & SEN_INDEX_SPLIT_SYMBOL) + packet->append(STRING_WITH_LEN(", SPLIT_SYMBOL")); + + /* TODO: initial_n_segments support */ + my_snprintf(ins, sizeof(ins), ", %d",key_info->senna_initial_n_segments); + inslen = strlen(ins); + insp = sql_alloc(inslen); + memcpy(insp, ins, inslen); + packet->append(insp, inslen); + } + } +#endif + // No need to send USING FULLTEXT, it is sent as FULLTEXT KEY } packet->append(STRING_WITH_LEN(" (")); @@ -4452,7 +4492,6 @@ #endif #ifdef ENABLE_SENNA -#define SECTIONALIZE 0x00080000 bool senna_show_status(THD *thd, LEX *lex) { List<char> files; @@ -4498,7 +4537,15 @@ List_iterator_fast<char> it(files); while (file_name = it++) { + TABLE tmp_table; TABLE_LIST table_list; + + /* to skip views */ + (void) my_snprintf(path, FN_LEN, "%s/%s", db, file_name); + openfrm(thd, path, "", 0, SENNA_CHECK_VIEW, 0, &tmp_table); + if(!(tmp_table.file)) continue; + closefrm(&tmp_table); + bzero((char*) &table_list, sizeof(table_list)); table_list.db = db; table_list.table_name = file_name; @@ -4542,13 +4589,13 @@ protocol->store(key->senna_flags & SEN_INDEX_SPLIT_ALPHA ? "ON" : "OFF", system_charset_info); protocol->store(key->senna_flags & SEN_INDEX_SPLIT_DIGIT ? "ON" : "OFF", system_charset_info); protocol->store(key->senna_flags & SEN_INDEX_SPLIT_SYMBOL ? "ON" : "OFF", system_charset_info); - protocol->store((uint32) key->senna_initial_n_segments); - protocol->store((uint32) key->senna_keys_size); - protocol->store((uint32) key->senna_keys_file_size); - protocol->store((uint32) key->senna_lexicon_size); - protocol->store((uint32) key->senna_lexicon_file_size); - protocol->store((uint32) key->senna_inv_seg_size); - protocol->store((uint32) key->senna_inv_chunk_size); + protocol->store((longlong) key->senna_initial_n_segments); + protocol->store((longlong) key->senna_keys_size); + protocol->store((longlong) key->senna_keys_file_size); + protocol->store((longlong) key->senna_lexicon_size); + protocol->store((longlong) key->senna_lexicon_file_size); + protocol->store((longlong) key->senna_inv_seg_size); + protocol->store((longlong) key->senna_inv_chunk_size); if (protocol->write()) DBUG_RETURN(TRUE); } }