diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000000..cd73234fc1485 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,43 @@ +sudo: false +language: java + +before_script: + - ./.travis/make_postgres.sh + - psql -U postgres -c "create user test with password 'test';" + - psql -c 'create database test owner test;' -U postgres + - echo "MAVEN_OPTS='-Xmx1g -Dgpg.skip=true'" > ~/.mavenrc + - psql test -c 'CREATE EXTENSION hstore;' -U postgres + +script: + # make sure previous build artifacts are not used for subsequent builds + - ./.travis/travis_build.sh + +before_cache: + # No sense in caching current build artifacts + rm -rf $HOME/.m2/repository/org/postgresql + +# Skip default "mvn install" issued by Travis +# Root project cannot be compiled with older JDKs, so it makes sense to just skip the step +install: true + +cache: + directories: + - '$HOME/.m2/repository' + +matrix: + fast_finish: true + include: + - env: + - TEST=PG_CHECK + script: make check + - env: + - TEST=PG_CHECK_WORLD + script: PGHOST=localhost make check-world + - jdk: oraclejdk8 + env: + - TEST=pgjdbc + script: ./.travis/pgjdbc_check.sh + +branches: + only: + - travis diff --git a/.travis/make_postgres.sh b/.travis/make_postgres.sh new file mode 100755 index 0000000000000..94117362752d5 --- /dev/null +++ b/.travis/make_postgres.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -x -e + +PREFIX=$HOME/pg_head + +./configure --prefix=$PREFIX + +# Build PostgreSQL from source and start the DB +make && make install && $PREFIX/bin/pg_ctl -D $PREFIX/data initdb && $PREFIX/bin/pg_ctl -D $PREFIX/data -l postgres.log start diff --git a/.travis/pgjdbc_check.sh b/.travis/pgjdbc_check.sh new file mode 100755 index 0000000000000..1633a894512aa --- /dev/null +++ b/.travis/pgjdbc_check.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -x -e + +git clone --depth=1 https://github.com/pgjdbc/pgjdbc.git + +cd pgjdbc + +mvn clean package -B -V diff --git a/README.md b/README.md new file mode 100644 index 0000000000000..5d06c174fb69e --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +[![Build Status](https://travis-ci.org/vlsi/postgres.svg?branch=travis)](https://travis-ci.org/vlsi/postgres) + +PostgreSQL Database Management System +===================================== + +This directory contains the source code distribution of the PostgreSQL +database management system. + +PostgreSQL is an advanced object-relational database management system +that supports an extended subset of the SQL standard, including +transactions, foreign keys, subqueries, triggers, user-defined types +and functions. This distribution also contains C language bindings. + +PostgreSQL has many language interfaces, many of which are listed here: + + http://www.postgresql.org/download + +See the file INSTALL for instructions on how to build and install +PostgreSQL. That file also lists supported operating systems and +hardware platforms and contains information regarding any other +software packages that are required to build or run the PostgreSQL +system. Copyright and license information can be found in the +file COPYRIGHT. A comprehensive documentation set is included in this +distribution; it can be read as described in the installation +instructions. + +The latest version of this software may be obtained at +http://www.postgresql.org/download/. For more information look at our +web site located at http://www.postgresql.org/. diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index b185c1b5eb69f..8e5aa43ba6587 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -1308,7 +1308,11 @@ exec_parse_message(const char *query_string, /* string to execute */ * Create the CachedPlanSource before we do parse analysis, since it * needs to see the unmodified raw parse tree. */ - psrc = CreateCachedPlan(raw_parse_tree, query_string, commandTag); + if (is_named) { + psrc = CreateCachedPlan(raw_parse_tree, query_string, commandTag); + } else { + psrc = CreateOneShotCachedPlan(raw_parse_tree, query_string, commandTag); + } /* * Set up a snapshot if parse analysis will need one. @@ -1399,7 +1403,7 @@ exec_parse_message(const char *query_string, /* string to execute */ /* * We just save the CachedPlanSource into unnamed_stmt_psrc. */ - SaveCachedPlan(psrc); + // SaveCachedPlan(psrc); unnamed_stmt_psrc = psrc; }