Repository navigation
Add 2 tests for coverage gaps in PR #121332 - #124384
Conversation
Pre-PR validation: 6/6 ✅a) Deterministic repro? ✅ b) Root cause explained? ✅ c) Fix matches root cause? ✅ d) Test intent preserved? / New tests added? ✅ e) Both directions demonstrated? ✅ f) Fix is general, not a narrow patch? ✅ |
|
@clickgapai Both gaps are real: the tests fail on master before #121332 and pass after it. Two small changes:
|
|
Workflow [PR], commit [343e3ca] Summary: ✅ AI ReviewSummaryThis test-only PR adds two stateless regressions around Final Verdict
|
The final listing only showed that a refused command loads the table. ATTACH and REPLACE PARTITION FROM parse to the same REPLACE_PARTITION command, so 05332 keeps only the ATTACH refusal. Requested by @evillique in ClickHouse#124384 (comment)
|
Pushed a commit. Here's the actual diff so you can review what was committed: diff --git a/tests/queries/0_stateless/05332_lazy_load_tables_partition_commands.reference b/tests/queries/0_stateless/05332_lazy_load_tables_partition_commands.reference
index d289641c628d..f3be1d7af8a7 100644
--- a/tests/queries/0_stateless/05332_lazy_load_tables_partition_commands.reference
+++ b/tests/queries/0_stateless/05332_lazy_load_tables_partition_commands.reference
@@ -11,7 +11,3 @@ REPLACE PARTITION FROM a loaded source
10 45
a source that is not MergeTree is refused
10 45
-t_dst MergeTree
-t_log Log
-t_moved MergeTree
-t_src MergeTree
diff --git a/tests/queries/0_stateless/05332_lazy_load_tables_partition_commands.sql b/tests/queries/0_stateless/05332_lazy_load_tables_partition_commands.sql
index 8fce6f1ae595..8d8c4b081c19 100644
--- a/tests/queries/0_stateless/05332_lazy_load_tables_partition_commands.sql
+++ b/tests/queries/0_stateless/05332_lazy_load_tables_partition_commands.sql
@@ -36,11 +36,8 @@ SELECT count(), sum(n) FROM t_dst;
SELECT 'a source that is not MergeTree is refused';
ALTER TABLE t_dst ATTACH PARTITION tuple() FROM t_log; -- { serverError NOT_IMPLEMENTED }
-ALTER TABLE t_dst REPLACE PARTITION tuple() FROM t_log; -- { serverError NOT_IMPLEMENTED }
SELECT count(), sum(n) FROM t_dst;
-SELECT name, engine FROM system.tables WHERE database = currentDatabase() ORDER BY name;
-
DROP TABLE t_src;
DROP TABLE t_dst;
DROP TABLE t_moved;
diff --git a/tests/queries/0_stateless/05333_lazy_load_tables_join_get.reference b/tests/queries/0_stateless/05333_lazy_load_tables_join_get.reference
index 14b2904cc527..ff53d1559fba 100644
--- a/tests/queries/0_stateless/05333_lazy_load_tables_join_get.reference
+++ b/tests/queries/0_stateless/05333_lazy_load_tables_join_get.reference
@@ -5,5 +5,3 @@ one
1 one
2 two
3 \N
-t_join Join
-t_log Log
diff --git a/tests/queries/0_stateless/05333_lazy_load_tables_join_get.sql b/tests/queries/0_stateless/05333_lazy_load_tables_join_get.sql
index efa2d3d107dc..e286d6a5cb2c 100644
--- a/tests/queries/0_stateless/05333_lazy_load_tables_join_get.sql
+++ b/tests/queries/0_stateless/05333_lazy_load_tables_join_get.sql
@@ -22,8 +22,6 @@ SELECT joinGet(t_join, 'v', toUInt64(1));
SELECT number, joinGetOrNull(t_join, 'v', number) FROM numbers(4) ORDER BY number;
SELECT joinGet(t_log, 'v', toUInt64(1)); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
-SELECT name, engine FROM system.tables WHERE database = currentDatabase() ORDER BY name;
-
DROP TABLE t_join;
DROP TABLE t_log;
If this isn't the change you wanted, please describe the edit concretely and I'll retry. |
Test-only PR. Review: are the gaps real, is the test right.
Adds test coverage for 2 untested code paths, found during automated review of PR #121332.
That PR: (1) Replaces raw
dynamic_cast/typeid_castof catalog pointers withcastStorage<T>(ptr, DeferredTable::Load|Skip)/resolveStorageProxyLoadingat ~70 sites, addstryGetNestedoverrides, makesDistributed/Buffer/MaterializedPostgreSQL/Merge/Memoryeager inlazy_load_tables…1.
ATTACH/REPLACE PARTITION FROM: lazy and non-MergeTreesources untestedsrc/Storages/MergeTree/MergeTreeData.cpp:9590Risk:
runCommandSegments(InterpreterAlterQuery.cpp:408) ->MergeTreeData::alterPartition->REPLACE_PARTITION:resolveStorageProxyLoading+castStorage<MergeTreeData>(from_storage, DeferredTable::Load), refusal atMergeTreeData.cpp:9590when null. Risk: a revert to a raw cast makes every …Unique vs PR tests: PR tests cover
system.parts/system.replicaslistings (Skip),SYSTEM SYNC REPLICAand hypothetical indexes (Load). None runs a partition command on a lazily loaded table or with a non-MergeTreeFROMsource. The cases fit05233_lazy_load_tables_cast_storage.sql; kept standalone …Tags:
-- Tags: no-replicated-database—no-replicated-database: re-attaches anAtomicdatabase withlazy_load_tables, same as the PR's own 05233/052912.
joinGet(identifier, ...): lazyJointable and non-Joinrefusal untestedsrc/Analyzer/Resolve/resolveFunction.cpp:1539Risk:
QueryAnalyzer::resolveFunction(first argument is an identifier that is not a column) ->IdentifierResolver::tryResolveTableIdentifierFromDatabaseCatalog->castStorage<StorageJoin>(..., Load), refusal atresolveFunction.cpp:1539; the argument then becomes a constant andgetJoin…Unique vs PR tests: No PR test touches
Join/joinGet; the PR's tests coverMergeTree/ReplicatedMergeTreelistings,SYSTEM SYNC REPLICAand hypothetical indexes. Could also be appended to05233_lazy_load_tables_cast_storage.sql(needs ZooKeeper) or01141_join_get_negative.sql(refusal only).Tags:
-- Tags: no-replicated-database—no-replicated-database: re-attaches anAtomicdatabase withlazy_load_tables, same as the PR's own 05233/05291cc @evillique (author of #121332), @thevar1able (merged/approved #121332) — could you take a look, and add the
can be testedlabel if this looks good?Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not applicable — test-only change.
Documentation entry for user-facing changes
Workflow [PR]
Sync PR [sync-upstream/pr/124384]
Version info
26.11.1.139-master(included in26.11and later)