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
84d0865d
Commit
84d0865d
authored
Aug 22, 2000
by
Tatsuo Ishii
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make scanner multibyte aware. Currently it may produce an incorrect
multibyte sequence while truncating identifiers.
parent
bc2cf76a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
src/backend/parser/scan.l
src/backend/parser/scan.l
+21
-1
No files found.
src/backend/parser/scan.l
View file @
84d0865d
...
...
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.7
5 2000/08/12 05:15:21 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.7
6 2000/08/22 13:01:20 ishii
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -31,6 +31,10 @@
#include "parser/scansup.h"
#include "utils/builtins.h"
#ifdef MULTIBYTE
#include "mb/pg_wchar.h"
#endif
extern char *parseString;
static char *parseCh;
...
...
@@ -345,9 +349,17 @@ other .
BEGIN(INITIAL);
if (strlen(literalbuf) >= NAMEDATALEN)
{
#ifdef MULTIBYTE
int len;
len = pg_mbcliplen(literalbuf,strlen(literalbuf),NAMEDATALEN-1);
elog(NOTICE, "identifier \"%s\" will be truncated to \"%.*s\"",
literalbuf, len, literalbuf);
literalbuf[len] = '\0';
#else
elog(NOTICE, "identifier \"%s\" will be truncated to \"%.*s\"",
literalbuf, NAMEDATALEN-1, literalbuf);
literalbuf[NAMEDATALEN-1] = '\0';
#endif
}
yylval.str = pstrdup(literalbuf);
return IDENT;
...
...
@@ -471,9 +483,17 @@ other .
yytext[i] = tolower(yytext[i]);
if (i >= NAMEDATALEN)
{
#ifdef MULTIBYTE
int len;
len = pg_mbcliplen(yytext,i,NAMEDATALEN-1);
elog(NOTICE, "identifier \"%s\" will be truncated to \"%.*s\"",
yytext, len, yytext);
yytext[len] = '\0';
#else
elog(NOTICE, "identifier \"%s\" will be truncated to \"%.*s\"",
yytext, NAMEDATALEN-1, yytext);
yytext[NAMEDATALEN-1] = '\0';
#endif
}
keyword = ScanKeywordLookup((char*)yytext);
if (keyword != NULL) {
...
...
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