On Sun, 17 Jul 2005, Tom Lane wrote:

> The short answer is that you should install flex 2.5.4, or else forget
> about testing the 7.2 branch.  I don't think anyone will be very
> interested in making 7.2 work with flex 2.5.31.
> 

Actually there are problems in the 7.3 branch as well in the cube,
tsearch, and seg modules.  Here are some patches for the 7.2 version check
and 7.2 and 7.3 tsearch code.  I'll work on getting cube and seg up to
speed as well if people agree we want these fixes.

Kris Jurka
Index: config/programs.m4
===================================================================
RCS file: /projects/cvsroot/pgsql/config/programs.m4,v
retrieving revision 1.7
diff -c -r1.7 programs.m4
*** config/programs.m4  28 Aug 2001 14:59:11 -0000      1.7
--- config/programs.m4  16 Jul 2005 18:11:24 -0000
***************
*** 26,32 ****
        then
          echo '%%'  > conftest.l
          if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER 
>/dev/null 2>&1; then
!           if $pgac_candidate --version | grep '2\.5\.3' >/dev/null 2>&1; then
              pgac_broken_flex=$pgac_candidate
              continue
            fi
--- 26,32 ----
        then
          echo '%%'  > conftest.l
          if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER 
>/dev/null 2>&1; then
!           if $pgac_candidate --version | grep '2\.5\.3$' >/dev/null 2>&1; then
              pgac_broken_flex=$pgac_candidate
              continue
            fi
? contrib/tsearch/libtsearch.so.0.0
? contrib/tsearch/parser.c
? contrib/tsearch/results
? contrib/tsearch/tsearch.sql
Index: contrib/tsearch/parser.h
===================================================================
RCS file: /projects/cvsroot/pgsql/contrib/tsearch/Attic/parser.h,v
retrieving revision 1.3
diff -c -r1.3 parser.h
*** contrib/tsearch/parser.h    28 Oct 2001 06:25:41 -0000      1.3
--- contrib/tsearch/parser.h    16 Jul 2005 18:11:53 -0000
***************
*** 5,11 ****
  int                   tokenlen;
  int                   tsearch_yylex(void);
  void          start_parse_str(char *, int);
- void          start_parse_fh(FILE *, int);
  void          end_parse(void);
  
  #endif
--- 5,10 ----
Index: contrib/tsearch/parser.l
===================================================================
RCS file: /projects/cvsroot/pgsql/contrib/tsearch/Attic/parser.l,v
retrieving revision 1.1
diff -c -r1.1 parser.l
*** contrib/tsearch/parser.l    12 Oct 2001 23:19:09 -0000      1.1
--- contrib/tsearch/parser.l    16 Jul 2005 18:11:53 -0000
***************
*** 1,56 ****
  %{
  #include <string.h>
  #include "deflex.h"
  #include "parser.h"
  
- /* postgres allocation function */
- #include "postgres.h"
- #define free  pfree
- #define malloc        palloc
- #define realloc repalloc
- 
- #ifdef strdup
- #undef strdup
- #endif
- #define strdup        pstrdup
- 
- 
  char *token = NULL;  /* pointer to token */
  char *s     = NULL;  /* for returning full defis-word */
  
  YY_BUFFER_STATE buf = NULL; /* buffer to parse; it need for parse from string 
*/
  
- int lrlimit = -1;     /* for limiting read from filehandle ( -1 - unlimited 
read ) */
- int bytestoread = 0;  /* for limiting read from filehandle */
- 
- /* redefine macro for read limited length */
- #define YY_INPUT(buf,result,max_size) \
-       if ( yy_current_buffer->yy_is_interactive ) { \
-                 int c = '*', n; \
-                 for ( n = 0; n < max_size && \
-                              (c = getc( tsearch_yyin )) != EOF && c != '\n'; 
++n ) \
-                         buf[n] = (char) c; \
-                 if ( c == '\n' ) \
-                         buf[n++] = (char) c; \
-                 if ( c == EOF && ferror( tsearch_yyin ) ) \
-                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
-                 result = n; \
-         }  else { \
-               if ( lrlimit == 0 ) \
-                       result=YY_NULL; \
-               else { \
-                       if ( lrlimit>0 ) { \
-                               bytestoread = ( lrlimit > max_size ) ? max_size 
: lrlimit; \
-                               lrlimit -= bytestoread; \
-                       } else \
-                               bytestoread = max_size; \
-                       if ( ((result = fread( buf, 1, bytestoread, 
tsearch_yyin )) == 0) \
-                               && ferror( tsearch_yyin ) ) \
-                               YY_FATAL_ERROR( "input in flex scanner failed" 
); \
-               } \
-       }
- 
- #define YY_NO_UNPUT
  %}
  
  /* parser's state for parsing defis-word */
