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

Commit 21ee68d

Browse files
committed
added change type into alter tabe
1 parent cf0c5a6 commit 21ee68d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/catalog/catalog.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,10 @@ ResultType Catalog::AlterTable(oid_t database_oid, oid_t table_oid,
924924
// otherwise, copy value in old table
925925
// TODO: Change type if necessary
926926
val = result_tile->GetValue(i, it->second);
927+
if (new_schema->GetColumn(new_column_id).GetType() != old_schema->GetColumn(it->second).GetType()) {
928+
//change the value's type
929+
val = val.CastAs(new_schema->GetColumn(new_column_id).GetType());
930+
}
927931
}
928932
tuple->SetValue(new_column_id, val, pool_.get());
929933
}

0 commit comments

Comments
 (0)