/[pgestraier]/trunk/pgest.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/pgest.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 31 by dpavlin, Wed Jul 6 14:47:56 2005 UTC revision 40 by dpavlin, Sat Sep 10 18:51:13 2005 UTC
# Line 39  Line 39 
39   #define SortMem 16 * 1024   #define SortMem 16 * 1024
40  #endif  #endif
41    
42    #define ATTR_DELIMITER "{{!}}"
43    
44  /* prototype */  /* prototype */
45  char *attr2text(ESTDOC *doc, char *attr);  char *attr2text(ESTDOC *doc, char *attr);
46    
# Line 203  Datum pgest_attr(PG_FUNCTION_ARGS) Line 205  Datum pgest_attr(PG_FUNCTION_ARGS)
205    
206          /* minimum valid attribute length is 10: @a STREQ a */          /* minimum valid attribute length is 10: @a STREQ a */
207          if (! PG_ARGISNULL(2) && strlen(attr) >= 10) {          if (! PG_ARGISNULL(2) && strlen(attr) >= 10) {
208                  elog(DEBUG1,"est_cond_add_attr(%s)", attr);                  elog(DEBUG1,"attributes: %s", attr);
209                  est_cond_add_attr(cond, attr);                  char *curr_attr;
210                    curr_attr = strtok(attr, ATTR_DELIMITER);
211                    while (curr_attr) {
212                            elog(DEBUG1,"est_cond_add_attr(%s)", curr_attr);
213                            est_cond_add_attr(cond, curr_attr);
214                            curr_attr = strtok(NULL, ATTR_DELIMITER);
215                    }
216          }          }
217    
218          /* set the search phrase to the search condition object */          /* set the search phrase to the search condition object */
# Line 213  Datum pgest_attr(PG_FUNCTION_ARGS) Line 221  Datum pgest_attr(PG_FUNCTION_ARGS)
221                  est_cond_set_order(cond, order);                  est_cond_set_order(cond, order);
222          }          }
223    
224            if (limit) {
225                    elog(DEBUG1,"est_cond_set_max(%d)", limit + offset);
226                    est_cond_set_max(cond, limit + offset);
227            }
228    
229          /* get the result of search */          /* get the result of search */
230          est_result = est_db_search(db, cond, &resnum, NULL);          est_result = est_db_search(db, cond, &resnum, NULL);
231    

Legend:
Removed from v.31  
changed lines
  Added in v.40

  ViewVC Help
Powered by ViewVC 1.1.26