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

Commit aaaa621

Browse files
pranavkapavlo
authored andcommitted
Fix trace level build
Compile with LOG_LEVEL trace and build fails
1 parent 46b44be commit aaaa621

File tree

6 files changed

+19
-21
lines changed

6 files changed

+19
-21
lines changed

src/binder/binder_context.cpp

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,16 @@ bool BinderContext::GetColumnPosTuple(
8282
const std::string &col_name,
8383
std::shared_ptr<catalog::TableCatalogObject> table_obj,
8484
std::tuple<oid_t, oid_t, oid_t> &col_pos_tuple, type::TypeId &value_type) {
85-
try {
86-
auto column_object = table_obj->GetColumnObject(col_name);
87-
if (column_object == nullptr) {
88-
return false;
89-
}
90-
91-
oid_t col_pos = column_object->GetColumnId();
92-
col_pos_tuple = std::make_tuple(table_obj->GetDatabaseOid(),
93-
table_obj->GetTableOid(), col_pos);
94-
value_type = column_object->GetColumnType();
95-
return true;
96-
} catch (CatalogException &e) {
97-
LOG_TRACE("Can't find table %d! Return false", std::get<1>(table_id_tuple));
85+
auto column_object = table_obj->GetColumnObject(col_name);
86+
if (column_object == nullptr) {
9887
return false;
9988
}
89+
90+
oid_t col_pos = column_object->GetColumnId();
91+
col_pos_tuple = std::make_tuple(table_obj->GetDatabaseOid(),
92+
table_obj->GetTableOid(), col_pos);
93+
value_type = column_object->GetColumnType();
94+
return true;
10095
}
10196

10297
bool BinderContext::GetColumnPosTuple(

src/executor/create_executor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ bool CreateExecutor::CreateDatabase(const planner::CreatePlan &node) {
9494
database_name, txn);
9595
txn->SetResult(result);
9696
LOG_TRACE("Result is: %s",
97-
ResultTypeToString(current_txn->GetResult()).c_str());
97+
ResultTypeToString(txn->GetResult()).c_str());
9898
return (true);
9999
}
100100

src/optimizer/group.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ GroupExpression *Group::GetBestExpression(
5858
return std::get<1>(it->second);
5959
}
6060
LOG_TRACE("Didn't get best expression with properties %s",
61-
properties.ToString().c_str());
61+
properties->ToString().c_str());
6262
return nullptr;
6363
}
6464

src/optimizer/rule_impls.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,10 @@ void GetToIndexScan::Transform(
260260
value_expr)
261261
->GetValue());
262262
LOG_TRACE("Value Type: %d",
263-
reinterpret_cast<expression::ConstantValueExpression *>(
263+
static_cast<int>(
264+
reinterpret_cast<expression::ConstantValueExpression *>(
264265
expr->GetModifiableChild(1))
265-
->GetValueType());
266+
->GetValueType()));
266267
} else {
267268
value_list.push_back(
268269
type::ValueFactory::GetParameterOffsetValue(
@@ -271,7 +272,7 @@ void GetToIndexScan::Transform(
271272
->GetValueIdx())
272273
.Copy());
273274
LOG_TRACE("Parameter offset: %s",
274-
(*values.rbegin()).GetInfo().c_str());
275+
(*value_list.rbegin()).GetInfo().c_str());
275276
}
276277
}
277278
} // Loop predicates end

src/optimizer/util.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,10 @@ void GetPredicateColumns(const catalog::Schema *schema,
154154
expression->GetModifiableChild(1))
155155
->GetValue());
156156
LOG_TRACE("Value Type: %d",
157+
static_cast<int>(
157158
reinterpret_cast<expression::ConstantValueExpression *>(
158159
expression->GetModifiableChild(1))
159-
->GetValueType());
160+
->GetValueType()));
160161
} else
161162
values.push_back(
162163
type::ValueFactory::GetParameterOffsetValue(
@@ -185,9 +186,10 @@ void GetPredicateColumns(const catalog::Schema *schema,
185186
expression->GetModifiableChild(1))
186187
->GetValue());
187188
LOG_TRACE("Value Type: %d",
189+
static_cast<int>(
188190
reinterpret_cast<expression::ConstantValueExpression *>(
189191
expression->GetModifiableChild(0))
190-
->GetValueType());
192+
->GetValueType()));
191193
} else
192194
values.push_back(
193195
type::ValueFactory::GetParameterOffsetValue(

src/traffic_cop/traffic_cop.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ void TrafficCop::ExecuteStatementPlanGetResult() {
212212
txn_result == ResultType::FAILURE) {
213213
LOG_TRACE(
214214
"About to commit: single stmt: %d, init_failure: %d, txn_result: %s",
215-
is_single_statement_txn_, init_failure,
215+
single_statement_txn_, init_failure,
216216
ResultTypeToString(txn_result).c_str());
217217
switch (txn_result) {
218218
case ResultType::SUCCESS:

0 commit comments

Comments
 (0)