Backport #113291 to 26.6: Fix for virtual row is not being applied in some cases - #114220
Backport #113291 to 26.6: Fix for virtual row is not being applied in some cases#114220robot-clickhouse-ci-2 wants to merge 7 commits into
Conversation
|
Workflow [BackportPR], commit [fc02f6b] Summary: ❌
|
|
@groeneai can you check why tests are failing? Are we missing something in this branch, or can some changes from the patch be omitted? |
|
Checked all four red checks at 1. 2. 3. Same job - 04695, a leftover from the fixup. 4. Both stateless tests - EXPLAIN default format. The references are in the pretty form (
For the src side, stock 26.6 does reproduce what the patch fixes ( |
|
@groeneai could you please apply the relevant fixes to this branch? I applied these changes to a single branch, and now we need to reapply them to other versions: Adapting the backport of "Fix for virtual row is not being applied in some cases" (upstream #113291)The automated cherry-pick applies the hunks whose context matches and silently drops the rest — no conflict markers, 0. Find the dropped hunksFor every file in the backport commit: git show <backport-commit> --stat # file list
git diff master -- <each source file> # anything from the PR missing here was dropped
1. Restore the
|
|
I cannot push to Applying your steps to this branch, two of the four are already done and one needs narrowing:
One caveat on step 0: --- a/tests/queries/0_stateless/04672_read_in_order_virtual_row_sort_prefix.sql
+++ b/tests/queries/0_stateless/04672_read_in_order_virtual_row_sort_prefix.sql
@@ -20,3 +20,3 @@
SET optimize_read_in_order = 1, read_in_order_use_virtual_row = 1;
-SET max_bytes_ratio_before_external_join = 0, max_bytes_before_external_join = 0, query_plan_read_in_order_through_join = 1, join_runtime_filter_min_probe_rows = 0;
+SET max_bytes_ratio_before_external_join = 0, max_bytes_before_external_join = 0, query_plan_read_in_order_through_join = 1;
SET query_plan_optimize_join_order_limit = 1, query_plan_optimize_join_order_randomize = 0, query_plan_join_swap_table = 0;plus --- a/tests/queries/0_stateless/04695_to_string_monotonicity.sql
+++ b/tests/queries/0_stateless/04695_to_string_monotonicity.sql
@@ -25,10 +25,9 @@
INSERT INTO t_date SELECT toDate('2021-01-01') + intDiv(number, 4), number % 4 FROM numbers(20);
SELECT trimLeft(explain) FROM (
- EXPLAIN PLAN SELECT * FROM t_date ORDER BY toString(d), y SETTINGS optimize_read_in_order = 1
+ EXPLAIN PLAN actions = 1, compact = 1, pretty = 1 SELECT * FROM t_date ORDER BY toString(d), y SETTINGS optimize_read_in_order = 1
) WHERE explain LIKE '%sort description%';
DROP TABLE t_time;
DROP TABLE t_dst;
-DROP TABLE t_utc;
DROP TABLE t_date;--- a/tests/queries/0_stateless/04695_to_string_monotonicity.reference
+++ b/tests/queries/0_stateless/04695_to_string_monotonicity.reference
@@ -15,8 +15,5 @@
2021-11-07 01:59:57
2021-11-07 01:59:58
2021-11-07 01:59:59
-12
-│ Prefix sort description: toString(x) ASC, y ASC
-│ Result sort description: toString(x) ASC, y ASC
│ Prefix sort description: toString(d) ASC, y ASC
│ Result sort description: toString(d) ASC, y ASCThe Verified with That leaves For 26.5 the same patch applies with three differences, which I have put on #114219. |
|
@groeneai can you create your branch on top of this in your fork, I'll cherry pick form there then |
Two stateless tests from #113291 cannot run on 26.6 as cherry-picked, so they fail before any assertion executes. 04672: join_runtime_filter_min_probe_rows does not exist on 26.6 (added by #104860, settings history 26.8), so the SET at line 21 aborts the test with UNKNOWN_SETTING. Dropping that one clause makes the line identical to the merged 26.7 backport. max_bytes_ratio_before_external_join does exist here, so it stays and 04029 needs no change. 04695: the t_utc block was removed from this branch but the trailing DROP TABLE t_utc and the three matching reference lines were left behind, so the test dies with UNKNOWN_TABLE. Both files: EXPLAIN PLAN defaults to actions=1, compact=1, pretty=1 only from 26.7 via explain_query_plan_default, which does not exist on 26.6, so the references written for master do not match. Pinning the three options explicitly restores the byte-exact output. All three are needed: compact and pretty without actions collapse the plan and hide the sort description rows. Verified with clickhouse local on stock 26.6.3.30 and on a master build. On 26.6 both tests now run to completion and every remaining difference is the defect #113291 fixes. On master the same files match the references byte for byte, so the pinning loses no coverage.
This is the only failing gtest on asan_ubsan and tsan. #113291 added the TEST, but the monotonicity it asserts lives in src/Functions/toNullable.cpp and came from #110121, which is labelled pr-performance and was not backported: hasInformationAboutMonotonicity is absent from toNullable.cpp on 26.6 and present on 26.7, which is why 26.7 went green. Separate commit so it can be dropped if #110121 is backported instead.
|
Pushed:
Nothing in While re-reviewing the branch I found a wrong-results bug on 26.6 that is not caused by this backport, and it is the closest thing to a real answer to your original "are we missing something in this branch": CREATE TABLE vr (a UInt32, b Int64, c Int64) ENGINE = MergeTree ORDER BY (a, b, c);
SYSTEM STOP MERGES vr;
INSERT INTO vr VALUES (0,0,0),(0,1,0);
INSERT INTO vr VALUES (0,1,-100);
SELECT c FROM vr WHERE b = 1 ORDER BY a, c;On stock 26.6.3.30 that returns The unconditional guard is Two smaller things I noticed and deliberately left alone: |
Original pull-request #113291
This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.
The PR source
The PR is created in the CI job