[libpostgresql-jdbc-java] 06/09: Accept UTF8 as an equivalent of UNICODE when trying to detect if client_encoding has changed to something the driver doesn't understand. Don't try to accept every possible spelling (UTF-8) as UTF8 is the server's canonical name and people shouldn't be messing with this anyway.
Emmanuel Bourg
ebourg-guest at moszumanska.debian.org
Mon Jan 9 10:20:14 UTC 2017
This is an automated email from the git hooks/post-receive script.
ebourg-guest pushed a commit to tag REL8_1_413
in repository libpostgresql-jdbc-java.
commit 92b7023d3372418b55fb705f4ed5f637fced24b0
Author: Kris Jurka <books at ejurka.com>
Date: Tue May 20 00:04:41 2008 +0000
Accept UTF8 as an equivalent of UNICODE when trying to detect if
client_encoding has changed to something the driver doesn't
understand. Don't try to accept every possible spelling (UTF-8) as
UTF8 is the server's canonical name and people shouldn't be messing
with this anyway.
---
org/postgresql/core/v3/QueryExecutorImpl.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/org/postgresql/core/v3/QueryExecutorImpl.java b/org/postgresql/core/v3/QueryExecutorImpl.java
index 1c9b81d..1f5fa06 100644
--- a/org/postgresql/core/v3/QueryExecutorImpl.java
+++ b/org/postgresql/core/v3/QueryExecutorImpl.java
@@ -4,7 +4,7 @@
* Copyright (c) 2004, Open Cloud Limited.
*
* IDENTIFICATION
-* $PostgreSQL: pgjdbc/org/postgresql/core/v3/QueryExecutorImpl.java,v 1.25.2.6 2007/10/15 08:06:48 jurka Exp $
+* $PostgreSQL: pgjdbc/org/postgresql/core/v3/QueryExecutorImpl.java,v 1.25.2.7 2008/01/28 10:09:38 jurka Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1357,7 +1357,7 @@ public class QueryExecutorImpl implements QueryExecutor {
if (Driver.logDebug)
Driver.debug(" <=BE ParameterStatus(" + name + " = " + value + ")");
- if (name.equals("client_encoding") && !value.equalsIgnoreCase("UNICODE") && !allowEncodingChanges)
+ if (name.equals("client_encoding") && !(value.equalsIgnoreCase("UNICODE") || value.equalsIgnoreCase("UTF8")) && !allowEncodingChanges)
{
protoConnection.close(); // we're screwed now; we can't trust any subsequent string.
handler.handleError(new PSQLException(GT.tr("The server''s client_encoding parameter was changed to {0}. The JDBC driver requires client_encoding to be UNICODE for correct operation.", value), PSQLState.CONNECTION_FAILURE));
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libpostgresql-jdbc-java.git
More information about the pkg-java-commits
mailing list