Skip to content

Commit a2072ba

Browse files
authored
TTableId fix (#958)
1 parent a7d7e3e commit a2072ba

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

ydb/core/tx/datashard/ut_common/datashard_ut_common.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -1897,7 +1897,7 @@ TTestActorRuntimeBase::TEventObserverHolder ReplaceEvProposeTransactionWithEvWri
18971897

18981898
// Construct new EvWrite
18991899
TVector<TCell> cells;
1900-
ui64 tableId = 0;
1900+
TTableId tableId;
19011901
ui16 colCount = 0;
19021902
for (const auto& task : tx.GetKqpTransaction().GetTasks()) {
19031903
NKikimrTxDataShard::TKqpTransaction::TDataTaskMeta meta;
@@ -1906,8 +1906,9 @@ TTestActorRuntimeBase::TEventObserverHolder ReplaceEvProposeTransactionWithEvWri
19061906
continue;
19071907

19081908
const auto& tableMeta = meta.GetTable();
1909-
Y_VERIFY_S(tableId == 0 || tableId == tableMeta.GetTableId().GetTableId(), "Only writes to one table is supported now");
1910-
tableId = tableMeta.GetTableId().GetTableId();
1909+
TTableId tableIdProto(tableMeta.GetTableId().GetOwnerId(), tableMeta.GetTableId().GetTableId(), tableMeta.GetSchemaVersion());
1910+
Y_VERIFY_S(tableId == TTableId{} || tableId == tableIdProto, "Only writes to one table is supported now");
1911+
tableId = tableIdProto;
19111912
const auto& writes = meta.GetWrites();
19121913
Y_VERIFY_S(colCount == 0 || colCount == writes.GetColumns().size(), "Only equal column count is supported now.");
19131914
colCount = writes.GetColumns().size();
@@ -1936,7 +1937,7 @@ TTestActorRuntimeBase::TEventObserverHolder ReplaceEvProposeTransactionWithEvWri
19361937

19371938
auto evWrite = std::make_unique<NKikimr::NEvents::TDataEvents::TEvWrite>(txId, txMode);
19381939
ui64 payloadIndex = NKikimr::NEvWrite::TPayloadHelper<NKikimr::NEvents::TDataEvents::TEvWrite>(*evWrite).AddDataToPayload(std::move(blobData));
1939-
evWrite->AddOperation(NKikimrDataEvents::TEvWrite::TOperation::OPERATION_UPSERT, tableId, 1, columnIds, payloadIndex, NKikimrDataEvents::FORMAT_CELLVEC);
1940+
evWrite->AddOperation(NKikimrDataEvents::TEvWrite::TOperation::OPERATION_UPSERT, tableId, columnIds, payloadIndex, NKikimrDataEvents::FORMAT_CELLVEC);
19401941

19411942
// Replace event
19421943
auto handle = new IEventHandle(event->Recipient, event->Sender, evWrite.release(), 0, event->Cookie);

0 commit comments

Comments
 (0)