Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions ydb/core/kqp/ut/tx/kqp_select.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#include <ydb/core/kqp/ut/common/kqp_ut_common.h>

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
3 changes: 2 additions & 1 deletion ydb/core/kqp/ut/tx/ya.make
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ SRCS(
kqp_locks_tricky_ut.cpp
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_tx_ut.cpp
kqp_rollback.cpp
)

PEERDIR(
Expand Down
Loading