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
aaeef4da
Commit
aaeef4da
authored
27 years ago
by
Marc G. Fournier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GNUmakefile.in - remove backend/utils/Gen_fmgrtab.sh on distclean
varlena.c - part of Thomas' most recent patch
parent
75e2370c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
40 deletions
+84
-40
src/GNUmakefile.in
src/GNUmakefile.in
+2
-1
src/backend/utils/adt/varlena.c
src/backend/utils/adt/varlena.c
+82
-39
No files found.
src/GNUmakefile.in
View file @
aaeef4da
...
...
@@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/Attic/GNUmakefile.in,v 1.1
0 1997/02/28 18:45
:17 scrappy Exp $
# $Header: /cvsroot/pgsql/src/Attic/GNUmakefile.in,v 1.1
1 1997/04/09 08:29
:17 scrappy Exp $
#
#-------------------------------------------------------------------------
...
...
@@ -79,6 +79,7 @@ distclean: clean
bin/psql/Makefile \
bin/pg_dump/Makefile \
include/config.h \
backend/utils/Gen_fmgrtab.sh \
include/os.h
...
...
This diff is collapsed.
Click to expand it.
src/backend/utils/adt/varlena.c
View file @
aaeef4da
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.1
2 1997/04/02 18:13:24
scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.1
3 1997/04/09 08:29:35
scrappy Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -285,9 +285,19 @@ textne(struct varlena *arg1, struct varlena *arg2)
return
((
bool
)
!
texteq
(
arg1
,
arg2
));
}
/* text_lt()
* Comparison function for text strings.
* Includes locale support, but must copy strings to temporary memory
* to allow null-termination for inputs to strcoll().
* XXX HACK code for textlen() indicates that there can be embedded nulls
* but it appears that most routines (incl. this one) assume not! - tgl 97/04/07
*/
bool
text_lt
(
struct
varlena
*
arg1
,
struct
varlena
*
arg2
)
{
bool
result
;
int
cval
;
int
len
;
#ifdef UNSIGNED_CHAR_TEXT
unsigned
...
...
@@ -295,34 +305,55 @@ text_lt(struct varlena *arg1, struct varlena *arg2)
char
*
a1p
,
*
a2p
;
if
(
arg1
==
NULL
||
arg2
==
NULL
)
return
((
bool
)
0
);
return
((
bool
)
FALSE
);
a1p
=
(
unsigned
char
*
)
VARDATA
(
arg1
);
a2p
=
(
unsigned
char
*
)
VARDATA
(
arg2
);
len
=
(((
VARSIZE
(
arg1
)
<=
VARSIZE
(
arg2
))
?
VARSIZE
(
arg1
)
:
VARSIZE
(
arg2
))
-
VARHDRSZ
);
if
((
len
=
arg1
->
vl_len
)
>
arg2
->
vl_len
)
len
=
arg2
->
vl_len
;
len
-=
sizeof
(
int32
);
while
(
len
!=
0
&&
*
a1p
==
*
a2p
)
{
a1p
++
;
a2p
++
;
len
--
;
}
if
(
len
)
#ifdef USE_LOCALE
return
(
bool
)
(
strcoll
(
a2p
,
a1p
));
if
(
!
PointerIsValid
(
a1p
=
PALLOC
(
len
+
1
))
||
!
PointerIsValid
(
a2p
=
PALLOC
(
len
+
1
)))
{
elog
(
WARN
,
"Unable to allocate memory for text comparison"
,
NULL
);
return
(
FALSE
);
};
memcpy
(
a1p
,
VARDATA
(
arg1
),
len
);
*
(
a1p
+
len
)
=
'\0'
;
memcpy
(
a2p
,
VARDATA
(
arg2
),
len
);
*
(
a2p
+
len
)
=
'\0'
;
cval
=
strcoll
(
a1p
,
a2p
);
result
=
((
cval
<
0
)
||
((
cval
==
0
)
&&
(
VARSIZE
(
arg1
)
<
VARSIZE
(
arg2
))));
PFREE
(
a1p
);
PFREE
(
a2p
);
return
(
result
);
#else
return
(
bool
)
(
*
a1p
<
*
a2p
);
a1p
=
(
unsigned
char
*
)
VARDATA
(
arg1
);
a2p
=
(
unsigned
char
*
)
VARDATA
(
arg2
);
while
(
len
!=
0
&&
*
a1p
==
*
a2p
)
{
a1p
++
;
a2p
++
;
len
--
;
};
return
((
bool
)
(
len
?
(
*
a1p
<
*
a2p
)
:
(
VARSIZE
(
arg1
)
<
VARSIZE
(
arg2
))));
#endif
else
return
(
bool
)
(
arg1
->
vl_len
<
arg2
->
vl_len
);
}
}
/* text_lt() */
/* text_le()
* Comparison function for text strings.
* Includes locale support, but must copy strings to temporary memory
* to allow null-termination for inputs to strcoll().
* XXX HACK code for textlen() indicates that there can be embedded nulls
* but it appears that most routines (incl. this one) assume not! - tgl 97/04/07
*/
bool
text_le
(
struct
varlena
*
arg1
,
struct
varlena
*
arg2
)
{
bool
result
;
int
cval
;
int
len
;
#ifdef UNSIGNED_CHAR_TEXT
unsigned
...
...
@@ -332,28 +363,40 @@ text_le(struct varlena *arg1, struct varlena *arg2)
if
(
arg1
==
NULL
||
arg2
==
NULL
)
return
((
bool
)
0
);
a1p
=
(
unsigned
char
*
)
VARDATA
(
arg1
);
a2p
=
(
unsigned
char
*
)
VARDATA
(
arg2
);
len
=
(((
VARSIZE
(
arg1
)
<=
VARSIZE
(
arg2
))
?
VARSIZE
(
arg1
)
:
VARSIZE
(
arg2
))
-
VARHDRSZ
);
if
((
len
=
arg1
->
vl_len
)
>
arg2
->
vl_len
)
len
=
arg2
->
vl_len
;
len
-=
sizeof
(
int32
);
/* varlena! */
while
(
len
!=
0
&&
*
a1p
==
*
a2p
)
{
a1p
++
;
a2p
++
;
len
--
;
}
if
(
len
)
#ifdef USE_LOCALE
return
(
bool
)
(
strcoll
(
a2p
,
a1p
));
if
(
!
PointerIsValid
(
a1p
=
PALLOC
(
len
+
1
))
||
!
PointerIsValid
(
a2p
=
PALLOC
(
len
+
1
)))
{
elog
(
WARN
,
"Unable to allocate memory for text comparison"
,
NULL
);
return
(
FALSE
);
};
memcpy
(
a1p
,
VARDATA
(
arg1
),
len
);
*
(
a1p
+
len
)
=
'\0'
;
memcpy
(
a2p
,
VARDATA
(
arg2
),
len
);
*
(
a2p
+
len
)
=
'\0'
;
cval
=
strcoll
(
a1p
,
a2p
);
result
=
((
cval
<
0
)
||
((
cval
==
0
)
&&
(
VARSIZE
(
arg1
)
<=
VARSIZE
(
arg2
))));
PFREE
(
a1p
);
PFREE
(
a2p
);
return
(
result
);
#else
return
(
bool
)
(
*
a1p
<
*
a2p
);
a1p
=
(
unsigned
char
*
)
VARDATA
(
arg1
);
a2p
=
(
unsigned
char
*
)
VARDATA
(
arg2
);
while
(
len
!=
0
&&
*
a1p
==
*
a2p
)
{
a1p
++
;
a2p
++
;
len
--
;
};
return
((
bool
)
(
len
?
(
*
a1p
<=
*
a2p
)
:
(
VARSIZE
(
arg1
)
<=
VARSIZE
(
arg2
))));
#endif
else
return
((
bool
)
VARSIZE
(
arg1
)
<=
VARSIZE
(
arg2
));
}
}
/* text_le() */
bool
text_gt
(
struct
varlena
*
arg1
,
struct
varlena
*
arg2
)
...
...
This diff is collapsed.
Click to expand it.
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