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
c098f309
Commit
c098f309
authored
Jan 08, 1998
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rollback varchar size change.
parent
1c9fcfb6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
5 deletions
+24
-5
src/backend/utils/adt/varchar.c
src/backend/utils/adt/varchar.c
+24
-5
No files found.
src/backend/utils/adt/varchar.c
View file @
c098f309
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.1
8 1998/01/07 22:08:23
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.1
9 1998/01/08 03:05:01
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -132,8 +132,11 @@ varcharin(char *s, int dummy, int typlen)
...
@@ -132,8 +132,11 @@ varcharin(char *s, int dummy, int typlen)
if
(
s
==
NULL
)
if
(
s
==
NULL
)
return
((
char
*
)
NULL
);
return
((
char
*
)
NULL
);
len
=
strlen
(
s
)
+
VARHDRSZ
;
if
(
typelen
==
-
1
)
/* we will remove this soon to make compact storage */
if
(
typlen
!=
-
1
&&
len
>
typlen
)
/* change varcharlen at the same time to use VARSIZE */
len
=
strlen
(
s
)
+
VARHDRSZ
;
/* if (typlen != -1 && len > typlen) */
else
len
=
typlen
;
/* clip the string at max length */
len
=
typlen
;
/* clip the string at max length */
if
(
len
>
4096
)
if
(
len
>
4096
)
...
@@ -194,7 +197,7 @@ bpcharlen(char *arg)
...
@@ -194,7 +197,7 @@ bpcharlen(char *arg)
elog
(
ERROR
,
"Bad (null) char() external representation"
,
NULL
);
elog
(
ERROR
,
"Bad (null) char() external representation"
,
NULL
);
return
(
bcTruelen
(
arg
));
return
(
bcTruelen
(
arg
));
}
/* bpcharlen() */
}
bool
bool
bpchareq
(
char
*
arg1
,
char
*
arg2
)
bpchareq
(
char
*
arg1
,
char
*
arg2
)
...
@@ -327,13 +330,29 @@ bpcharcmp(char *arg1, char *arg2)
...
@@ -327,13 +330,29 @@ bpcharcmp(char *arg1, char *arg2)
* Comparison Functions used for varchar
* Comparison Functions used for varchar
*****************************************************************************/
*****************************************************************************/
static
int
vcTruelen
(
char
*
arg
)
{
char
*
s
=
arg
+
VARHDRSZ
;
int
i
;
int
len
;
len
=
*
(
int32
*
)
arg
-
VARHDRSZ
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
if
(
*
s
++
==
'\0'
)
break
;
}
return
i
;
}
int32
int32
varcharlen
(
char
*
arg
)
varcharlen
(
char
*
arg
)
{
{
if
(
!
PointerIsValid
(
arg
))
if
(
!
PointerIsValid
(
arg
))
elog
(
ERROR
,
"Bad (null) varchar() external representation"
,
NULL
);
elog
(
ERROR
,
"Bad (null) varchar() external representation"
,
NULL
);
return
VARSIZE
(
arg
)
-
VARHDRSZ
;
return
(
vcTruelen
(
arg
))
;
}
}
bool
bool
...
...
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