X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=index%2Fzsets.c;h=a1687304db170f5f44215eaa81372f267a2de2bc;hp=b98c7643ce3bdd90a753ce59d7ac37653c1f41dd;hb=96e4c5479e111511f5df3531b6648931251b9e5d;hpb=d0d4772450cfe6afde24ed8ec4031afd2da56632 diff --git a/index/zsets.c b/index/zsets.c index b98c764..a168730 100644 --- a/index/zsets.c +++ b/index/zsets.c @@ -1,5 +1,5 @@ /* This file is part of the Zebra server. - Copyright (C) 1994-2009 Index Data + Copyright (C) 1994-2011 Index Data Zebra is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -18,6 +18,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#if HAVE_CONFIG_H +#include +#endif #include #include #ifdef WIN32 @@ -905,7 +908,6 @@ ZEBRA_RES resultSetSortSingle(ZebraHandle zh, NMEM nmem, { Z_SortKeySpec *sks = sort_sequence->specs[i]; Z_SortKey *sk; - ZEBRA_RES res; sort_criteria[i].ord = (int *) nmem_malloc(nmem, sizeof(int)*numbases); @@ -977,13 +979,12 @@ ZEBRA_RES resultSetSortSingle(ZebraHandle zh, NMEM nmem, for (ib = 0; ib < numbases; ib++) { zebraExplain_curDatabase(zh->reg->zei, zh->basenames[ib]); - res = zebra_sort_get_ord(zh, sk->u.sortAttributes, - &sort_criteria[i].ord[ib], - &sort_criteria[i].numerical[ib]); + if (zebra_sort_get_ord(zh, sk->u.sortAttributes, + &sort_criteria[i].ord[ib], + &sort_criteria[i].numerical[ib]) != + ZEBRA_OK && sks->which != Z_SortKeySpec_null) + return ZEBRA_FAIL; } - - if (sks->which != Z_SortKeySpec_null && res != ZEBRA_OK) - return ZEBRA_FAIL; break; } /* right now we look up the index type based on the first database