--- 1,14 ----
  %{
+ #include "postgres.h"
  #include <string.h>
  #include "deflex.h"
  #include "parser.h"
  
  char *token = NULL;  /* pointer to token */
  char *s     = NULL;  /* for returning full defis-word */
  
  YY_BUFFER_STATE buf = NULL; /* buffer to parse; it need for parse from string 
*/
  
  %}
  
  /* parser's state for parsing defis-word */
***************
*** 308,320 ****
        BEGIN INITIAL;
  }
  
- /* start parse from filehandle */
- void start_parse_fh( FILE* fh, int limit ) {
-       if (buf) end_parse();
-       lrlimit = ( limit ) ? limit : -1;
-       buf = tsearch_yy_create_buffer( fh, YY_BUF_SIZE );
-       tsearch_yy_switch_to_buffer( buf );
-       BEGIN INITIAL;
- }
- 
  
--- 266,269 ----
? contrib/tsearch/libtsearch.so.0.0
? contrib/tsearch/parser.c
? contrib/tsearch/results
? contrib/tsearch/tsearch.sql
Index: contrib/tsearch/parser.h
===================================================================
RCS file: /projects/cvsroot/pgsql/contrib/tsearch/Attic/parser.h,v
retrieving revision 1.3
diff -c -r1.3 parser.h
*** contrib/tsearch/parser.h    28 Oct 2001 06:25:41 -0000      1.3
--- contrib/tsearch/parser.h    16 Jul 2005 18:12:13 -0000
***************
*** 5,11 ****
  int                   tokenlen;
  int                   tsearch_yylex(void);
  void          start_parse_str(char *, int);
- void          start_parse_fh(FILE *, int);
  void          end_parse(void);
  
  #endif
--- 5,10 ----
Index: contrib/tsearch/parser.l
===================================================================
RCS file: /projects/cvsroot/pgsql/contrib/tsearch/Attic/parser.l,v
retrieving revision 1.4
diff -c -r1.4 parser.l
*** contrib/tsearch/parser.l    5 Sep 2002 00:43:06 -0000       1.4
--- contrib/tsearch/parser.l    16 Jul 2005 18:12:13 -0000
***************
*** 4,54 ****
  #include "deflex.h"
  #include "parser.h"
  
- /* postgres allocation function */
- #define free    pfree
- #define malloc  palloc
- #define realloc repalloc
- 
- #ifdef strdup
- #undef strdup
- #endif
- #define strdup  pstrdup
- 
  char *token = NULL;  /* pointer to token */
  char *s     = NULL;  /* to return WHOLE hyphenated-word */
  
  YY_BUFFER_STATE buf = NULL; /* buffer to parse; it need for parse from string 
*/
  
- int lrlimit = -1;     /* for limiting read from filehandle ( -1 - unlimited 
read ) */
- int bytestoread = 0;  /* for limiting read from filehandle */
- 
- /* redefine macro for read limited length */
- #define YY_INPUT(buf,result,max_size) \
-       if ( yy_current_buffer->yy_is_interactive ) { \
-                 int c = '*', n; \
-                 for ( n = 0; n < max_size && \
-                              (c = getc( tsearch_yyin )) != EOF && c != '\n'; 
++n ) \
-                         buf[n] = (char) c; \
-                 if ( c == '\n' ) \
-                         buf[n++] = (char) c; \
-                 if ( c == EOF && ferror( tsearch_yyin ) ) \
-                         YY_FATAL_ERROR( "input in flex scanner failed" ); \
-                 result = n; \
-         }  else { \
-               if ( lrlimit == 0 ) \
-                       result=YY_NULL; \
-               else { \
-                       if ( lrlimit>0 ) { \
-                               bytestoread = ( lrlimit > max_size ) ? max_size 
: lrlimit; \
-                               lrlimit -= bytestoread; \
-                       } else \
-                               bytestoread = max_size; \
-                       if ( ((result = fread( buf, 1, bytestoread, 
tsearch_yyin )) == 0) \
-                               && ferror( tsearch_yyin ) ) \
-                               YY_FATAL_ERROR( "input in flex scanner failed" 
); \
-               } \
-       }
- 
  %}
  
  %option 8bit
--- 4,14 ----
***************
*** 324,336 ****
        BEGIN INITIAL;
  }
  
- /* start parse from filehandle */
- void start_parse_fh( FILE* fh, int limit ) {
-       if (buf) end_parse();
-       lrlimit = ( limit ) ? limit : -1;
-       buf = tsearch_yy_create_buffer( fh, YY_BUF_SIZE );
-       tsearch_yy_switch_to_buffer( buf );
-       BEGIN INITIAL;
- }
- 
  
--- 284,287 ----
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to