if(q_handle->next_count != 0)
{
- ADVANCED_CATCH_SET_ERROR(((q_handle->category_pos + q_handle->next_count) < q_handle->category_total_count), {}, QUERY_NO_RECORD, ("no record"));
- ADVANCED_CATCH_SET_ERROR((q_handle->category[q_handle->category_pos + q_handle->next_count].sibling != 0), {}, QUERY_NO_RECORD, ("no record"));
- q_handle->category_pos = q_handle->category_pos + q_handle->next_count;
+ ADVANCED_CATCH_SET_ERROR(((q_handle->category_pos + 1) < q_handle->category_total_count), {}, QUERY_NO_RECORD, ("no record"));
+ ADVANCED_CATCH_SET_ERROR((q_handle->category[q_handle->category_pos + 1].sibling != 0), {}, QUERY_NO_RECORD, ("no record"));
+ q_handle->category_pos++;
q_handle->next_count++;
return QUERY_SUCCESS;
}else
low = j + 1;
else if(q_handle->category[j].contact_id == contact_id)
{
+ while(j > 0 && q_handle->category[j-1].contact_id == contact_id)
+ j--;
q_handle->category_pos = j;
q_handle->next_count++;
return QUERY_SUCCESS;