From bf8feb563d62efa84850b97e80a47c126bfbeb7f Mon Sep 17 00:00:00 2001 From: Nikolay Shumkov Date: Fri, 24 May 2024 14:16:20 +0300 Subject: [PATCH] Fixes --- ydb/core/tx/schemeshard/schemeshard_info_types.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/ydb/core/tx/schemeshard/schemeshard_info_types.cpp b/ydb/core/tx/schemeshard/schemeshard_info_types.cpp index d31a8f76b6f7..924b361874f2 100644 --- a/ydb/core/tx/schemeshard/schemeshard_info_types.cpp +++ b/ydb/core/tx/schemeshard/schemeshard_info_types.cpp @@ -292,15 +292,10 @@ TTableInfo::TAlterDataPtr TTableInfo::CreateAlterData( if (col.HasDefaultFromSequence()) { if (sourceColumn.PType.GetTypeId() != NScheme::NTypeIds::Int64 && NPg::PgTypeIdFromTypeDesc(sourceColumn.PType.GetTypeDesc()) != INT8OID) { - if (sourceColumn.PType.GetTypeId() == NScheme::NTypeIds::Pg) { - errStr = Sprintf( - "Sequence value type '%s' must be equal to the column type '%s'", "pgint8", - NScheme::TypeName(sourceColumn.PType, sourceColumn.PTypeMod).c_str()); - } else { - errStr = Sprintf( - "Sequence value type '%s' must be equal to the column type '%s'", "Int64", - NScheme::TypeName(sourceColumn.PType, sourceColumn.PTypeMod).c_str()); - } + TString sequenceType = sourceColumn.PType.GetTypeId() == NScheme::NTypeIds::Pg ? "pgint8" : "Int64"; + errStr = Sprintf( + "Sequence value type '%s' must be equal to the column type '%s'", sequenceType, + NScheme::TypeName(sourceColumn.PType, sourceColumn.PTypeMod).c_str()); return nullptr; } }