This is an automated email from the ASF dual-hosted git repository.

yujun777 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new b527efd6e78 [fix](regression-test) Make test_analyze independent of 
the SQL cache (#68829)
b527efd6e78 is described below

commit b527efd6e78d8bac541ae4ac3560a199bef3cc17
Author: yujun <[email protected]>
AuthorDate: Fri Oct 9 21:37:31 2026 +0800

    [fix](regression-test) Make test_analyze independent of the SQL cache 
(#68829)
    
    `test_analyze` asserts that, after `DROP STATS tbl(col)` removes the
    column statistics, the next
    `SELECT * FROM tbl` throws because `forbid_unknown_col_stats` is on.
    
    That assertion is not deterministic: `DROP STATS` does not invalidate
    the SQL cache, and the
    statistics version is not part of the SQL cache key (the key is the SQL
    text plus the visible
    versions of the referenced tables, and `forbidUnknownColStats` is not
    declared as affecting the
    query result). So when an earlier `SELECT` of the same suite has been
    cached, the last `SELECT` is
    answered directly from the cache — `PhysicalPlanTranslator.translate()`
    never runs, and the
    `forbid_unknown_col_stats` guard is never evaluated.
    
    Whether a cache entry exists depends on
    `cache_last_version_interval_second` and on the age of the
    newly loaded data, which makes the case pass or fail depending on the
    surrounding suites. Setting
    `cache_last_version_interval_second` to a small value (the `sql_cache`
    suite does that with
    `ADMIN SET FRONTEND CONFIG`) reproduces the failure at `assert exception
    != null`.
---
 regression-test/suites/statistics/analyze_stats.groovy | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/regression-test/suites/statistics/analyze_stats.groovy 
b/regression-test/suites/statistics/analyze_stats.groovy
index c0eaff54e2b..8f8a05e65e1 100644
--- a/regression-test/suites/statistics/analyze_stats.groovy
+++ b/regression-test/suites/statistics/analyze_stats.groovy
@@ -120,6 +120,12 @@ suite("test_analyze") {
         SET forbid_unknown_col_stats=false;
     """
 
+    // DROP STATS does not invalidate the SQL cache and the stats version is 
not part of the cache
+    // key, so a cached SELECT is replayed without planning and 
forbid_unknown_col_stats never fires.
+    sql """
+        SET enable_sql_cache=false;
+    """
+
     sql """
         SELECT * FROM ${tbl}
     """


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to