Unverified 提交 14c53dc0 authored 作者: Noel Grandin's avatar Noel Grandin 提交者: GitHub

Merge pull request #958 from katzyn/pg_catalog

More fixes for PgServer
...@@ -992,7 +992,7 @@ public class Parser { ...@@ -992,7 +992,7 @@ public class Parser {
buff.append("'ISO' AS DATESTYLE FROM DUAL"); buff.append("'ISO' AS DATESTYLE FROM DUAL");
} else if (readIf("SERVER_VERSION")) { } else if (readIf("SERVER_VERSION")) {
// for PostgreSQL compatibility // for PostgreSQL compatibility
buff.append("'8.1.4' AS SERVER_VERSION FROM DUAL"); buff.append("'" + Constants.PG_VERSION + "' AS SERVER_VERSION FROM DUAL");
} else if (readIf("SERVER_ENCODING")) { } else if (readIf("SERVER_ENCODING")) {
// for PostgreSQL compatibility // for PostgreSQL compatibility
buff.append("'UTF8' AS SERVER_ENCODING FROM DUAL"); buff.append("'UTF8' AS SERVER_ENCODING FROM DUAL");
......
...@@ -525,6 +525,11 @@ public class Constants { ...@@ -525,6 +525,11 @@ public class Constants {
*/ */
public static final int QUERY_STATISTICS_MAX_ENTRIES = 100; public static final int QUERY_STATISTICS_MAX_ENTRIES = 100;
/**
* Announced version for PgServer.
*/
public static final String PG_VERSION = "8.2.23";
private Constants() { private Constants() {
// utility class // utility class
} }
......
...@@ -392,7 +392,7 @@ public class PgServer implements Service { ...@@ -392,7 +392,7 @@ public class PgServer implements Service {
* @return the server name and version * @return the server name and version
*/ */
public static String getVersion() { public static String getVersion() {
return "PostgreSQL 8.1.4 server protocol using H2 " + return "PostgreSQL " + Constants.PG_VERSION + " server protocol using H2 " +
Constants.getFullVersion(); Constants.getFullVersion();
} }
......
...@@ -33,6 +33,7 @@ import java.util.Properties; ...@@ -33,6 +33,7 @@ import java.util.Properties;
import org.h2.command.CommandInterface; import org.h2.command.CommandInterface;
import org.h2.engine.ConnectionInfo; import org.h2.engine.ConnectionInfo;
import org.h2.engine.Constants;
import org.h2.engine.SysProperties; import org.h2.engine.SysProperties;
import org.h2.jdbc.JdbcConnection; import org.h2.jdbc.JdbcConnection;
import org.h2.jdbc.JdbcPreparedStatement; import org.h2.jdbc.JdbcPreparedStatement;
...@@ -949,7 +950,7 @@ public class PgServerThread implements Runnable { ...@@ -949,7 +950,7 @@ public class PgServerThread implements Runnable {
sendParameterStatus("integer_datetimes", "off"); sendParameterStatus("integer_datetimes", "off");
sendParameterStatus("is_superuser", "off"); sendParameterStatus("is_superuser", "off");
sendParameterStatus("server_encoding", "SQL_ASCII"); sendParameterStatus("server_encoding", "SQL_ASCII");
sendParameterStatus("server_version", "8.1.4"); sendParameterStatus("server_version", Constants.PG_VERSION);
sendParameterStatus("session_authorization", userName); sendParameterStatus("session_authorization", userName);
sendParameterStatus("standard_conforming_strings", "off"); sendParameterStatus("standard_conforming_strings", "off");
// TODO PostgreSQL TimeZone // TODO PostgreSQL TimeZone
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* Initial Developer: H2 Group * Initial Developer: H2 Group
*/ */
; ;
drop schema if exists pg_catalog; drop schema if exists pg_catalog cascade;
create schema pg_catalog; create schema pg_catalog;
drop alias if exists pg_convertType; drop alias if exists pg_convertType;
......
...@@ -40,7 +40,7 @@ public class TestShow extends TestBase { ...@@ -40,7 +40,7 @@ public class TestShow extends TestBase {
assertResult("read committed", stat, "SHOW DEFAULT_TRANSACTION_ISOLATION"); assertResult("read committed", stat, "SHOW DEFAULT_TRANSACTION_ISOLATION");
assertResult("read committed", stat, "SHOW TRANSACTION ISOLATION LEVEL"); assertResult("read committed", stat, "SHOW TRANSACTION ISOLATION LEVEL");
assertResult("ISO", stat, "SHOW DATESTYLE"); assertResult("ISO", stat, "SHOW DATESTYLE");
assertResult("8.1.4", stat, "SHOW SERVER_VERSION"); assertResult("8.2.23", stat, "SHOW SERVER_VERSION");
assertResult("UTF8", stat, "SHOW SERVER_ENCODING"); assertResult("UTF8", stat, "SHOW SERVER_ENCODING");
} }
} }
......
...@@ -59,9 +59,9 @@ public class Build extends BuildBase { ...@@ -59,9 +59,9 @@ public class Build extends BuildBase {
downloadUsingMaven("ext/derbynet-10.10.1.1.jar", downloadUsingMaven("ext/derbynet-10.10.1.1.jar",
"org/apache/derby", "derbynet", "10.10.1.1", "org/apache/derby", "derbynet", "10.10.1.1",
"912b08dca73663d4665e09cd317be1218412d93e"); "912b08dca73663d4665e09cd317be1218412d93e");
downloadUsingMaven("ext/postgresql-9.4.1209.jre6.jar", downloadUsingMaven("ext/postgresql-42.2.1.jre7",
"org.postgresql", "postgresql", "9.4.1209.jre6", "org.postgresql", "postgresql", "42.2.1.jre7",
"2ed7a5a8c952d9ea18af92efea7e56ef854abfea"); "d06eb133d573240718fe4c24577ef086f7daad6c");
downloadUsingMaven("ext/mysql-connector-java-5.1.6.jar", downloadUsingMaven("ext/mysql-connector-java-5.1.6.jar",
"mysql", "mysql-connector-java", "5.1.6", "mysql", "mysql-connector-java", "5.1.6",
"380ef5226de2c85ff3b38cbfefeea881c5fce09d"); "380ef5226de2c85ff3b38cbfefeea881c5fce09d");
...@@ -74,7 +74,7 @@ public class Build extends BuildBase { ...@@ -74,7 +74,7 @@ public class Build extends BuildBase {
File.pathSeparator + "ext/derby-10.10.1.1.jar" + File.pathSeparator + "ext/derby-10.10.1.1.jar" +
File.pathSeparator + "ext/derbyclient-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/derbynet-10.10.1.1.jar" +
File.pathSeparator + "ext/postgresql-9.4.1209.jre6.jar" + File.pathSeparator + "ext/postgresql-42.2.1.jre7" +
File.pathSeparator + "ext/mysql-connector-java-5.1.6.jar"; File.pathSeparator + "ext/mysql-connector-java-5.1.6.jar";
StringList args = args("-Xmx128m", StringList args = args("-Xmx128m",
"-cp", cp, "org.h2.test.bench.TestPerformance"); "-cp", cp, "org.h2.test.bench.TestPerformance");
...@@ -182,7 +182,7 @@ public class Build extends BuildBase { ...@@ -182,7 +182,7 @@ public class Build extends BuildBase {
// JaCoCo does not support multiple versions of the same classes // JaCoCo does not support multiple versions of the same classes
delete(files("coverage/bin/META-INF/versions")); delete(files("coverage/bin/META-INF/versions"));
String cp = "coverage/bin" + String cp = "coverage/bin" +
File.pathSeparator + "ext/postgresql-9.4.1209.jre6.jar" + File.pathSeparator + "ext/postgresql-42.2.1.jre7" +
File.pathSeparator + "ext/servlet-api-3.1.0.jar" + File.pathSeparator + "ext/servlet-api-3.1.0.jar" +
File.pathSeparator + "ext/lucene-core-3.6.2.jar" + File.pathSeparator + "ext/lucene-core-3.6.2.jar" +
File.pathSeparator + "ext/h2mig_pagestore_addon.jar" + File.pathSeparator + "ext/h2mig_pagestore_addon.jar" +
...@@ -427,9 +427,9 @@ public class Build extends BuildBase { ...@@ -427,9 +427,9 @@ public class Build extends BuildBase {
"com/h2database", "h2", "1.2.127", "com/h2database", "h2", "1.2.127",
"056e784c7cf009483366ab9cd8d21d02fe47031a"); "056e784c7cf009483366ab9cd8d21d02fe47031a");
// for TestPgServer // for TestPgServer
downloadUsingMaven("ext/postgresql-9.4.1209.jre6.jar", downloadUsingMaven("ext/postgresql-42.2.1.jre7.jar",
"org.postgresql", "postgresql", "9.4.1209.jre6", "org.postgresql", "postgresql", "42.2.1.jre7",
"2ed7a5a8c952d9ea18af92efea7e56ef854abfea"); "d06eb133d573240718fe4c24577ef086f7daad6c");
// for TestTraceSystem // for TestTraceSystem
downloadUsingMaven("ext/slf4j-nop-1.6.0.jar", downloadUsingMaven("ext/slf4j-nop-1.6.0.jar",
"org/slf4j", "slf4j-nop", "1.6.0", "org/slf4j", "slf4j-nop", "1.6.0",
...@@ -1012,7 +1012,7 @@ public class Build extends BuildBase { ...@@ -1012,7 +1012,7 @@ public class Build extends BuildBase {
private void test(boolean travis) { private void test(boolean travis) {
downloadTest(); downloadTest();
String cp = "temp" + File.pathSeparator + "bin" + String cp = "temp" + File.pathSeparator + "bin" +
File.pathSeparator + "ext/postgresql-9.4.1209.jre6.jar" + File.pathSeparator + "ext/postgresql-42.2.1.jre7.jar" +
File.pathSeparator + "ext/servlet-api-3.1.0.jar" + File.pathSeparator + "ext/servlet-api-3.1.0.jar" +
File.pathSeparator + "ext/lucene-core-3.6.2.jar" + File.pathSeparator + "ext/lucene-core-3.6.2.jar" +
File.pathSeparator + "ext/h2mig_pagestore_addon.jar" + File.pathSeparator + "ext/h2mig_pagestore_addon.jar" +
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论