Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
6316f4d3
Commit
6316f4d3
authored
27 years ago
by
Thomas G. Lockhart
Browse files
Options
Downloads
Patches
Plain Diff
Define text, varchar, and bpchar string length functions.
parent
6873af55
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/backend/utils/adt/varchar.c
+20
-2
20 additions, 2 deletions
src/backend/utils/adt/varchar.c
src/backend/utils/adt/varlena.c
+5
-11
5 additions, 11 deletions
src/backend/utils/adt/varlena.c
with
25 additions
and
13 deletions
src/backend/utils/adt/varchar.c
+
20
−
2
View file @
6316f4d3
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.1
2
1997/12/
0
6
22:57:14 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.1
3
1997/12/
1
6
15:59:09 thomas
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -121,7 +121,7 @@ bpcharout(char *s)
* len is the length specified in () plus VARHDRSZ bytes. (XXX dummy is here
* because we pass typelem as the second argument for array_in.)
*/
char
*
char
*
varcharin
(
char
*
s
,
int
dummy
,
int
typlen
)
{
char
*
result
;
...
...
@@ -191,6 +191,15 @@ bcTruelen(char *arg)
return
(
i
+
1
);
}
int32
bpcharlen
(
char
*
arg
)
{
if
(
!
PointerIsValid
(
arg
))
elog
(
WARN
,
"Bad (null) char() external representation"
,
NULL
);
return
(
bcTruelen
(
arg
));
}
/* bpcharlen() */
bool
bpchareq
(
char
*
arg1
,
char
*
arg2
)
{
...
...
@@ -338,6 +347,15 @@ vcTruelen(char *arg)
return
i
;
}
int32
varcharlen
(
char
*
arg
)
{
if
(
!
PointerIsValid
(
arg
))
elog
(
WARN
,
"Bad (null) varchar() external representation"
,
NULL
);
return
(
vcTruelen
(
arg
));
}
/* vclen() */
bool
varchareq
(
char
*
arg1
,
char
*
arg2
)
{
...
...
This diff is collapsed.
Click to expand it.
src/backend/utils/adt/varlena.c
+
5
−
11
View file @
6316f4d3
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.2
4
1997/12/
08 04:42:48 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.2
5
1997/12/
16 15:59:11 thomas
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -210,20 +210,14 @@ textout(struct varlena * vlena)
* returns the actual length of a text* (which may be less than
* the VARSIZE of the text*)
*/
#ifdef NOT_USED
int
textlen
(
text
*
t
)
{
int
i
=
0
;
int
max
=
VARSIZE
(
t
)
-
VARHDRSZ
;
char
*
ptr
=
VARDATA
(
t
);
while
(
i
<
max
&&
*
ptr
++
)
i
++
;
return
i
;
}
if
(
!
PointerIsValid
(
t
))
elog
(
WARN
,
"Null input to textlen"
);
#endif
return
(
VARSIZE
(
t
)
-
VARHDRSZ
);
}
/* textlen() */
/*
* textcat -
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment