Commit 5666462f authored by Tom Lane's avatar Tom Lane

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).
parent 4fb5b927
......@@ -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;
}
......@@ -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 )); \
......
......@@ -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
......
......@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootscanner.l,v 1.27 2002/11/04 14:22:32 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootscanner.l,v 1.28 2003/05/29 22:30:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -44,7 +44,11 @@
/* #include "bootstrap_tokens.h" */
int yyline; /* keep track of the line number for error reporting */
/* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */
#define fprintf(file, fmt, msg) ereport(ERROR, (errmsg_internal("%s", msg)))
static int yyline; /* keep track of the line number for error reporting */
%}
......
......@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.106 2003/05/29 20:40:36 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.107 2003/05/29 22:30:02 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -33,7 +33,7 @@
#define YY_READ_BUF_SIZE 16777216
/* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */
#define fprintf(file, fmt, msg) ereport(FATAL, (errmsg_internal("%s", msg)))
#define fprintf(file, fmt, msg) ereport(ERROR, (errmsg_internal("%s", msg)))
extern YYSTYPE yylval;
......
......@@ -4,7 +4,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc-file.l,v 1.15 2003/05/27 17:49:46 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc-file.l,v 1.16 2003/05/29 22:30:02 tgl Exp $
*/
%{
......@@ -21,6 +21,9 @@
#include "utils/elog.h"
#include "utils/guc.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)))
#define CONFIG_FILENAME "postgresql.conf"
static unsigned ConfigFileLineno;
......
......@@ -4,7 +4,7 @@
* procedural language
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/scan.l,v 1.25 2003/05/05 16:46:28 tgl Exp $
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/scan.l,v 1.26 2003/05/29 22:30:02 tgl Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
......@@ -43,7 +43,7 @@
#define YY_READ_BUF_SIZE 16777216
/* Avoid exit() on fatal scanner errors (a bit ugly -- see yy_fatal_error) */
#define fprintf(file, fmt, msg) ereport(FATAL, (errmsg_internal("%s", msg)))
#define fprintf(file, fmt, msg) ereport(ERROR, (errmsg_internal("%s", msg)))
/* Handles to the buffer that the lexer uses internally */
static YY_BUFFER_STATE scanbufhandle;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment