Skip to content

Commit 3f2b1db

Browse files
committed
Fix thinko in encoding check for chr()
1 parent 5335fab commit 3f2b1db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/utils/adt/oracle_compat.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/utils/adt/oracle_compat.c,v 1.75 2007/11/24 21:16:55 tgl Exp $
12+
* $PostgreSQL: pgsql/src/backend/utils/adt/oracle_compat.c,v 1.76 2007/12/18 18:01:48 adunstan Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -1423,7 +1423,7 @@ chr (PG_FUNCTION_ARGS)
14231423

14241424
is_mb = pg_encoding_max_length(encoding) > 1;
14251425

1426-
if ((is_mb && (cvalue > 255)) || (!is_mb && (cvalue > 127)))
1426+
if ((is_mb && (cvalue > 127)) || (!is_mb && (cvalue > 255)))
14271427
ereport(ERROR,
14281428
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
14291429
errmsg("requested character too large for encoding: %d",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy