提交 4231eb92 authored 作者: Sergi Vladykin's avatar Sergi Vladykin

Update PostgreSQL Jdbc driver + INT2 size fix + get rid of compile time dependecny on PgSQL Jdbc.

上级 94ea0d82
......@@ -573,7 +573,7 @@ public class PgServerThread implements Runnable {
// binary
switch (pgType) {
case PgServer.PG_TYPE_INT2:
checkParamLength(4, paramLen);
checkParamLength(2, paramLen);
prep.setShort(col, readShort());
break;
case PgServer.PG_TYPE_INT4:
......
......@@ -15,15 +15,14 @@ import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Types;
import java.util.Properties;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import org.h2.test.TestBase;
import org.h2.tools.Server;
import org.postgresql.PGStatement;
/**
* Tests the PostgreSQL server protocol compliant implementation.
......@@ -419,8 +418,15 @@ public class TestPgServer extends TestBase {
"-pgPort", "5535", "-pgDaemon", "-key", "test", "mem:test");
server.start();
try {
Properties props = new Properties();
props.setProperty("user", "sa");
props.setProperty("password", "sa");
// force server side prepare
props.setProperty("prepareThreshold", "1");
Connection conn = DriverManager.getConnection(
"jdbc:postgresql://localhost:5535/test", "sa", "sa");
"jdbc:postgresql://localhost:5535/test", props);
Statement stmt = conn.createStatement();
stmt.executeUpdate("create table t1 (id integer, value boolean)");
......@@ -429,8 +435,7 @@ public class TestPgServer extends TestBase {
stmt.close();
PreparedStatement pstmt = conn.prepareStatement("SELECT * FROM t1 WHERE value = ?");
((PGStatement) pstmt).setPrepareThreshold(1); // force server side prepare
assertTrue(((PGStatement) pstmt).isUseServerPrepare());
// assertTrue(((PGStatement) pstmt).isUseServerPrepare());
pstmt.setObject(1, false, Types.OTHER);
ResultSet rs = pstmt.executeQuery();
......
......@@ -51,9 +51,9 @@ public class Build extends BuildBase {
downloadUsingMaven("ext/derbynet-10.10.1.1.jar",
"org/apache/derby", "derbynet", "10.10.1.1",
"912b08dca73663d4665e09cd317be1218412d93e");
downloadUsingMaven("ext/postgresql-8.3-603.jdbc3.jar",
"postgresql", "postgresql", "8.3-603.jdbc3",
"33d531c3c53055ddcbea3d88bfa093466ffef924");
downloadUsingMaven("ext/postgresql-9.4.1209.jre6.jar",
"org.postgresql", "postgresql", "9.4.1209.jre6",
"2ed7a5a8c952d9ea18af92efea7e56ef854abfea");
downloadUsingMaven("ext/mysql-connector-java-5.1.6.jar",
"mysql", "mysql-connector-java", "5.1.6",
"380ef5226de2c85ff3b38cbfefeea881c5fce09d");
......@@ -66,7 +66,7 @@ public class Build extends BuildBase {
File.pathSeparator + "ext/derby-10.10.1.1.jar" +
File.pathSeparator + "ext/derbyclient-10.10.1.1.jar" +
File.pathSeparator + "ext/derbynet-10.10.1.1.jar" +
File.pathSeparator + "ext/postgresql-8.3-603.jdbc3.jar" +
File.pathSeparator + "ext/postgresql-9.4.1209.jre6.jar" +
File.pathSeparator + "ext/mysql-connector-java-5.1.6.jar";
StringList args = args("-Xmx128m",
"-cp", cp, "org.h2.test.bench.TestPerformance");
......@@ -124,7 +124,7 @@ public class Build extends BuildBase {
"30a40933caf67d88d9e75957950ccf353b181ab7");
String cp = "temp" + File.pathSeparator + "bin" +
File.pathSeparator + "ext/emma-2.0.5312.jar" +
File.pathSeparator + "ext/postgresql-8.3-603.jdbc3.jar" +
File.pathSeparator + "ext/postgresql-9.4.1209.jre6.jar" +
File.pathSeparator + "ext/servlet-api-3.1.0.jar" +
File.pathSeparator + "ext/lucene-core-3.6.2.jar" +
File.pathSeparator + "ext/h2mig_pagestore_addon.jar" +
......@@ -209,7 +209,6 @@ public class Build extends BuildBase {
File.pathSeparator + "ext/org.osgi.core-4.2.0.jar" +
File.pathSeparator + "ext/org.osgi.enterprise-4.2.0.jar" +
File.pathSeparator + "ext/jts-core-1.14.0.jar" +
File.pathSeparator + "ext/postgresql-8.3-603.jdbc3.jar" +
File.pathSeparator + javaToolsJar;
FileList files;
if (clientOnly) {
......@@ -318,9 +317,6 @@ public class Build extends BuildBase {
downloadOrVerify("ext/junit-4.12.jar",
"junit", "junit", "4.12",
"2973d150c0dc1fefe998f834810d68f278ea58ec", offline);
downloadOrVerify("ext/postgresql-8.3-603.jdbc3.jar",
"postgresql", "postgresql", "8.3-603.jdbc3",
"33d531c3c53055ddcbea3d88bfa093466ffef924", offline);
}
private void downloadOrVerify(String target, String group, String artifact,
......@@ -347,10 +343,9 @@ public class Build extends BuildBase {
"com/h2database", "h2", "1.2.127",
"056e784c7cf009483366ab9cd8d21d02fe47031a");
// for TestPgServer
downloadUsingMaven("ext/postgresql-8.3-603.jdbc3.jar",
"postgresql", "postgresql", "8.3-603.jdbc3",
"33d531c3c53055ddcbea3d88bfa093466ffef924");
downloadUsingMaven("ext/postgresql-9.4.1209.jre6.jar",
"org.postgresql", "postgresql", "9.4.1209.jre6",
"2ed7a5a8c952d9ea18af92efea7e56ef854abfea");
// for TestTraceSystem
downloadUsingMaven("ext/slf4j-nop-1.6.0.jar",
"org/slf4j", "slf4j-nop", "1.6.0",
......@@ -919,7 +914,7 @@ public class Build extends BuildBase {
private void test(boolean fast) {
downloadTest();
String cp = "temp" + File.pathSeparator + "bin" +
File.pathSeparator + "ext/postgresql-8.3-603.jdbc3.jar" +
File.pathSeparator + "ext/postgresql-9.4.1209.jre6.jar" +
File.pathSeparator + "ext/servlet-api-3.1.0.jar" +
File.pathSeparator + "ext/lucene-core-3.6.2.jar" +
File.pathSeparator + "ext/h2mig_pagestore_addon.jar" +
......
......@@ -599,7 +599,7 @@ public class BuildBase {
if (targetFile.exists()) {
return;
}
String repoFile = group + "/" + artifact + "/" + version + "/"
String repoFile = group.replace('.', '/') + "/" + artifact + "/" + version + "/"
+ artifact + "-" + version + ".jar";
mkdirs(targetFile.getAbsoluteFile().getParentFile());
String localMavenDir = getLocalMavenDir();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论