Skip to content

Commit

Permalink
test: add PostgreSQL 9.6 to CI tests (#560)
Browse files Browse the repository at this point in the history
  • Loading branch information
vlsi committed May 14, 2016
1 parent dc3bdda commit 3ff47da
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 13 deletions.
9 changes: 8 additions & 1 deletion .travis.yml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ cache:
matrix: matrix:
fast_finish: true fast_finish: true
include: include:
- jdk: oraclejdk8
sudo: required
dist: trusty
env:
- PG_VERSION=9.6
- XA=true
- COVERAGE=Y
- jdk: oraclejdk8 - jdk: oraclejdk8
sudo: required sudo: required
dist: trusty dist: trusty
Expand Down Expand Up @@ -120,7 +127,7 @@ matrix:
postgresql: "9.4" postgresql: "9.4"
env: env:
- PG_VERSION=9.4 - PG_VERSION=9.4
- MVN_CUSTOM_ARGS='-DwaffleEnabled=false -DosgiEnabled=false -DexcludePackageNames=org.postgresql.osgi:org.postgresql.sspi' - NO_WAFFLE_NO_OSGI=Y


# Deploy snapshots to Maven Central # Deploy snapshots to Maven Central
after_success: after_success:
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ For problems with this driver, refer to driver's [home page](http://jdbc.postgre
Most people do not need to compile PgJDBC. You can download prebuilt versions of the driver Most people do not need to compile PgJDBC. You can download prebuilt versions of the driver
from the [Postgresql JDBC site](http://jdbc.postgresql.org/) or using your chosen dependency management tool: from the [Postgresql JDBC site](http://jdbc.postgresql.org/) or using your chosen dependency management tool:


## Supported PostgreSQL versions

Pgjdbc regression tests are run against PostgreSQL 8.4, 9.1, 9.2, 9.3, 9.4, 9.5, 9.6.

### Maven ### Maven
```xml ```xml
<dependency> <dependency>
Expand Down
4 changes: 3 additions & 1 deletion pgjdbc/src/main/java/org/postgresql/core/ServerVersion.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ public enum ServerVersion implements Version {
v9_2("9.2.0"), v9_2("9.2.0"),
v9_3("9.3.0"), v9_3("9.3.0"),
v9_4("9.4.0"), v9_4("9.4.0"),
v9_5("9.5.0"),; v9_5("9.5.0"),
v9_6("9.6.0"),
;


private final int version; private final int version;


Expand Down
17 changes: 10 additions & 7 deletions pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2853,13 +2853,16 @@ public java.sql.ResultSet getIndexInfo(String catalog, String schema, String tab
+ " END AS TYPE, " + " END AS TYPE, "
+ " (i.keys).n AS ORDINAL_POSITION, " + " (i.keys).n AS ORDINAL_POSITION, "
+ " trim(both '\"' from pg_catalog.pg_get_indexdef(ci.oid, (i.keys).n, false)) AS COLUMN_NAME, " + " trim(both '\"' from pg_catalog.pg_get_indexdef(ci.oid, (i.keys).n, false)) AS COLUMN_NAME, "
+ " CASE am.amcanorder " // TODO: Implement ASC_OR_DESC for PostgreSQL 9.6+
+ " WHEN true THEN CASE i.indoption[(i.keys).n - 1] & 1 " + (connection.haveMinimumServerVersion(ServerVersion.v9_6)
+ " WHEN 1 THEN 'D' " ? "NULL AS ASC_OR_DESC, "
+ " ELSE 'A' " : " CASE am.amcanorder "
+ " END " + " WHEN true THEN CASE i.indoption[(i.keys).n - 1] & 1 "
+ " ELSE NULL " + " WHEN 1 THEN 'D' "
+ " END AS ASC_OR_DESC, " + " ELSE 'A' "
+ " END "
+ " ELSE NULL "
+ " END AS ASC_OR_DESC, ")
+ " ci.reltuples AS CARDINALITY, " + " ci.reltuples AS CARDINALITY, "
+ " ci.relpages AS PAGES, " + " ci.relpages AS PAGES, "
+ " pg_catalog.pg_get_expr(i.indpred, i.indrelid) AS FILTER_CONDITION " + " pg_catalog.pg_get_expr(i.indpred, i.indrelid) AS FILTER_CONDITION "
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@


package org.postgresql.test.jdbc2; package org.postgresql.test.jdbc2;


import org.postgresql.core.ServerVersion;
import org.postgresql.test.TestUtil; import org.postgresql.test.TestUtil;


import junit.framework.TestCase; import junit.framework.TestCase;
Expand Down Expand Up @@ -588,12 +589,22 @@ public void testAscDescIndexInfo() throws SQLException {
assertTrue(rs.next()); assertTrue(rs.next());
assertEquals("idx_a_d", rs.getString("INDEX_NAME")); assertEquals("idx_a_d", rs.getString("INDEX_NAME"));
assertEquals("id", rs.getString("COLUMN_NAME")); assertEquals("id", rs.getString("COLUMN_NAME"));
assertEquals("A", rs.getString("ASC_OR_DESC")); if (TestUtil.haveMinimumServerVersion(con, ServerVersion.v9_6)) {
assertNull("ASC_OR_DESC for index is not yet supported for PostgreSQL 9.6",
rs.getString("ASC_OR_DESC"));
} else {
assertEquals("A", rs.getString("ASC_OR_DESC"));
}


assertTrue(rs.next()); assertTrue(rs.next());
assertEquals("idx_a_d", rs.getString("INDEX_NAME")); assertEquals("idx_a_d", rs.getString("INDEX_NAME"));
assertEquals("quest", rs.getString("COLUMN_NAME")); assertEquals("quest", rs.getString("COLUMN_NAME"));
assertEquals("D", rs.getString("ASC_OR_DESC")); if (TestUtil.haveMinimumServerVersion(con, ServerVersion.v9_6)) {
assertNull("ASC_OR_DESC for index is not yet supported for PostgreSQL 9.6",
rs.getString("ASC_OR_DESC"));
} else {
assertEquals("D", rs.getString("ASC_OR_DESC"));
}
} }


public void testPartialIndexInfo() throws SQLException { public void testPartialIndexInfo() throws SQLException {
Expand Down
5 changes: 4 additions & 1 deletion travis_deploy.sh
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ set -x -e


# Skip tests and checkstype to speed up snapshot deployment # Skip tests and checkstype to speed up snapshot deployment
MVN_ARGS="clean deploy -B -V -DskipTests -Dcheckstyle.skip=true -Dskip.assembly=true --settings settings.xml" MVN_ARGS="clean deploy -B -V -DskipTests -Dcheckstyle.skip=true -Dskip.assembly=true --settings settings.xml"
MVN_ARGS="$MVN_ARGS $MVN_CUSTOM_ARGS" if [[ "${NO_WAFFLE_NO_OSGI}" == *"Y"* ]];
then
MVN_ARGS="$MVN_ARGS -DwaffleEnabled=false -DosgiEnabled=false -DexcludePackageNames=org.postgresql.osgi:org.postgresql.sspi"
fi


if [[ "${TRAVIS_JDK_VERSION}" == *"jdk6"* ]]; if [[ "${TRAVIS_JDK_VERSION}" == *"jdk6"* ]];
then then
Expand Down
2 changes: 1 addition & 1 deletion travis_install_dependencies.sh
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sudo service postgresql stop
sudo cp /etc/postgresql/9.1/main/pg_hba.conf ./ sudo cp /etc/postgresql/9.1/main/pg_hba.conf ./
sudo apt-get remove postgresql libpq-dev libpq5 postgresql-client-common postgresql-common -qq --purge sudo apt-get remove postgresql libpq-dev libpq5 postgresql-client-common postgresql-common -qq --purge
source /etc/lsb-release source /etc/lsb-release
echo "deb http://apt.postgresql.org/pub/repos/apt/ $DISTRIB_CODENAME-pgdg main" > pgdg.list echo "deb http://apt.postgresql.org/pub/repos/apt/ $DISTRIB_CODENAME-pgdg main ${PG_VERSION}" > pgdg.list
sudo mv pgdg.list /etc/apt/sources.list.d/ sudo mv pgdg.list /etc/apt/sources.list.d/
wget --quiet -O - https://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add - wget --quiet -O - https://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update sudo apt-get update
Expand Down

0 comments on commit 3ff47da

Please sign in to comment.