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
59d9a370
Commit
59d9a370
authored
Jul 17, 2003
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work around buggy strxfrm() present in some Solaris releases.
parent
0c172909
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
src/backend/utils/adt/selfuncs.c
src/backend/utils/adt/selfuncs.c
+16
-15
No files found.
src/backend/utils/adt/selfuncs.c
View file @
59d9a370
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.1
39 2003/05/28 16:03:59
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.1
40 2003/07/17 20:52:36
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -2651,9 +2651,6 @@ static unsigned char *
...
@@ -2651,9 +2651,6 @@ static unsigned char *
convert_string_datum
(
Datum
value
,
Oid
typid
)
convert_string_datum
(
Datum
value
,
Oid
typid
)
{
{
char
*
val
;
char
*
val
;
char
*
xfrmstr
;
size_t
xfrmsize
;
size_t
xfrmlen
;
switch
(
typid
)
switch
(
typid
)
{
{
...
@@ -2693,17 +2690,21 @@ convert_string_datum(Datum value, Oid typid)
...
@@ -2693,17 +2690,21 @@ convert_string_datum(Datum value, Oid typid)
if
(
!
lc_collate_is_c
())
if
(
!
lc_collate_is_c
())
{
{
/* Guess that transformed string is not much bigger than original */
char
*
xfrmstr
;
xfrmsize
=
strlen
(
val
)
+
32
;
/* arbitrary pad value here... */
size_t
xfrmlen
;
xfrmstr
=
(
char
*
)
palloc
(
xfrmsize
);
size_t
xfrmlen2
;
xfrmlen
=
strxfrm
(
xfrmstr
,
val
,
xfrmsize
);
if
(
xfrmlen
>=
xfrmsize
)
/*
{
* Note: originally we guessed at a suitable output buffer size,
/* Oops, didn't make it */
* and only needed to call strxfrm twice if our guess was too small.
pfree
(
xfrmstr
);
* However, it seems that some versions of Solaris have buggy
* strxfrm that can write past the specified buffer length in that
* scenario. So, do it the dumb way for portability.
*/
xfrmlen
=
strxfrm
(
NULL
,
val
,
0
);
xfrmstr
=
(
char
*
)
palloc
(
xfrmlen
+
1
);
xfrmstr
=
(
char
*
)
palloc
(
xfrmlen
+
1
);
xfrmlen
=
strxfrm
(
xfrmstr
,
val
,
xfrmlen
+
1
);
xfrmlen2
=
strxfrm
(
xfrmstr
,
val
,
xfrmlen
+
1
);
}
Assert
(
xfrmlen2
==
xfrmlen
);
pfree
(
val
);
pfree
(
val
);
val
=
xfrmstr
;
val
=
xfrmstr
;
}
}
...
...
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