Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Try CreateOneShotCachedPlan for unnamed statements in exec_parse_message #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: travis
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions .travis/make_postgres.sh
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions .travis/pgjdbc_check.sh
Original file line number Diff line number Diff line change
@@ -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
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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/.
8 changes: 6 additions & 2 deletions src/backend/tcop/postgres.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}

Expand Down