Skip to content

Commit 66fa321

Browse files
order by
1 parent 0056b4a commit 66fa321

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

tests/integration/basic_example_it/basic_example.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ static TStatus SelectSimpleTransaction(TSession session, const std::string& path
140140
141141
SELECT series_id, title, CAST(CAST(release_date AS Date) AS String) AS release_date
142142
FROM series
143-
WHERE series_id = 1;
143+
WHERE series_id = 1
144+
ORDER BY series_id;
144145
)", path);
145146

146147
auto txControl =
@@ -189,7 +190,8 @@ static TStatus SelectWithParamsTransaction(TSession session, const std::string&
189190
FROM seasons AS sa
190191
INNER JOIN series AS sr
191192
ON sa.series_id = sr.series_id
192-
WHERE sa.series_id = $seriesId AND sa.season_id = $seasonId;
193+
WHERE sa.series_id = $seriesId AND sa.season_id = $seasonId
194+
ORDER BY season_title, series_title;
193195
)", path);
194196

195197
// Type of parameter values should be exactly the same as in DECLARE statements.
@@ -230,7 +232,8 @@ static TStatus PreparedSelectTransaction(TSession session, const std::string& pa
230232
231233
SELECT *
232234
FROM episodes
233-
WHERE series_id = $seriesId AND season_id = $seasonId AND episode_id = $episodeId;
235+
WHERE series_id = $seriesId AND season_id = $seasonId AND episode_id = $episodeId
236+
ORDER BY season_id, episode_id;
234237
)", path);
235238

236239
// Prepare query or get result from query cache
@@ -279,7 +282,8 @@ static TStatus MultiStepTransaction(TSession session, const std::string& path, u
279282
DECLARE $seasonId AS Uint64;
280283
281284
SELECT first_aired AS from_date FROM seasons
282-
WHERE series_id = $seriesId AND season_id = $seasonId;
285+
WHERE series_id = $seriesId AND season_id = $seasonId
286+
ORDER BY from_date;
283287
)", path);
284288

285289
auto params1 = session.GetParamsBuilder()
@@ -328,7 +332,8 @@ static TStatus MultiStepTransaction(TSession session, const std::string& path, u
328332
DECLARE $toDate AS Uint64;
329333
330334
SELECT season_id, episode_id, title, air_date FROM episodes
331-
WHERE series_id = $seriesId AND air_date >= $fromDate AND air_date <= $toDate;
335+
WHERE series_id = $seriesId AND air_date >= $fromDate AND air_date <= $toDate
336+
ORDER BY season_id, episode_id;
332337
)", path);
333338

334339
auto params2 = session.GetParamsBuilder()
@@ -457,6 +462,7 @@ std::vector<std::string> ScanQuerySelect(TTableClient client, const std::string&
457462
SELECT series_id, season_id, title, CAST(CAST(first_aired AS Date) AS String) AS first_aired
458463
FROM seasons
459464
WHERE series_id IN $series
465+
ORDER BY season_id;
460466
)", path);
461467

462468
auto parameters = TParamsBuilder()

0 commit comments

Comments
 (0)