Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
30 changes: 30 additions & 0 deletions ydb/core/kqp/ut/query/kqp_query_ut.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <fmt/format.h>
#include <ydb/core/kqp/ut/common/kqp_ut_common.h>

#include <ydb/core/tx/datashard/datashard_failpoints.h>
Expand Down Expand Up @@ -2634,6 +2635,35 @@ Y_UNIT_TEST_SUITE(KqpQuery) {
}
}

Y_UNIT_TEST(ExecuteWriteQuery) {
using namespace fmt::literals;

TKikimrRunner kikimr;
auto client = kikimr.GetQueryClient();

{ // Just generate table
const auto sql = fmt::format(R"(
CREATE TABLE test_table (
PRIMARY KEY (id)
) AS SELECT
ROW_NUMBER() OVER w AS id, data
FROM
AS_TABLE(ListReplicate(<|data: '{data}'|>, 500000))
WINDOW
w AS (ORDER BY data))",
"data"_a = std::string(137, 'a')
);
const auto result = client.ExecuteQuery(sql, NYdb::NQuery::TTxControl::NoTx()).ExtractValueSync();
UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), EStatus::SUCCESS, result.GetIssues().ToString());
}

Cerr << TInstant::Now() << " --------------- Start update ---------------\n";

const auto hangingResult = client.ExecuteQuery(R"(
UPDATE test_table SET data = "a"
)", NYdb::NQuery::TTxControl::NoTx()).ExtractValueSync();
UNIT_ASSERT_VALUES_EQUAL_C(hangingResult.GetStatus(), EStatus::SUCCESS, hangingResult.GetIssues().ToString());
}
}

} // namespace NKqp
Expand Down
1 change: 1 addition & 0 deletions ydb/core/kqp/ut/query/ya.make
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
UNITTEST_FOR(ydb/core/kqp)

TIMEOUT(60)
FORK_SUBTESTS()
SPLIT_FACTOR(50)

Expand Down
Loading