summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorTom Lane2003-05-29 22:30:02 +0000
committerTom Lane2003-05-29 22:30:02 +0000
commit5666462f2e60ffc5c7cf4670381313687625bae4 (patch)
treec5d96da3ffb1c405cada8ec1609dda50a9ef6543 /contrib
parent4fb5b92769e67aff9f9c4b838c047248e7e01f85 (diff)
Ensure that in all flex lexers that are part of the backend, a
yy_fatal_error() call results in elog(ERROR) not exit(). This was already fixed in the main lexer and plpgsql, but extend same technique to all the other dot-l files. Also, on review of the possible calls to yy_fatal_error(), it seems safe to use elog(ERROR) not elog(FATAL).
Diffstat (limited to 'contrib')
-rw-r--r--contrib/cube/cubescan.l4
-rw-r--r--contrib/seg/segscan.l3
-rw-r--r--contrib/tsearch/parser.l3
3 files changed, 9 insertions, 1 deletions
diff --git a/contrib/cube/cubescan.l b/contrib/cube/cubescan.l
index 8367477adb7..1b44397f460 100644
--- a/contrib/cube/cubescan.l
+++ b/contrib/cube/cubescan.l
@@ -7,6 +7,9 @@
#include "buffer.h"
+/* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */
+#define fprintf(file, fmt, msg) ereport(ERROR, (errmsg_internal("%s", msg)))
+
/* flex screws a couple symbols when used with the -P option; fix those */
#define YY_DECL int cube_yylex YY_PROTO(( void )); \
@@ -52,6 +55,5 @@ float ({integer}|{real})([eE]{integer})?
int cube_yylex();
void cube_flush_scanner_buffer(void) {
- fprintf(stderr, "cube_flush_scanner_buffer called\n");
YY_FLUSH_BUFFER;
}
diff --git a/contrib/seg/segscan.l b/contrib/seg/segscan.l
index c0962eca8c5..190174d7427 100644
--- a/contrib/seg/segscan.l
+++ b/contrib/seg/segscan.l
@@ -7,6 +7,9 @@
#include "buffer.h"
+/* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */
+#define fprintf(file, fmt, msg) ereport(ERROR, (errmsg_internal("%s", msg)))
+
/* flex screws a couple symbols when used with the -P option; fix those */
#define YY_DECL int seg_yylex YY_PROTO(( void )); \
diff --git a/contrib/tsearch/parser.l b/contrib/tsearch/parser.l
index fb34aac7137..4323bda7ef0 100644
--- a/contrib/tsearch/parser.l
+++ b/contrib/tsearch/parser.l
@@ -4,6 +4,9 @@
#include "deflex.h"
#include "parser.h"
+/* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */
+#define fprintf(file, fmt, msg) ereport(ERROR, (errmsg_internal("%s", msg)))
+
/* postgres allocation function */
#define free pfree
#define malloc palloc