Disallow zero-length delimited identifier (per SQL).
authorPeter Eisentraut <peter_e@gmx.net>
Mon, 30 Oct 2000 17:54:16 +0000 (17:54 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Mon, 30 Oct 2000 17:54:16 +0000 (17:54 +0000)
src/backend/parser/scan.l

index dfcbd9364994c6baa2fecf7e026a1eac6bf0ab68..b4aef2d02e53fe791fcf90ab545b16bdfe134d91 100644 (file)
@@ -13,6 +13,8 @@
  *
  *-------------------------------------------------------------------------
  */
+#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