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

Commit 8c74441

Browse files
committed
- small code cleanups
- remove unnecessary UNUSED_ATTRIBUTE designations - LOG_ERROR -> LOG_WARNING for SSL startup
1 parent a9153ea commit 8c74441

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

src/network/peloton_server.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ void PelotonServer::SSLInit() {
125125
//TODO(Yuchen): change this.
126126
//load trusted CA certificates (peer authentication)
127127
if (SSL_CTX_load_verify_locations(ssl_context, certificate_file_.c_str(), nullptr) != 1) {
128-
LOG_ERROR("Exception when loading root_crt!");
128+
LOG_WARN("Exception when loading root_crt!");
129129
SetSSLLevel(SSLLevel::SSL_PREFER);
130130
}
131131
//load OpenSSL's default CA certificate location
@@ -137,7 +137,7 @@ void PelotonServer::SSLInit() {
137137
LOG_INFO("certificate file path %s", certificate_file_.c_str());
138138
if (SSL_CTX_use_certificate_chain_file(ssl_context, certificate_file_.c_str()) != 1) {
139139
SSL_CTX_free(ssl_context);
140-
LOG_ERROR("Exception when loading server certificate!");
140+
LOG_WARN("Exception when loading server certificate!");
141141
ssl_context = nullptr;
142142
SetSSLLevel(SSLLevel::SSL_DISABLE);
143143
return;

src/storage/data_table.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ ItemPointer DataTable::InsertTuple(const storage::Tuple *tuple,
349349

350350
bool DataTable::InsertTuple(const AbstractTuple *tuple,
351351
ItemPointer location, concurrency::TransactionContext *transaction,
352-
ItemPointer **index_entry_ptr, UNUSED_ATTRIBUTE bool check_fk) {
352+
ItemPointer **index_entry_ptr, bool check_fk) {
353353
if (CheckConstraints(tuple) == false) {
354354
LOG_TRACE("InsertTuple(): Constraint violated");
355355
return false;
@@ -590,7 +590,7 @@ bool DataTable::CheckForeignKeySrcAndCascade(storage::Tuple *prev_tuple,
590590
storage::Tuple *new_tuple,
591591
concurrency::TransactionContext *current_txn,
592592
executor::ExecutorContext *context,
593-
bool is_update UNUSED_ATTRIBUTE)
593+
bool is_update)
594594
{
595595
size_t fk_count = GetForeignKeySrcCount();
596596

@@ -738,6 +738,8 @@ bool DataTable::CheckForeignKeySrcAndCascade(storage::Tuple *prev_tuple,
738738
return true;
739739
}
740740

741+
// PA - looks like the FIXME has been done. We check to see if the key
742+
// is visible
741743
/**
742744
* @brief Check if all the foreign key constraints on this table
743745
* is satisfied by checking whether the key exist in the referred table
@@ -752,8 +754,8 @@ bool DataTable::CheckForeignKeySrcAndCascade(storage::Tuple *prev_tuple,
752754
* @returns True on success, false if any foreign key constraints fail
753755
*/
754756
bool DataTable::CheckForeignKeyConstraints(
755-
const AbstractTuple *tuple UNUSED_ATTRIBUTE,
756-
concurrency::TransactionContext *transaction UNUSED_ATTRIBUTE) {
757+
const AbstractTuple *tuple,
758+
concurrency::TransactionContext *transaction) {
757759
for (auto foreign_key : foreign_keys_) {
758760
oid_t sink_table_id = foreign_key->GetSinkTableOid();
759761
storage::DataTable *ref_table = nullptr;
@@ -773,7 +775,6 @@ bool DataTable::CheckForeignKeyConstraints(
773775

774776
// The foreign key constraints only refer to the primary key
775777
if (index->GetIndexType() == IndexConstraintType::PRIMARY_KEY) {
776-
777778
std::vector<oid_t> key_attrs = foreign_key->GetSinkColumnIds();
778779
std::unique_ptr<catalog::Schema> foreign_key_schema(
779780
catalog::Schema::CopySchema(ref_table->schema, key_attrs));
@@ -782,11 +783,10 @@ bool DataTable::CheckForeignKeyConstraints(
782783
key->SetFromTuple(tuple, foreign_key->GetSourceColumnIds(), index->GetPool());
783784

784785
LOG_TRACE("check key: %s", key->GetInfo().c_str());
785-
786786
std::vector<ItemPointer *> location_ptrs;
787787
index->ScanKey(key.get(), location_ptrs);
788788

789-
// if this key doesn't exist in the refered column
789+
// if this key doesn't exist in the referred column
790790
if (location_ptrs.size() == 0) {
791791
LOG_DEBUG("The key: %s does not exist in table %s\n",
792792
key->GetInfo().c_str(),
@@ -821,6 +821,8 @@ bool DataTable::CheckForeignKeyConstraints(
821821
return true;
822822
}
823823

824+
825+
824826
//===--------------------------------------------------------------------===//
825827
// STATS
826828
//===--------------------------------------------------------------------===//

src/storage/temp_table.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ ItemPointer TempTable::InsertTuple(
8080

8181
return (location);
8282
}
83+
8384
ItemPointer TempTable::InsertTuple(const Tuple *tuple) {
8485
return (this->InsertTuple(tuple, nullptr, nullptr));
8586
}

0 commit comments

Comments
 (0)