Fix seriously broken patch for psql '' ... per its comment, emit() is
authorTom Lane
Wed, 31 May 2006 22:11:44 +0000 (22:11 +0000)
committerTom Lane
Wed, 31 May 2006 22:11:44 +0000 (22:11 +0000)
NOT the thing to use here.

src/bin/psql/psqlscan.l

index 2c19b7ae9e1fb7ab76d7a282c8b10db3533ac6b8..484558a1415a117e6241b10221eaab83762987f0 100644 (file)
@@ -33,7 +33,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/src/bin/psql/psqlscan.l,v 1.19 2006/05/31 11:35:17 momjian Exp $
+ *   $PostgreSQL: pgsql/src/bin/psql/psqlscan.l,v 1.20 2006/05/31 22:11:44 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -857,12 +857,14 @@ other         .
 }
 
 {
-   /* single-quoted text: copy literally except for backslash sequences */
+   /*
+    * single-quoted text: copy literally except for '' and backslash
+    * sequences
+    */
 
 {quote}            { return LEXRES_OK; }
 
-    /* We don't need a state here because we are already in a string */
-{xqdouble}     { emit("'", 1); }
+{xqdouble}     { appendPQExpBufferChar(output_buf, '\''); }
 
 "\\n"          { appendPQExpBufferChar(output_buf, '\n'); }
 "\\t"          { appendPQExpBufferChar(output_buf, '\t'); }