From d4dca3b320eedfb3ef75233389703356f5d3ae08 Mon Sep 17 00:00:00 2001 From: Stanislav Yablonskiy Date: Wed, 8 Oct 2025 11:28:21 +0000 Subject: [PATCH 1/2] Unit test for select no pk and limit --- ydb/core/kqp/ut/tx/kqp_select.cpp | 50 +++++++++++++++++++++++++++++++ ydb/core/kqp/ut/tx/ya.make | 3 +- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 ydb/core/kqp/ut/tx/kqp_select.cpp diff --git a/ydb/core/kqp/ut/tx/kqp_select.cpp b/ydb/core/kqp/ut/tx/kqp_select.cpp new file mode 100644 index 000000000000..0dcb5f5a9769 --- /dev/null +++ b/ydb/core/kqp/ut/tx/kqp_select.cpp @@ -0,0 +1,50 @@ +#include + +namespace NKikimr { +namespace NKqp { + +using namespace NYdb; +using namespace NYdb::NTable; + +Y_UNIT_TEST_SUITE(KqpSelect) { + Y_UNIT_TEST(NoPKAndLimit) { + + // Given + TKikimrSettings sts; + sts.SetWithSampleTables(false); + sts.SetColumnShardReaderClassName("SIMPLE"); + sts.AppConfig.MutableTableServiceConfig()->SetAllowOlapDataQuery(true); + TKikimrRunner kikimr(sts); + auto db = kikimr.GetTableClient(); + auto session = db.CreateSession().GetValueSync().GetSession(); + + AssertSuccessResult(session.ExecuteSchemeQuery(R"( + CREATE TABLE `/Root/KV` ( + id Uint64 NOT NULL, + vn Int32, + PRIMARY KEY (id) + ) + WITH ( + STORE = COLUMN + ); + )").GetValueSync()); + + auto result = session.ExecuteDataQuery(Q_(R"( + INSERT INTO `/Root/KV` (id, vn) VALUES (1, 11); + )"), TTxControl::BeginTx().CommitTx()).ExtractValueSync(); + result.GetIssues().PrintTo(Cerr); + UNIT_ASSERT(result.IsSuccess()); + + // When + result = session.ExecuteDataQuery(Q_(R"( + SELECT vn FROM `/Root/KV` LIMIT 1; + )"), TTxControl::BeginTx().CommitTx()).ExtractValueSync(); + + // Then + result.GetIssues().PrintTo(Cerr); + UNIT_ASSERT(result.IsSuccess()); + } +} + +} // namespace NKqp +} // namespace NKikimr diff --git a/ydb/core/kqp/ut/tx/ya.make b/ydb/core/kqp/ut/tx/ya.make index 5fdba24e9eb6..6eb7e9a8f4f3 100644 --- a/ydb/core/kqp/ut/tx/ya.make +++ b/ydb/core/kqp/ut/tx/ya.make @@ -14,12 +14,13 @@ SRCS( kqp_locks_tricky_ut.cpp kqp_locks_ut.cpp kqp_mvcc_ut.cpp + kqp_rollback.cpp kqp_sink_locks_ut.cpp kqp_sink_mvcc_ut.cpp kqp_sink_tx_ut.cpp kqp_snapshot_isolation_ut.cpp + kqp_select.cpp kqp_tx_ut.cpp - kqp_rollback.cpp ) PEERDIR( From ad5a0cd4e8b39980d29ae1b15af9899164a61c86 Mon Sep 17 00:00:00 2001 From: Stanislav Yablonskiy Date: Wed, 8 Oct 2025 11:36:32 +0000 Subject: [PATCH 2/2] sort files list --- ydb/core/kqp/ut/tx/ya.make | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ydb/core/kqp/ut/tx/ya.make b/ydb/core/kqp/ut/tx/ya.make index 6eb7e9a8f4f3..fc9568ba6219 100644 --- a/ydb/core/kqp/ut/tx/ya.make +++ b/ydb/core/kqp/ut/tx/ya.make @@ -15,11 +15,11 @@ SRCS( kqp_locks_ut.cpp kqp_mvcc_ut.cpp kqp_rollback.cpp + kqp_select.cpp kqp_sink_locks_ut.cpp kqp_sink_mvcc_ut.cpp kqp_sink_tx_ut.cpp kqp_snapshot_isolation_ut.cpp - kqp_select.cpp kqp_tx_ut.cpp )