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
61a93ed2
Commit
61a93ed2
authored
Nov 24, 1999
by
Tatsuo Ishii
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add multi-byte support to lztextlen()
parent
95997e15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
4 deletions
+25
-4
src/backend/utils/adt/lztext.c
src/backend/utils/adt/lztext.c
+25
-4
No files found.
src/backend/utils/adt/lztext.c
View file @
61a93ed2
/* ----------
* lztext.c -
*
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/lztext.c,v 1.
2 1999/11/17 22:18:45 wieck
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/lztext.c,v 1.
3 1999/11/24 03:45:12 ishii
Exp $
*
* Text type with internal LZ compressed representation. Uses the
* standard PostgreSQL compression method.
...
...
@@ -21,7 +21,9 @@
#include "utils/builtins.h"
#include "utils/palloc.h"
#include "utils/pg_lzcompress.h"
#ifdef MULTIBYTE
#include "mb/pg_wchar.h"
#endif
/* ----------
* lztextin -
...
...
@@ -134,6 +136,12 @@ lztextout(lztext *lz)
int32
lztextlen
(
lztext
*
lz
)
{
#ifdef MULTIBYTE
unsigned
char
*
s1
,
*
s2
;
int
len
;
int
l
;
int
wl
;
#endif
/* ----------
* Handle NULL
* ----------
...
...
@@ -141,11 +149,26 @@ lztextlen(lztext *lz)
if
(
lz
==
NULL
)
return
0
;
#ifdef MULTIBYTE
len
=
0
;
s1
=
s2
=
(
unsigned
char
*
)
lztextout
(
lz
);
l
=
PGLZ_RAW_SIZE
(
lz
);
while
(
l
>
0
)
{
wl
=
pg_mblen
(
s1
);
l
-=
wl
;
s1
+=
wl
;
len
++
;
}
pfree
((
char
*
)
s2
);
return
(
len
);
#else
/* ----------
* without multibyte support, it's the remembered rawsize
* ----------
*/
return
PGLZ_RAW_SIZE
(
lz
);
#endif
}
...
...
@@ -228,8 +251,6 @@ text_lztext(text *txt)
}
return
result
;
}
...
...
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