Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit 9a71c32

Browse files
committed
Merge branch 'master' of https://github.com/cmu-db/peloton into tianyuli-libpqxx
2 parents 653036a + 7156935 commit 9a71c32

File tree

12 files changed

+32
-18
lines changed

12 files changed

+32
-18
lines changed

Jenkinsfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pipeline {
2222
sh 'cd build && make benchmark -j4'
2323
sh 'cd build && make install'
2424
sh 'cd build && bash ../script/testing/psql/psql_test.sh'
25+
sh 'sudo apt-get -qq update && sudo apt-get -qq -y --no-install-recommends install wget default-jdk default-jre' // prerequisites for jdbc_validator
2526
sh 'cd build && python ../script/validators/jdbc_validator.py'
2627
}
2728
}
@@ -48,6 +49,7 @@ pipeline {
4849
// sh 'cd build && make benchmark -j4'
4950
// sh 'cd build && make install'
5051
// sh 'cd build && bash ../script/testing/psql/psql_test.sh'
52+
// sh 'sudo apt-get -qq update && sudo apt-get -qq -y --no-install-recommends install wget default-jdk default-jre' // prerequisites for jdbc_validator
5153
// sh 'cd build && python ../script/validators/jdbc_validator.py'
5254
}
5355
}
@@ -64,6 +66,7 @@ pipeline {
6466
sh 'cd build && make benchmark -j4'
6567
sh 'cd build && make install'
6668
sh 'cd build && bash ../script/testing/psql/psql_test.sh'
69+
sh 'sudo apt-get -qq update && sudo apt-get -qq -y --no-install-recommends install wget default-jdk default-jre' // prerequisites for jdbc_validator
6770
sh 'cd build && python ../script/validators/jdbc_validator.py'
6871
}
6972
}
@@ -79,6 +82,7 @@ pipeline {
7982
// sh 'cd build && make benchmark -j4'
8083
// sh 'cd build && make install'
8184
// sh 'cd build && bash ../script/testing/psql/psql_test.sh'
85+
// sh 'sudo apt-get -qq update && sudo apt-get -qq -y --no-install-recommends install wget default-jdk default-jre' // prerequisites for jdbc_validator
8286
// sh 'cd build && python ../script/validators/jdbc_validator.py'
8387
// }
8488
// }

cmake/External/capnproto.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ if (NOT __CAPNP_INCLUDED) # guard against multiple includes
2020
set(CAPNP_EXTRA_COMPILER_FLAGS "-fPIC")
2121
endif()
2222

23-
set(CAPNP_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${CAPNP_EXTRA_COMPILER_FLAGS})
24-
set(CAPNP_C_FLAGS ${CMAKE_C_FLAGS} ${CAPNP_EXTRA_COMPILER_FLAGS})
23+
set(CAPNP_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CAPNP_EXTRA_COMPILER_FLAGS}")
24+
set(CAPNP_C_FLAGS "${CMAKE_C_FLAGS} ${CAPNP_EXTRA_COMPILER_FLAGS}")
2525

2626
ExternalProject_Add(capnp
2727
PREFIX ${capnp_PREFIX}

cmake/External/gflags.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ if (NOT __GFLAGS_INCLUDED) # guard against multiple includes
2020
set(GFLAGS_EXTRA_COMPILER_FLAGS "-fPIC")
2121
endif()
2222

23-
set(GFLAGS_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${GFLAGS_EXTRA_COMPILER_FLAGS})
24-
set(GFLAGS_C_FLAGS ${CMAKE_C_FLAGS} ${GFLAGS_EXTRA_COMPILER_FLAGS})
23+
set(GFLAGS_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GFLAGS_EXTRA_COMPILER_FLAGS}")
24+
set(GFLAGS_C_FLAGS "${CMAKE_C_FLAGS} ${GFLAGS_EXTRA_COMPILER_FLAGS}")
2525

2626
ExternalProject_Add(gflags
2727
PREFIX ${gflags_PREFIX}

cmake/External/glog.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ if (NOT __GLOG_INCLUDED)
2222
set(GLOG_EXTRA_COMPILER_FLAGS "-fPIC")
2323
endif()
2424

25-
set(GLOG_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${GLOG_EXTRA_COMPILER_FLAGS})
26-
set(GLOG_C_FLAGS ${CMAKE_C_FLAGS} ${GLOG_EXTRA_COMPILER_FLAGS})
25+
set(GLOG_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GLOG_EXTRA_COMPILER_FLAGS}")
26+
set(GLOG_C_FLAGS "${CMAKE_C_FLAGS} ${GLOG_EXTRA_COMPILER_FLAGS}")
2727

2828
# depend on gflags if we're also building it
2929
if (GFLAGS_EXTERNAL)

script/git-hooks/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if [ -n "$FILES" ]; then
1919
echo "******* Peloton Pre-Commit Hook *******"
2020
echo "***************************************"
2121
echo "Use \"$FORMATTER_PATH -c -f\" to format all staged files."
22-
echo "Or use \"$FORMATTER_PATH --no-verify\" to temporarily bypass the pre-commit hook."
22+
echo "Or use \"git commit --no-verify\" to temporarily bypass the pre-commit hook."
2323
echo
2424
echo "Be aware that changed files have to be staged again!"
2525
echo "***************************************"

src/executor/plan_executor.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static void CompileAndExecutePlan(
6464
}
6565

6666
auto on_query_result =
67-
[&on_complete, &consumer](executor::ExecutionResult result) {
67+
[&on_complete, &consumer, plan](executor::ExecutionResult result) {
6868
std::vector<ResultValue> values;
6969
for (const auto &tuple : consumer.GetOutputTuples()) {
7070
for (uint32_t i = 0; i < tuple.tuple_.size(); i++) {
@@ -74,6 +74,7 @@ static void CompileAndExecutePlan(
7474
values.push_back(std::move(str));
7575
}
7676
}
77+
plan->ClearParameterValues();
7778
on_complete(result, std::move(values));
7879
};
7980

@@ -102,6 +103,7 @@ static void InterpretPlan(
102103
result.m_result = ResultType::FAILURE;
103104
result.m_error_message = "Failed initialization of query execution tree";
104105
CleanExecutorTree(executor_tree.get());
106+
plan->ClearParameterValues();
105107
on_complete(result, std::move(values));
106108
return;
107109
}
@@ -131,6 +133,7 @@ static void InterpretPlan(
131133
result.m_processed = executor_context->num_processed;
132134
result.m_result = ResultType::SUCCESS;
133135
CleanExecutorTree(executor_tree.get());
136+
plan->ClearParameterValues();
134137
on_complete(result, std::move(values));
135138
}
136139

@@ -174,7 +177,7 @@ void PlanExecutor::ExecutePlan(
174177
* @return number of executed tuples and logical_tile_list
175178
*/
176179
int PlanExecutor::ExecutePlan(
177-
const planner::AbstractPlan *plan, const std::vector<type::Value> &params,
180+
planner::AbstractPlan *plan, const std::vector<type::Value> &params,
178181
std::vector<std::unique_ptr<executor::LogicalTile>> &logical_tile_list) {
179182
PL_ASSERT(plan != nullptr);
180183
LOG_TRACE("PlanExecutor Start with transaction");

src/include/common/dedicated_thread_registry.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "common/dedicated_thread_task.h"
2020
#include "common/dedicated_thread_owner.h"
2121

22-
2322
namespace peloton {
2423

2524
/**

src/include/executor/plan_executor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class PlanExecutor {
7070
*/
7171
// FIXME This should be removed when PelotonService is removed/rewritten
7272
static int ExecutePlan(
73-
const planner::AbstractPlan *plan, const std::vector<type::Value> &params,
73+
planner::AbstractPlan *plan, const std::vector<type::Value> &params,
7474
std::vector<std::unique_ptr<executor::LogicalTile>> &logical_tile_list);
7575
};
7676

src/include/planner/abstract_plan.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ class AbstractPlan : public Printable {
7878

7979
// Setting values of the parameters in the prepare statement
8080
virtual void SetParameterValues(std::vector<type::Value> *values);
81+
82+
// FIXME. Clear the value_ vector.
83+
virtual void ClearParameterValues() {};
8184

8285
// Get the estimated cardinality of this plan
8386
int GetCardinality() const { return estimated_cardinality_; }

src/include/planner/insert_plan.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ class InsertPlan : public AbstractPlan {
6969

7070
void SetParameterValues(std::vector<type::Value> *values) override;
7171

72+
/*
73+
* Clear the parameter values of the current insert. The plan may be
74+
* cached in the statement / plan cache and may be reused.
75+
*/
76+
void ClearParameterValues() override { values_.clear(); }
77+
7278
storage::DataTable *GetTable() const { return target_table_; }
7379

7480
const planner::ProjectInfo *GetProjectInfo() const {

0 commit comments

Comments
 (0)