Skip to content

Commit

Permalink
fix clang
Browse files Browse the repository at this point in the history
  • Loading branch information
hououou committed Mar 26, 2024
1 parent 5c11fed commit 575e5f7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/include/main/prepared_statement.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ class PreparedStatement {
private:
bool success = true;
bool readOnly = false;
bool requiredNewTx = true;
std::string errMsg;
PreparedSummary preparedSummary;
std::unordered_map<std::string, std::shared_ptr<common::Value>> parameterMap;
std::unique_ptr<binder::BoundStatementResult> statementResult;
std::vector<std::unique_ptr<planner::LogicalPlan>> logicalPlans;
std::shared_ptr<parser::Statement> parsedStatement;
bool requiredNewTx = true;
};

} // namespace main
Expand Down
7 changes: 1 addition & 6 deletions src/main/client_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ std::unique_ptr<PreparedStatement> ClientContext::preparedStatementWithError(
void ClientContext::prepareInternal(PreparedStatement& preparedStatement, bool enumerateAllPlans,
std::string_view encodedJoin,
std::optional<std::unordered_map<std::string, std::shared_ptr<common::Value>>> inputParams) {
// TODO(Jiamin): parsedStatement
auto parsedStatement = preparedStatement.parsedStatement;
// parsing
if (preparedStatement.requiredNewTx) {
Expand Down Expand Up @@ -334,10 +333,7 @@ std::unique_ptr<PreparedStatement> ClientContext::prepareNoLock(
std::unique_ptr<ExecutionContext> executionContext;
std::unique_ptr<LogicalPlan> logicalPlan;
try {
// TODO(Jiamin): need to copy parsed statement?
preparedStatement->parsedStatement = parsedStatement;
KU_ASSERT(preparedStatement->parsedStatement->getStatementType() ==
parsedStatement->getStatementType());
prepareInternal(*preparedStatement, enumerateAllPlans, encodedJoin);
} catch (std::exception& exception) {
preparedStatement->success = false;
Expand Down Expand Up @@ -372,8 +368,7 @@ std::unique_ptr<QueryResult> ClientContext::executeWithParams(PreparedStatement*
std::string errMsg = exception.what();
return queryResultWithError(errMsg);
}
// rebind here
// TODO(Jiamin): pass parameters
// rebind
KU_ASSERT(preparedStatement->parsedStatement != nullptr);
auto& parameterMap = preparedStatement->parameterMap;
preparedStatement->requiredNewTx = transactionContext->hasActiveTransaction() ? false : true;
Expand Down
1 change: 0 additions & 1 deletion test/main/prepare_test.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "main_test_helper/main_test_helper.h"

#include<iostream>
using namespace kuzu::common;
using namespace kuzu::testing;

Expand Down

0 comments on commit 575e5f7

Please sign in to comment.