From: Yoshiyuki Asaba <[EMAIL PROTECTED]>
Subject: Re: [Pgpool-general] hanging pgpool processes during massive UPDATEs
Date: Thu, 11 Oct 2007 17:12:26 +0900 (JST)

> I will fix tomorrow, sorry.

It's done. The patch is attached.

  % cp diff pgpool-II-1.2.1/
  % cd pgpool-II-1.2.1/
  % patch -p0 < diff
  % make install

--
Yoshiyuki Asaba
[EMAIL PROTECTED]
Index: parser/parser.c
===================================================================
RCS file: /cvsroot/pgpool/pgpool-II/parser/parser.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 parser.c
*** parser/parser.c     8 Sep 2006 03:36:42 -0000       1.1.1.1
--- parser/parser.c     12 Oct 2007 05:13:44 -0000
***************
*** 20,25 ****
--- 20,26 ----
   */
  
  #include <string.h>
+ #include "pool_parser.h"
  #include "pool_memory.h"
  #include "gramparse.h"
  #include "gram.h"
***************
*** 27,32 ****
--- 28,34 ----
  #include "value.h"
  
  List     *parsetree;                  /* result of parsing is left here */
+ jmp_buf    jmpbuffer;
  
  static int    lookahead_token;        /* one-token lookahead */
  static bool have_lookahead;           /* lookahead_token set? */
***************
*** 50,62 ****
        scanner_init(str);
        parser_init();
  
!       yyresult = yyparse();
! 
!       scanner_finish();
  
!       if (yyresult)                           /* error */
!               return NIL;
  
        return parsetree;
  }
  
--- 52,71 ----
        scanner_init(str);
        parser_init();
  
!       if (setjmp(jmpbuffer) != 0)
!       {
!               scanner_finish();
!               return NIL; /* error */
!       }
!       else
!       {
!               yyresult = yyparse();
  
!               scanner_finish();
  
+               if (yyresult)                           /* error */
+                       return NIL;
+       }
        return parsetree;
  }
  
Index: parser/pool_parser.h
===================================================================
RCS file: /cvsroot/pgpool/pgpool-II/parser/pool_parser.h,v
retrieving revision 1.2
diff -c -r1.2 pool_parser.h
*** parser/pool_parser.h        17 May 2007 06:46:02 -0000      1.2
--- parser/pool_parser.h        12 Oct 2007 05:13:44 -0000
***************
*** 2,7 ****
--- 2,10 ----
  #define POOL_PARSER_H
  
  #include "../pool_type.h"
+ #include <setjmp.h>
+ 
+ extern jmp_buf jmpbuffer;
  
  /* integer */
  typedef signed int int32;
Index: parser/scan.l
===================================================================
RCS file: /cvsroot/pgpool/pgpool-II/parser/scan.l,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 scan.l
*** parser/scan.l       8 Sep 2006 03:36:48 -0000       1.1.1.1
--- parser/scan.l       12 Oct 2007 05:13:45 -0000
***************
*** 34,39 ****
--- 34,40 ----
  #include <unistd.h>
  #include <errno.h>
  #include <string.h>
+ #include <setjmp.h>
  
  #define ereport(a,b)
  
***************
*** 742,748 ****
  void
  yyerror(const char *message)
  {
!       /* do nothing */
  }
  
  
--- 743,749 ----
  void
  yyerror(const char *message)
  {
!       longjmp(jmpbuffer, 1);
  }
  
  
_______________________________________________
Pgpool-general mailing list
[email protected]
http://pgfoundry.org/mailman/listinfo/pgpool-general

Reply via email to