Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
53ad0aa2
Commit
53ad0aa2
authored
Sep 24, 1997
by
Thomas G. Lockhart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore proper behavior for escaped quotes and for escaped literals
like newline inside quoted strings.
parent
c7dbd366
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
src/backend/parser/scan.l
src/backend/parser/scan.l
+20
-3
No files found.
src/backend/parser/scan.l
View file @
53ad0aa2
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.2
1 1997/09/13 03:12:5
5 thomas Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.2
2 1997/09/24 17:48:2
5 thomas Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -91,8 +91,9 @@ quote '
xqstart {quote}
xqstop {quote}
xqdouble {quote}{quote}
xqinside [^\']*
xqliteral [\\].
xqinside [^\\']*
xqembedded "\\'"
xqliteral [\\](.|\n)
xcline [\/][\*].*[\*][\/]{space}*\n*
xcstart [\/][\*]{op_and_self}*
...
...
@@ -132,6 +133,14 @@ other .
/* DO NOT PUT ANY COMMENTS IN THE FOLLOWING SECTION.
* AT&T lex does not properly handle C-style comments in this second lex block.
* So, put comments here. tgl - 1997-09-08
*
* Quoted strings must allow some special characters such as single-quote
* and newline.
* Embedded single-quotes are implemented both in the SQL/92-standard
* style of two adjacent single quotes "''" and in the Postgres/Java style
* of escaped-quote "\'".
* Other embedded escaped characters are matched explicitly and the leading
* backslash is dropped from the string. - thomas 1997-09-24
*/
%%
...
...
@@ -163,6 +172,14 @@ other .
memcpy(literal+llen, yytext, yyleng+1);
llen += yyleng;
}
<xq>{xqembedded} {
if ((llen+yyleng-1) > (MAX_PARSE_BUFFER - 1))
elog(WARN,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
memcpy(literal+llen, yytext, yyleng+1);
*(literal+llen) = '\'';
llen += yyleng;
}
<xq>{xqliteral} {
if ((llen+yyleng-1) > (MAX_PARSE_BUFFER - 1))
elog(WARN,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment