Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2b74d45

Browse files
committed
pg_do_encoding_conversion cannot return NULL (at least not unless the input
is NULL), so remove some useless tests for the case.
1 parent d141e74 commit 2b74d45

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

src/backend/snowball/dict_snowball.c

+1-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
77
*
88
* IDENTIFICATION
9-
* $PostgreSQL: pgsql/src/backend/snowball/dict_snowball.c,v 1.6 2008/01/01 19:45:51 momjian Exp $
9+
* $PostgreSQL: pgsql/src/backend/snowball/dict_snowball.c,v 1.7 2008/11/10 15:18:40 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -262,9 +262,6 @@ dsnowball_lexize(PG_FUNCTION_ARGS)
262262
strlen(txt),
263263
GetDatabaseEncoding(),
264264
PG_UTF8);
265-
if (recoded == NULL)
266-
elog(ERROR, "encoding conversion failed");
267-
268265
if (recoded != txt)
269266
{
270267
pfree(txt);
@@ -294,9 +291,6 @@ dsnowball_lexize(PG_FUNCTION_ARGS)
294291
strlen(txt),
295292
PG_UTF8,
296293
GetDatabaseEncoding());
297-
if (recoded == NULL)
298-
elog(ERROR, "encoding conversion failed");
299-
300294
if (recoded != txt)
301295
{
302296
pfree(txt);

src/backend/tsearch/ts_locale.c

+1-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/tsearch/ts_locale.c,v 1.10 2008/06/18 20:55:42 tgl Exp $
10+
* $PostgreSQL: pgsql/src/backend/tsearch/ts_locale.c,v 1.11 2008/11/10 15:18:40 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -204,10 +204,6 @@ t_readline(FILE *fp)
204204
len,
205205
PG_UTF8,
206206
GetDatabaseEncoding());
207-
208-
if (recoded == NULL) /* should not happen */
209-
elog(ERROR, "encoding conversion failed");
210-
211207
if (recoded == buf)
212208
{
213209
/*

src/backend/utils/mb/mbutils.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* (currently mule internal code (mic) is used)
55
* Tatsuo Ishii
66
*
7-
* $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.73 2008/06/18 23:08:47 tgl Exp $
7+
* $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.74 2008/11/10 15:18:40 tgl Exp $
88
*/
99
#include "postgres.h"
1010

@@ -381,8 +381,6 @@ pg_convert(PG_FUNCTION_ARGS)
381381
*(str + len) = '\0';
382382

383383
result = pg_do_encoding_conversion(str, len, src_encoding, dest_encoding);
384-
if (result == NULL)
385-
elog(ERROR, "encoding conversion failed");
386384

387385
/*
388386
* build bytea data type structure.

0 commit comments

Comments
 (0)