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

Commit bbe3d44

Browse files
committed
Fix for issue #1117 - Unique causes transaction abort
- fix error causing wrong column to be used for UNIQUE - remove inappropriately verbose log message related to foreign keys
1 parent 6c65689 commit bbe3d44

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/catalog/catalog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ ResultType Catalog::CreateTable(const std::string &database_name,
265265
table_oid, column.GetName(), column_id, column.GetOffset(),
266266
column.GetType(), column.IsInlined(), column.GetConstraints(),
267267
pool_.get(), txn);
268-
column_id++;
269268

270269
// Create index on unique single column
271270
if (column.IsUnique()) {
@@ -276,6 +275,7 @@ ResultType Catalog::CreateTable(const std::string &database_name,
276275
LOG_DEBUG("Added a UNIQUE index on %s in %s.", col_name.c_str(),
277276
table_name.c_str());
278277
}
278+
column_id++;
279279
}
280280
CreatePrimaryIndex(database_object->GetDatabaseOid(), table_oid, txn);
281281
return ResultType::SUCCESS;

src/storage/data_table.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,6 @@ bool DataTable::CheckForeignKeyConstraints(
591591

592592
// The foreign key constraints only refer to the primary key
593593
if (index->GetIndexType() == IndexConstraintType::PRIMARY_KEY) {
594-
LOG_INFO("BEGIN checking referred table");
595594

596595
std::vector<oid_t> key_attrs = foreign_key->GetSourceColumnIds();
597596
std::unique_ptr<catalog::Schema> foreign_key_schema(

0 commit comments

Comments
 (0)