Make a pstrdup copy of the literalbuf when scanning a bit string. Other-
authorPeter Eisentraut
Thu, 16 Nov 2000 22:47:44 +0000 (22:47 +0000)
committerPeter Eisentraut
Thu, 16 Nov 2000 22:47:44 +0000 (22:47 +0000)
wise the next bit string in the same command clobbers the previous ones.

src/backend/parser/scan.l

index ced8d63c758a39b9f7741368591de8eabdef1798..51710c1c394207a7e3128257a2fec704ea357ff9 100644 (file)
@@ -9,7 +9,7 @@
  *
  *
  * IDENTIFICATION
- *   $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.82 2000/11/02 23:20:27 tgl Exp $
+ *   $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.83 2000/11/16 22:47:44 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -289,7 +289,7 @@ other           .
                    if (literalbuf[strspn(literalbuf + 1, "01") + 1] != '\0')
                        elog(ERROR, "invalid bit string input: '%s'",
                             literalbuf);
-                   yylval.str = literalbuf;
+                   yylval.str = pstrdup(literalbuf);
                    return BITCONST;
                }
 {xhinside} |