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
1bbbcb04
Commit
1bbbcb04
authored
May 05, 2009
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make new complaint about unsafe Unicode literals include an error location.
Every other ereport in scan.l has one, this should too.
parent
249a899f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
src/backend/parser/scan.l
src/backend/parser/scan.l
+4
-3
src/test/regress/expected/strings.out
src/test/regress/expected/strings.out
+12
-0
No files found.
src/backend/parser/scan.l
View file @
1bbbcb04
...
...
@@ -24,7 +24,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/scan.l,v 1.15
2 2009/05/05 18:32:17 petere
Exp $
* $PostgreSQL: pgsql/src/backend/parser/scan.l,v 1.15
3 2009/05/05 21:09:23 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -469,12 +469,13 @@ other .
startlit();
}
{xusstart} {
SET_YYLLOC();
if (!standard_conforming_strings)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("unsafe use of string constant with Unicode escapes"),
errdetail("String constants with Unicode escapes cannot be used when standard_conforming_strings is off.")
));
SET_YYLLOC(
);
errdetail("String constants with Unicode escapes cannot be used when standard_conforming_strings is off.")
,
lexer_errposition())
);
BEGIN(xus);
startlit();
}
...
...
src/test/regress/expected/strings.out
View file @
1bbbcb04
...
...
@@ -62,12 +62,18 @@ LINE 1: SELECT U&'wrong: +0061' UESCAPE '+';
SET standard_conforming_strings TO off;
SELECT U&'d\0061t\+000061' AS U&"d\0061t\+000061";
ERROR: unsafe use of string constant with Unicode escapes
LINE 1: SELECT U&'d\0061t\+000061' AS U&"d\0061t\+000061";
^
DETAIL: String constants with Unicode escapes cannot be used when standard_conforming_strings is off.
SELECT U&'d!0061t\+000061' UESCAPE '!' AS U&"d*0061t\+000061" UESCAPE '*';
ERROR: unsafe use of string constant with Unicode escapes
LINE 1: SELECT U&'d!0061t\+000061' UESCAPE '!' AS U&"d*0061t\+000061...
^
DETAIL: String constants with Unicode escapes cannot be used when standard_conforming_strings is off.
SELECT U&' \' UESCAPE '!' AS "tricky";
ERROR: unsafe use of string constant with Unicode escapes
LINE 1: SELECT U&' \' UESCAPE '!' AS "tricky";
^
DETAIL: String constants with Unicode escapes cannot be used when standard_conforming_strings is off.
SELECT 'tricky' AS U&"\" UESCAPE '!';
\
...
...
@@ -77,12 +83,18 @@ SELECT 'tricky' AS U&"\" UESCAPE '!';
SELECT U&'wrong: \061';
ERROR: unsafe use of string constant with Unicode escapes
LINE 1: SELECT U&'wrong: \061';
^
DETAIL: String constants with Unicode escapes cannot be used when standard_conforming_strings is off.
SELECT U&'wrong: \+0061';
ERROR: unsafe use of string constant with Unicode escapes
LINE 1: SELECT U&'wrong: \+0061';
^
DETAIL: String constants with Unicode escapes cannot be used when standard_conforming_strings is off.
SELECT U&'wrong: +0061' UESCAPE '+';
ERROR: unsafe use of string constant with Unicode escapes
LINE 1: SELECT U&'wrong: +0061' UESCAPE '+';
^
DETAIL: String constants with Unicode escapes cannot be used when standard_conforming_strings is off.
RESET standard_conforming_strings;
--
...
...
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