back patching fix for compat 7.1 binary stream issues with the new protocol
authorDave Cramer <davec@fastcrypt.com>
Wed, 17 Dec 2003 15:48:40 +0000 (15:48 +0000)
committerDave Cramer <davec@fastcrypt.com>
Wed, 17 Dec 2003 15:48:40 +0000 (15:48 +0000)
added test for same

src/interfaces/jdbc/org/postgresql/fastpath/Fastpath.java
src/interfaces/jdbc/org/postgresql/largeobject/LargeObjectManager.java
src/interfaces/jdbc/org/postgresql/test/jdbc2/Jdbc2TestSuite.java

index b88fbba1513dc04f28be676ac54b48222ff724e9..1427a45eaa344f6ee1952e33a0f6b3e188f5e0cf 100644 (file)
@@ -63,7 +63,7 @@ public class Fastpath
         */
        public Object fastpath(int fnid, boolean resulttype, FastpathArg[] args) throws SQLException
        {
-               if (conn.haveMinimumServerVersion("7.4")) {
+               if (conn.haveMinimumCompatibleVersion("7.4")) {
                        return fastpathV3(fnid, resulttype, args);
                } else {
                        return fastpathV2(fnid, resulttype, args);
index 7abfd7f94e96c52e8ca4ffea7fd459cf33fa13c1..5f22367aed094236fb70bc97cc862442cc0b2956 100644 (file)
@@ -116,7 +116,7 @@ public class LargeObjectManager
                if (conn.getMetaData().supportsSchemasInTableDefinitions()) {
                        sql = "SELECT p.proname,p.oid "+
                                " FROM pg_catalog.pg_proc p, pg_catalog.pg_namespace n "+
-                               " WHERE p.pronamespace=n.oid AND n.nspname='pg_catalog' AND ";
+                               " WHERE p.pronamespace=n.oid AND n.nspname='pg_catalog' AND (";
                } else {
                        sql = "SELECT proname,oid FROM pg_proc WHERE ";
                }
@@ -129,6 +129,10 @@ public class LargeObjectManager
                        " or proname = 'loread'" +
                        " or proname = 'lowrite'";
 
+               if (conn.getMetaData().supportsSchemasInTableDefinitions()) {
+                       sql += ")";
+               }
+
                ResultSet res = conn.createStatement().executeQuery(sql);
 
                if (res == null)
index 31af0c520b7f032730cdb547003aa2bc52d43ba0..7a5acab8e26bab4a8b3f14cf9635a2a803eff3e4 100644 (file)
@@ -57,6 +57,7 @@ public class Jdbc2TestSuite extends TestSuite
 
                // Fastpath/LargeObject
                suite.addTestSuite(BlobTest.class);
+               suite.addTestSuite(OID74Test.class);
 
                suite.addTestSuite(UpdateableResultTest.class );