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
7e99cea8
Commit
7e99cea8
authored
Sep 11, 2001
by
Tatsuo Ishii
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement following item in TODO:
* Reject character sequences those are not valid in their charset
parent
95dc7785
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
src/backend/utils/adt/varchar.c
src/backend/utils/adt/varchar.c
+12
-1
src/backend/utils/adt/varlena.c
src/backend/utils/adt/varlena.c
+10
-1
No files found.
src/backend/utils/adt/varchar.c
View file @
7e99cea8
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.8
1 2001/07/15 11:07:37
ishii Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.8
2 2001/09/11 05:18:59
ishii Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -75,10 +75,14 @@ bpcharin(PG_FUNCTION_ARGS)
...
@@ -75,10 +75,14 @@ bpcharin(PG_FUNCTION_ARGS)
int
i
;
int
i
;
#ifdef MULTIBYTE
#ifdef MULTIBYTE
int
charlen
;
/* number of charcters in the input string */
int
charlen
;
/* number of charcters in the input string */
char
*
ermsg
;
#endif
#endif
len
=
strlen
(
s
);
len
=
strlen
(
s
);
#ifdef MULTIBYTE
#ifdef MULTIBYTE
if
((
ermsg
=
pg_verifymbstr
(
s
,
len
)))
elog
(
ERROR
,
"%s"
,
ermsg
);
charlen
=
pg_mbstrlen
(
s
);
charlen
=
pg_mbstrlen
(
s
);
#endif
#endif
...
@@ -405,8 +409,15 @@ varcharin(PG_FUNCTION_ARGS)
...
@@ -405,8 +409,15 @@ varcharin(PG_FUNCTION_ARGS)
int32
atttypmod
=
PG_GETARG_INT32
(
2
);
int32
atttypmod
=
PG_GETARG_INT32
(
2
);
VarChar
*
result
;
VarChar
*
result
;
size_t
len
,
maxlen
;
size_t
len
,
maxlen
;
#ifdef MULTIBYTE
char
*
ermsg
;
#endif
len
=
strlen
(
s
);
len
=
strlen
(
s
);
#ifdef MULTIBYTE
if
((
ermsg
=
pg_verifymbstr
(
s
,
len
)))
elog
(
ERROR
,
"%s"
,
ermsg
);
#endif
maxlen
=
atttypmod
-
VARHDRSZ
;
maxlen
=
atttypmod
-
VARHDRSZ
;
if
(
atttypmod
>=
(
int32
)
VARHDRSZ
&&
len
>
maxlen
)
if
(
atttypmod
>=
(
int32
)
VARHDRSZ
&&
len
>
maxlen
)
...
...
src/backend/utils/adt/varlena.c
View file @
7e99cea8
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.7
1 2001/08/13 18:45:35 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.7
2 2001/09/11 05:18:59 ishii
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -154,8 +154,17 @@ textin(PG_FUNCTION_ARGS)
...
@@ -154,8 +154,17 @@ textin(PG_FUNCTION_ARGS)
char
*
inputText
=
PG_GETARG_CSTRING
(
0
);
char
*
inputText
=
PG_GETARG_CSTRING
(
0
);
text
*
result
;
text
*
result
;
int
len
;
int
len
;
#ifdef MULTIBYTE
char
*
ermsg
;
#endif
len
=
strlen
(
inputText
)
+
VARHDRSZ
;
len
=
strlen
(
inputText
)
+
VARHDRSZ
;
#ifdef MULTIBYTE
if
((
ermsg
=
pg_verifymbstr
(
inputText
,
len
-
VARHDRSZ
)))
elog
(
ERROR
,
"%s"
,
ermsg
);
#endif
result
=
(
text
*
)
palloc
(
len
);
result
=
(
text
*
)
palloc
(
len
);
VARATT_SIZEP
(
result
)
=
len
;
VARATT_SIZEP
(
result
)
=
len
;
...
...
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