[Groonga-commit] groonga/groonga at cf98616 [master] Make registered proc check more robust

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Jun 9 20:08:58 JST 2013


Kouhei Sutou	2013-06-09 20:08:58 +0900 (Sun, 09 Jun 2013)

  New Revision: cf98616bdf27cf4fe86c65c4460d157544caa705
  https://github.com/groonga/groonga/commit/cf98616bdf27cf4fe86c65c4460d157544caa705

  Message:
    Make registered proc check more robust

  Modified files:
    lib/db.c

  Modified: lib/db.c (+3 -1)
===================================================================
--- lib/db.c    2013-06-09 19:44:04 +0900 (456d50c)
+++ lib/db.c    2013-06-09 20:08:58 +0900 (78607c4)
@@ -583,7 +583,9 @@ grn_proc_create(grn_ctx *ctx, const char *name, int name_size, grn_proc_type typ
     if (!added) {
       db_value *vp;
       if ((vp = grn_tiny_array_at(&s->values, id)) && (res = (grn_proc *)vp->ptr)) {
-        if (res->funcs[PROC_INIT]) {
+        if (res->funcs[PROC_INIT] ||
+            res->funcs[PROC_NEXT] ||
+            res->funcs[PROC_FIN]) {
           ERR(GRN_INVALID_ARGUMENT, "already used name");
           GRN_API_RETURN(NULL);
         }
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index