[libpostgresql-jdbc-java] 13/24: Escape schema name when setting search_path

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Mon Jan 9 21:17:40 UTC 2017


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to tag REL9_3_1103
in repository libpostgresql-jdbc-java.

commit 9d42aa56f4ddfc73d0cfbad9a850ea22d4c35591
Author: Alexis Meneses <alexismeneses at users.noreply.github.com>
Date:   Thu Dec 4 21:26:04 2014 +0100

    Escape schema name when setting search_path
    
    (cherry picked from commit e708385916ac63e54c5c4d6f78986eb6bf9ebb08)
---
 org/postgresql/jdbc2/AbstractJdbc2Connection.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/org/postgresql/jdbc2/AbstractJdbc2Connection.java b/org/postgresql/jdbc2/AbstractJdbc2Connection.java
index be29352..31e5aba 100644
--- a/org/postgresql/jdbc2/AbstractJdbc2Connection.java
+++ b/org/postgresql/jdbc2/AbstractJdbc2Connection.java
@@ -1287,7 +1287,11 @@ public abstract class AbstractJdbc2Connection implements BaseConnection
         {
             if (schema != null)
             {
-                stmt.executeUpdate("SET SESSION search_path TO '" + schema + "'");
+                StringBuffer sb = new StringBuffer();
+                sb.append("SET SESSION search_path TO '");
+                Utils.appendEscapedLiteral(sb, schema, protoConnection.getStandardConformingStrings());
+                sb.append("'");
+                stmt.executeUpdate(sb.toString());
             }
             else
             {

-- 
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