diff options
author | Sergei Golubchik <sergii@pisem.net> | 2010-11-25 18:17:28 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2010-11-25 18:17:28 +0100 |
commit | 65ca700def99289cc31a7040537f5aa6e12bf485 (patch) | |
tree | 97b3a07299b626c519da0e80c122b5b79b933914 /sql/sql_help.cc | |
parent | 2ab57de38d13d927ddff2d51aed4af34e13998f5 (diff) | |
parent | 6e5bcca7935d3c62f84bb640e5357664a210ee12 (diff) | |
download | mariadb-git-65ca700def99289cc31a7040537f5aa6e12bf485.tar.gz |
merge.
checkpoint.
does not compile.
Diffstat (limited to 'sql/sql_help.cc')
-rw-r--r-- | sql/sql_help.cc | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/sql/sql_help.cc b/sql/sql_help.cc index 4e3df950134..7218d806c5f 100644 --- a/sql/sql_help.cc +++ b/sql/sql_help.cc @@ -188,11 +188,14 @@ int search_topics(THD *thd, TABLE *topics, struct st_find_field *find_fields, SQL_SELECT *select, List<String> *names, String *name, String *description, String *example) { - DBUG_ENTER("search_topics"); int count= 0; - READ_RECORD read_record_info; - init_read_record(&read_record_info, thd, topics, select, 1, 0, FALSE); + DBUG_ENTER("search_topics"); + + /* Should never happen. As this is part of help, we can ignore this */ + if (init_read_record(&read_record_info, thd, topics, select, 1, 0, FALSE)) + DBUG_RETURN(0); + while (!read_record_info.read_record(&read_record_info)) { if (!select->cond->val_int()) // Doesn't match like @@ -228,11 +231,13 @@ int search_topics(THD *thd, TABLE *topics, struct st_find_field *find_fields, int search_keyword(THD *thd, TABLE *keywords, struct st_find_field *find_fields, SQL_SELECT *select, int *key_id) { - DBUG_ENTER("search_keyword"); int count= 0; - READ_RECORD read_record_info; - init_read_record(&read_record_info, thd, keywords, select, 1, 0, FALSE); + DBUG_ENTER("search_keyword"); + /* Should never happen. As this is part of help, we can ignore this */ + if (init_read_record(&read_record_info, thd, keywords, select, 1, 0, FALSE)) + DBUG_RETURN(0); + while (!read_record_info.read_record(&read_record_info) && count<2) { if (!select->cond->val_int()) // Dosn't match like @@ -300,13 +305,13 @@ int get_topics_for_keyword(THD *thd, TABLE *topics, TABLE *relations, rkey_id->store((longlong) key_id, TRUE); rkey_id->get_key_image(buff, rkey_id->pack_length(), Field::itRAW); - int key_res= relations->file->index_read_map(relations->record[0], - buff, (key_part_map) 1, - HA_READ_KEY_EXACT); + int key_res= relations->file->ha_index_read_map(relations->record[0], + buff, (key_part_map) 1, + HA_READ_KEY_EXACT); for ( ; !key_res && key_id == (int16) rkey_id->val_int() ; - key_res= relations->file->index_next(relations->record[0])) + key_res= relations->file->ha_index_next(relations->record[0])) { uchar topic_id_buff[8]; longlong topic_id= rtopic_id->val_int(); @@ -314,8 +319,8 @@ int get_topics_for_keyword(THD *thd, TABLE *topics, TABLE *relations, field->store((longlong) topic_id, TRUE); field->get_key_image(topic_id_buff, field->pack_length(), Field::itRAW); - if (!topics->file->index_read_map(topics->record[0], topic_id_buff, - (key_part_map)1, HA_READ_KEY_EXACT)) + if (!topics->file->ha_index_read_map(topics->record[0], topic_id_buff, + (key_part_map)1, HA_READ_KEY_EXACT)) { memorize_variant_topic(thd,topics,count,find_fields, names,name,description,example); @@ -353,10 +358,11 @@ int search_categories(THD *thd, TABLE *categories, Field *pcat_id= find_fields[help_category_help_category_id].field; int count= 0; READ_RECORD read_record_info; - DBUG_ENTER("search_categories"); - init_read_record(&read_record_info, thd, categories, select,1,0,FALSE); + /* Should never happen. As this is part of help, we can ignore this */ + if (init_read_record(&read_record_info, thd, categories, select,1,0,FALSE)) + DBUG_RETURN(0); while (!read_record_info.read_record(&read_record_info)) { if (select && !select->cond->val_int()) @@ -387,10 +393,13 @@ int search_categories(THD *thd, TABLE *categories, void get_all_items_for_category(THD *thd, TABLE *items, Field *pfname, SQL_SELECT *select, List<String> *res) { + READ_RECORD read_record_info; DBUG_ENTER("get_all_items_for_category"); - READ_RECORD read_record_info; - init_read_record(&read_record_info, thd, items, select,1,0,FALSE); + /* Should never happen. As this is part of help, we can ignore this */ + if (init_read_record(&read_record_info, thd, items, select,1,0,FALSE)) + DBUG_VOID_RETURN; + while (!read_record_info.read_record(&read_record_info)) { if (!select->cond->val_int()) @@ -532,7 +541,8 @@ int send_variant_2_list(MEM_ROOT *mem_root, Protocol *protocol, String **end= pointers + names->elements; List_iterator<String> it(*names); - for (pos= pointers; pos!=end; (*pos++= it++)) ; + for (pos= pointers; pos!=end; (*pos++= it++)) + ; my_qsort(pointers,names->elements,sizeof(String*),string_ptr_cmp); |