Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c6d3c1b

Browse files
committed
Fix seriously broken patch for psql '' ... per its comment, emit() is
NOT the thing to use here.
1 parent 8f165ee commit c6d3c1b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/bin/psql/psqlscan.l

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* Portions Copyright (c) 1994, Regents of the University of California
3434
*
3535
* IDENTIFICATION
36-
* $PostgreSQL: pgsql/src/bin/psql/psqlscan.l,v 1.19 2006/05/31 11:35:17 momjian Exp $
36+
* $PostgreSQL: pgsql/src/bin/psql/psqlscan.l,v 1.20 2006/05/31 22:11:44 tgl Exp $
3737
*
3838
*-------------------------------------------------------------------------
3939
*/
@@ -857,12 +857,14 @@ other .
857857
}
858858

859859
<xslashquote>{
860-
/* single-quoted text: copy literally except for backslash sequences */
860+
/*
861+
* single-quoted text: copy literally except for '' and backslash
862+
* sequences
863+
*/
861864

862865
{quote} { return LEXRES_OK; }
863866

864-
/* We don't need a state here because we are already in a string */
865-
{xqdouble} { emit("'", 1); }
867+
{xqdouble} { appendPQExpBufferChar(output_buf, '\''); }
866868

867869
"\\n" { appendPQExpBufferChar(output_buf, '\n'); }
868870
"\\t" { appendPQExpBufferChar(output_buf, '\t'); }

0 commit comments

Comments
 (0)