Skip to content

Commit 740bb6f

Browse files
committed
pass not null flag as TTableColumnInfo field (ydb-platform#4731)
1 parent 037797d commit 740bb6f

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

ydb/core/grpc_services/resolve_local_db_table.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ namespace NGRpcService {
4545
const NTable::TScheme::TTableInfo* tableInfo = scheme.Tables.FindPtr(*ti);
4646

4747
for (const auto& col : tableInfo->Columns) {
48-
entry.Columns[col.first] = TSysTables::TTableColumnInfo(col.second.Name, col.first, col.second.PType, col.second.PTypeMod, col.second.KeyOrder);
48+
entry.Columns[col.first] = TSysTables::TTableColumnInfo(
49+
col.second.Name, col.first, col.second.PType, col.second.PTypeMod, col.second.KeyOrder,
50+
{}, TSysTables::TTableColumnInfo::EDefaultKind::DEFAULT_UNDEFINED, {}, false, col.second.NotNull);
4951
}
5052
}
5153

ydb/core/tx/datashard/sys_tables.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ struct TSysTables {
3131
EDefaultKind DefaultKind;
3232
Ydb::TypedValue DefaultFromLiteral;
3333
bool IsBuildInProgress = false;
34+
bool IsNotNullColumn = false; //maybe move into TTypeInfo?
3435

3536
TTableColumnInfo() = default;
3637

@@ -54,7 +55,7 @@ struct TSysTables {
5455
const TString& typeMod = {}, i32 keyOrder = -1,
5556
const TString& defaultFromSequence = {},
5657
EDefaultKind defaultKind = EDefaultKind::DEFAULT_UNDEFINED,
57-
const Ydb::TypedValue& defaultFromLiteral = {}, bool isBuildInProgress = false)
58+
const Ydb::TypedValue& defaultFromLiteral = {}, bool isBuildInProgress = false, bool isNotNullColumn = false)
5859
: Name(name)
5960
, Id(colId)
6061
, PType(type)
@@ -64,6 +65,7 @@ struct TSysTables {
6465
, DefaultKind(defaultKind)
6566
, DefaultFromLiteral(defaultFromLiteral)
6667
, IsBuildInProgress(isBuildInProgress)
68+
, IsNotNullColumn(isNotNullColumn)
6769
{}
6870
};
6971

ydb/core/tx/scheme_board/cache.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,7 @@ class TSchemeCache: public TMonitorableActor<TSchemeCache> {
785785
}
786786

787787
if (columnDesc.GetNotNull()) {
788+
column.IsNotNullColumn = true;
788789
NotNullColumns.insert(columnDesc.GetName());
789790
}
790791
}

ydb/core/tx/tx_proxy/read_table_impl.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -541,14 +541,12 @@ class TReadTableWorker : public TActorBootstrapped<TReadTableWorker> {
541541
size_t no = 0;
542542
size_t keys = 0;
543543

544-
const auto& notNullColumns = res.NotNullColumns;
545-
546544
for (auto &entry : res.Columns) {
547545
auto& col = entry.second;
548546

549547
if (col.KeyOrder != -1) {
550548
keyTypes[col.KeyOrder] = col.PType;
551-
notNullKeys[col.KeyOrder] = notNullColumns.contains(col.Name);
549+
notNullKeys[col.KeyOrder] = col.IsNotNullColumn;
552550
++keys;
553551
}
554552

0 commit comments

Comments
 (0)