Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit893b57c

Browse files
committed
Alter the signature for encoding conversion functions to declare the
output area as INTERNAL not CSTRING. This is to prevent people fromcalling the functions by hand. This is a permanent solution for theback branches but I hope it is just a stopgap for HEAD.
1 parent177af51 commit893b57c

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

‎doc/src/sgml/ref/create_conversion.sgml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/ref/create_conversion.sgml,v 1.15 2005/03/07 04:30:51 momjian Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/ref/create_conversion.sgml,v 1.16 2005/05/03 19:17:59 tgl Exp $ -->
22

33
<refentry id="SQL-CREATECONVERSION">
44
<refmeta>
@@ -8,7 +8,7 @@
88

99
<refnamediv>
1010
<refname>CREATE CONVERSION</refname>
11-
<refpurpose>define a new conversion</refpurpose>
11+
<refpurpose>define a newencodingconversion</refpurpose>
1212
</refnamediv>
1313

1414
<indexterm zone="sql-createconversion">
@@ -26,10 +26,12 @@ CREATE [DEFAULT] CONVERSION <replaceable>name</replaceable>
2626
<title>Description</title>
2727

2828
<para>
29-
<command>CREATE CONVERSION</command> defines a new encoding
30-
conversion. Conversion names may be used in the <function>convert</function> function
29+
<command>CREATE CONVERSION</command> defines a new conversion between
30+
character set encodings. Conversion names may be used in the
31+
<function>convert</function> function
3132
to specify a particular encoding conversion. Also, conversions that
32-
are marked <literal>DEFAULT</> can be used for automatic encoding conversion between
33+
are marked <literal>DEFAULT</> can be used for automatic encoding
34+
conversion between
3335
client and server. For this purpose, two conversions, from encoding A to
3436
B <emphasis>and</emphasis> from encoding B to A, must be defined.
3537
</para>
@@ -109,7 +111,7 @@ conv_proc(
109111
integer, -- source encoding ID
110112
integer, -- destination encoding ID
111113
cstring, -- source string (null terminated C string)
112-
cstring,-- destinationstring (null terminated C string)
114+
internal,-- destination(fill with anull terminated C string)
113115
integer -- source string length
114116
) RETURNS void;
115117
</programlisting>

‎src/backend/commands/conversioncmds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/commands/conversioncmds.c,v 1.17 2005/04/14 20:03:23 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/commands/conversioncmds.c,v 1.18 2005/05/03 19:17:59 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -45,7 +45,7 @@ CreateConversionCommand(CreateConversionStmt *stmt)
4545
constchar*from_encoding_name=stmt->for_encoding_name;
4646
constchar*to_encoding_name=stmt->to_encoding_name;
4747
List*func_name=stmt->func_name;
48-
staticOidfuncargs[]= {INT4OID,INT4OID,CSTRINGOID,CSTRINGOID,INT4OID};
48+
staticOidfuncargs[]= {INT4OID,INT4OID,CSTRINGOID,INTERNALOID,INT4OID};
4949

5050
/* Convert list of names to a name and namespace */
5151
namespaceId=QualifiedNameGetCreationNamespace(stmt->conversion_name,

‎src/backend/utils/mb/conversion_procs/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Makefile for utils/mb/conversion_procs
55
#
66
# IDENTIFICATION
7-
# $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/Makefile,v 1.13 2005/03/14 18:31:21 momjian Exp $
7+
# $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/Makefile,v 1.14 2005/05/03 19:17:59 tgl Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -159,7 +159,7 @@ ifeq ($(enable_shared), yes)
159159
func=$$1; shift;\
160160
obj=$$1; shift;\
161161
echo "-- $$se --> $$de";\
162-
echo "CREATE OR REPLACE FUNCTION $$func (INTEGER, INTEGER, CSTRING,CSTRING, INTEGER) RETURNS VOID AS '$$"libdir"/$$obj', '$$func' LANGUAGE 'c' STRICT;";\
162+
echo "CREATE OR REPLACE FUNCTION $$func (INTEGER, INTEGER, CSTRING,INTERNAL, INTEGER) RETURNS VOID AS '$$"libdir"/$$obj', '$$func' LANGUAGE 'c' STRICT;";\
163163
echo "DROP CONVERSION pg_catalog.$$name;";\
164164
echo "CREATE DEFAULT CONVERSION pg_catalog.$$name FOR '$$se' TO '$$de' FROM $$func;";\
165165
done > $@

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp