From d397c1c8a2dfec4ac93eb0e1b3f96418bb98fdd7 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter_e@gmx.net>
Date: Mon, 30 Oct 2000 17:54:16 +0000
Subject: [PATCH] Disallow zero-length delimited identifier (per SQL).

---
 src/backend/parser/scan.l | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/backend/parser/scan.l b/src/backend/parser/scan.l
index 13e6b92eda2..8a782f72aa6 100644
--- a/src/backend/parser/scan.l
+++ b/src/backend/parser/scan.l
@@ -9,10 +9,12 @@
  *
  *
  * 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 <unistd.h>
 #ifndef __linux__
@@ -20,8 +22,6 @@
 #endif
 #include <errno.h>
 
-#include "postgres.h"
-
 #include "miscadmin.h"
 #include "nodes/parsenodes.h"
 #include "nodes/pg_list.h"
@@ -347,6 +347,8 @@ other			.
 				}
 <xd>{xdstop}	{
 					BEGIN(INITIAL);
+					if (strlen(literalbuf) == 0)
+						elog(ERROR, "zero-length delimited identifier");
 					if (strlen(literalbuf) >= NAMEDATALEN)
 					{
 #ifdef MULTIBYTE
-- 
GitLab