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

Commit bf7ff62

Browse files
tcm-marceltli2
authored andcommitted
Remove wrong check in QueryCompiler::IsSupported (#1378)
* Remove wrong check in QueryCompiler::IsSupported * Replace psxx extended procotol call with SQL for prepared statement to avoid type inference, which is not implemented yet in Peloton.
1 parent 671e4bd commit bf7ff62

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

Diff for: src/codegen/query_compiler.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ bool QueryCompiler::IsExpressionSupported(
125125
const expression::AbstractExpression &expr) {
126126
switch (expr.GetExpressionType()) {
127127
case ExpressionType::STAR:
128-
case ExpressionType::VALUE_PARAMETER:
129128
return false;
130129
default:
131130
break;

Diff for: test/network/prepare_stmt_test.cpp

+11-3
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,23 @@ void *PrepareStatementTest(int port) {
5252
txn2.exec("INSERT INTO employee VALUES (3, 'Yilei CHU');");
5353

5454
// test prepare statement
55-
C.prepare("searchstmt", "SELECT name FROM employee WHERE id=$1;");
55+
56+
// REPLACED by SQL to avoid type inference bug
57+
//C.prepare("searchstmt", "SELECT name FROM employee WHERE id=$1;");
58+
txn2.exec("PREPARE searchstmt (INT) as SELECT name FROM employee WHERE id=$1");
59+
5660
// invocation as in variable binding
57-
pqxx::result R = txn2.prepared("searchstmt")(1).exec();
61+
62+
// REPLACED by SQL to avoid type inference bug
63+
//pqxx::result R = txn2.prepared("searchstmt")(1).exec();
64+
auto result = txn2.exec("EXECUTE searchstmt(1)");
65+
5866
txn2.commit();
5967

6068
// test prepared statement already in statement cache
6169
// LOG_INFO("[Prepare statement cache]
6270
// %d",conn->protocol_handler_.ExistCachedStatement("searchstmt"));
63-
EXPECT_EQ(R.size(), 1);
71+
EXPECT_EQ(result.size(), 1);
6472

6573
} catch (const std::exception &e) {
6674
LOG_INFO("[PrepareStatementTest] Exception occurred: %s", e.what());

0 commit comments

Comments
 (0)