❯ rg -zau '9f675133-0284-4399-b6cb-80ef02843aa2' clickhouse-server.log-21.zst
1291924:2023.09.26 13:36:43.995396 [ 64623 ] {9f675133-0284-4399-b6cb-80ef02843aa2} <Debug> executeQuery: (from [::1]:59130) (comment: 00385_storage_file_and_clickhouse-local_app_long.sh) CREATE TABLE buf_00385 ENGINE = Memory AS SELECT name, is_aggregate FROM system.functions (stage: Complete)
1291925:2023.09.26 13:36:43.995432 [ 64623 ] {9f675133-0284-4399-b6cb-80ef02843aa2} <Trace> ContextAccess (default): Access granted: CREATE TABLE ON test_gjpt75bh.buf_00385
1291926:2023.09.26 13:36:43.995603 [ 64623 ] {9f675133-0284-4399-b6cb-80ef02843aa2} <Trace> ContextAccess (default): Access granted: SELECT(name, is_aggregate) ON system.functions
1291927:2023.09.26 13:36:43.995655 [ 64623 ] {9f675133-0284-4399-b6cb-80ef02843aa2} <Debug> DatabaseReplicated (test_gjpt75bh): Proposing query: CREATE TABLE buf_00385 UUID 'ddb3bdc2-2e0e-4405-80ed-815de505d5ee' (`name` String, `is_aggregate` UInt8) ENGINE = Memory AS SELECT name, is_aggregate FROM system.functions
1291930:2023.09.26 13:36:43.997174 [ 64623 ] {9f675133-0284-4399-b6cb-80ef02843aa2} <Debug> DDLWorker(test_gjpt75bh): Waiting for worker thread to process all entries before query-0000000016
1291934:2023.09.26 13:36:43.997213 [ 64623 ] {9f675133-0284-4399-b6cb-80ef02843aa2} <Debug> DDLWorker(test_gjpt75bh): Processing task query-0000000016 (CREATE TABLE test_gjpt75bh.buf_00385 UUID 'ddb3bdc2-2e0e-4405-80ed-815de505d5ee' (`name` String, `is_aggregate` UInt8) ENGINE = Memory AS SELECT name, is_aggregate FROM system.functions)
1291936:2023.09.26 13:36:43.997506 [ 64623 ] {9f675133-0284-4399-b6cb-80ef02843aa2} <Debug> DDLWorker(test_gjpt75bh): Executing query: CREATE TABLE test_gjpt75bh.buf_00385 UUID 'ddb3bdc2-2e0e-4405-80ed-815de505d5ee' (`name` String, `is_aggregate` UInt8) ENGINE = Memory AS SELECT name, is_aggregate FROM system.functions
1291937:2023.09.26 13:36:43.997652 [ 64623 ] {9f675133-0284-4399-b6cb-80ef02843aa2} <Debug> executeQuery: (from 0.0.0.0:0, user: ) (comment: 00385_storage_file_and_clickhouse-local_app_long.sh) /* ddl_entry=query-0000000016 */ CREATE TABLE test_gjpt75bh.buf_00385 UUID 'ddb3bdc2-2e0e-4405-80ed-815de505d5ee' (`name` String, `is_aggregate` UInt8) ENGINE = Memory AS SELECT name, is_aggregate FROM system.functions (stage: Complete)
1291943:2023.09.26 13:36:44.010335 [ 64623 ] {9f675133-0284-4399-b6cb-80ef02843aa2} <Error> executeQuery: Code: 49. DB::Exception: No user in current context, it's a bug. (LOGICAL_ERROR) (version 23.9.1.1579) (from 0.0.0.0:0) (comment: 00385_storage_file_and_clickhouse-local_app_long.sh) (in query: /* ddl_entry=query-0000000016 */ CREATE TABLE test_gjpt75bh.buf_00385 UUID 'ddb3bdc2-2e0e-4405-80ed-815de505d5ee' (`name` String, `is_aggregate` UInt8) ENGINE = Memory AS SELECT name, is_aggregate FROM system.functions), Stack trace (when copying this message, always include the lines below):
1291978:2023.09.26 13:36:44.011305 [ 64623 ] {9f675133-0284-4399-b6cb-80ef02843aa2} <Error> executeQuery: Code: 49. DB::Exception: No user in current context, it's a bug. (LOGICAL_ERROR) (version 23.9.1.1579) (from [::1]:59130) (comment: 00385_storage_file_and_clickhouse-local_app_long.sh) (in query: CREATE TABLE buf_00385 ENGINE = Memory AS SELECT name, is_aggregate FROM system.functions), Stack trace (when copying this message, always include the lines below):
1292013:2023.09.26 13:36:44.011436 [ 64623 ] {9f675133-0284-4399-b6cb-80ef02843aa2} <Error> TCPHandler: Code: 49. DB::Exception: No user in current context, it's a bug. (LOGICAL_ERROR), Stack trace (when copying this message, always include the lines below):
1292048:2023.09.26 13:36:44.011478 [ 64623 ] {9f675133-0284-4399-b6cb-80ef02843aa2} <Debug> TCPHandler: Processed in 0.016412643 sec.
1292049:2023.09.26 13:36:44.011492 [ 64623 ] {9f675133-0284-4399-b6cb-80ef02843aa2} <Debug> MemoryTracker: Peak memory usage (for query): 2.03 MiB.
https://s3.amazonaws.com/clickhouse-test-reports/54905/595027b1c6497f0b4792818e6c1f5dc5c8f0c28c/stateless_tests__release__databasereplicated__[4_4].html
You’re totally right, it’s safe to skip isDeterministic. I meant that in general, it may be dangerous to skip some access checks when there’s no user
By skipping the check I meant not calling isDeterministic and just set to false for the 2 problematic functions so I don’t see any security issues here. Please correct me if I’m wrong. https://github.com/ClickHouse/ClickHouse/pull/56789
we can also leave it as NULL if user is not set, we just need to avoid creating those functions.