Commit d397c1c8 authored by Peter Eisentraut's avatar Peter Eisentraut

Disallow zero-length delimited identifier (per SQL).

parent c7a3e0df
...@@ -9,10 +9,12 @@ ...@@ -9,10 +9,12 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.78 2000/10/29 16:11:33 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.79 2000/10/30 17:54:16 petere Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
#include "postgres.h"
#include <ctype.h> #include <ctype.h>
#include <unistd.h> #include <unistd.h>
#ifndef __linux__ #ifndef __linux__
...@@ -20,8 +22,6 @@ ...@@ -20,8 +22,6 @@
#endif #endif
#include <errno.h> #include <errno.h>
#include "postgres.h"
#include "miscadmin.h" #include "miscadmin.h"
#include "nodes/parsenodes.h" #include "nodes/parsenodes.h"
#include "nodes/pg_list.h" #include "nodes/pg_list.h"
...@@ -347,6 +347,8 @@ other . ...@@ -347,6 +347,8 @@ other .
} }
<xd>{xdstop} { <xd>{xdstop} {
BEGIN(INITIAL); BEGIN(INITIAL);
if (strlen(literalbuf) == 0)
elog(ERROR, "zero-length delimited identifier");
if (strlen(literalbuf) >= NAMEDATALEN) if (strlen(literalbuf) >= NAMEDATALEN)
{ {
#ifdef MULTIBYTE #ifdef MULTIBYTE
......
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