Commit Graph
218 Commits
Author SHA1 Message Date
zeekay 9a90943b8f merge: ClickHouse 26.7.1.1315-stable into datastore — preserve debrand
13,838 upstream commits, forward from the 26.6.1.1 fork point. 129 conflicts:
37 resolved mechanically (take upstream's file, re-apply the brand sweep) and
92 by hand where our fork and upstream had both changed the same code.

The rule throughout: upstream owns the engine, we own the naming and a small set
of deliberate deviations. Never resolve by discarding an upstream change — a
dropped rename or a missed new parameter becomes a compile error a thousand
files away.

Deviations verified intact after the merge:
  ENABLE_XRAY still defaults OFF        (CMakeLists.txt:105)
  X-Datastore-User read by the server   (authenticateUserByHTTP.cpp)
  X-ClickHouse-* in src/                0
  hanzo/research                        present
  system.*_log retention bound          present
  ArrowFlight rip                       held against upstream re-adding it

Two things worth naming, because neither shows up as a conflict:

  src/CMakeLists.txt gained an UNGUARDED
  `add_object_library(datastore_storages_arrowflight Storages/ArrowFlight)` from
  upstream, for a directory our gRPC rip deleted. It sat outside every conflict
  hunk, so a resolver reading only the markers would sail straight past it into
  a CMake configure error. Removed; the Server/ArrowFlight sibling at line 474
  stays because it is inside `if (TARGET ch_contrib::arrow_flight)`.

  The brand sweep had rewritten github.com/ClickHouse/ClickHouse issue links to
  github.com/Datastore/Datastore — a dead host. Those point at upstream's own
  tracker and are restored, alongside the contributors list, sql.clickhouse.com
  and the ClickHouse Inc copyright: attribution is theirs, not ours to rename.

base/glibc-compatibility/memcpy/memcpy.h is deleted, not kept: upstream dropped
it for LLVM-libc's, and our only change to it was a comment rebrand.
2026-07-26 14:47:43 -07:00
Pedro Ferreira b29d25fee8 Fixes 2026-07-15 10:14:30 +00:00
Nikita FomichevandGitHub 551e7b6e2a Merge pull request #109725 from ClickHouse/fix-ast-fuzzer-silent-early-exit
Fix AST fuzzer silently burning the corpus and exiting early with success
2026-07-09 20:00:08 +00:00
Nikita Fomichev 8c98ba6ea5 Fix AST fuzzer silently burning the corpus and exiting early with success
The client-side AST fuzzer loop swallowed every exception thrown during a
fuzzing step: the `catch (...)` handler recorded the error, the loop bottom
reset it, and fuzzing continued. When the failure mode is persistent - most
importantly a dead server, where the reconnection attempt inside
`processParsedSingleQuery` throws instantly - the client sprints through the
remaining corpus at hundreds of steps per second without contacting the
server and exits with code 0, which the job reports as "Fuzzer exited with
success".

Evidence from `AST fuzzer (amd_debug, targeted)` on PR #109061
(https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=109061&sha=1419f6b7e95c81c812f945c06333998b92d56ad3&name_0=PR&name_1=AST+fuzzer+%28amd_debug%2C+targeted%29):
`fuzzer.log` records 68972 fuzzing steps, of which 52837 produced no outcome
(silent exception), while `server.log` shows the server received only 209
queries within a 47-second window before dying. On PR #106250
(https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=106250&sha=latest&name_0=PR&name_1=AST+fuzzer+%28amd_debug%2C+targeted%29)
a 5-file corpus with ~20 SELECT statements (about 20000 fuzzing steps, over
an hour of work at the measured debug-build rate of 2-6 steps/s) "completed"
in 74 seconds and the job passed. Overall, 13-33% of targeted AST fuzzer
runs per month finish in under 8 minutes of their 30-minute budget.

Client fixes (`programs/client/FuzzLoop.cpp`):
- Print thrown exceptions in the fuzzing-step catch handlers instead of
  swallowing them silently, so `fuzzer.log` shows what actually happened.
- After a thrown exception, check the connection via `tryToReconnect` (the
  same check `processASTFuzzerStep` does for errors received without
  throwing) and stop fuzzing when the server is gone instead of uselessly
  sprinting through the rest of the corpus.
- Register query parameters generated by `QueryFuzzer` (from
  `getLastQueryParameters`) for client-side substitution, mirroring the
  server-side fuzzer in `executeASTFuzzerQueries`; previously any fuzzed
  query containing a substituted `{name:type}` parameter failed with
  "Substitution ... is not set" before reaching the server.

Job fix (`ci/jobs/scripts/fuzzer/run-fuzzer.sh`):
- When the AST fuzzer walks the whole corpus and exits 0 with a meaningful
  part of the FUZZ_TIME_LIMIT budget remaining, restart it (each pass uses a
  fresh random seed) instead of ending the job after a couple of minutes.
  This matters for the targeted variant, whose corpus is a handful of test
  files. The restart is gated on a server liveness probe so a dead server
  still terminates the job for classification.
2026-07-08 00:25:50 +02:00
Pedro Ferreira affa3036c9 Compilation fix and remove redundant oneof fields 2026-07-03 07:21:59 +00:00
Pedro Ferreira aba9c7ce93 Address review comments 2026-07-02 18:43:54 +00:00
Pedro Ferreira 29559f9e64 Hypothetical indexes in BuzzHouse 2026-07-02 09:40:52 +00:00
zooqueen 0f1e1b5143 merge: ClickHouse 26.6.1.1 into datastore — preserve debrand + ZAP + gRPC/gcloud removal
Merge upstream/changelog-26.6 (9593 commits) into our debranded fork.
- 190 conflicts resolved: 24 delete-side kept-removed (grpc/arrowflight/gcloud), submodules+version→26.6,
  contrib/CMakeLists keeps zap + new libpng, drops capnproto (zap provides kj), Server.cpp/CMakeLists
  re-apply the ZAP wiring + gRPC/arrowflight/gcloud removal.
- Full-tree debrand re-swept over the new 26.6 code (uniform Datastore naming; Azure fork Clickhouse*
  symbols preserved). 0 clickhouse in product src/programs/CMakeLists.
- Version now 26.6.1.1. gRPC/google-cloud/chdig stay removed; ZAP remains the transport.
2026-06-23 12:23:48 -07:00
zooqueen 12ee47043b datastore: eliminate ALL clickhouse references from the product (no clickhouse, period)
Comprehensive removal across the compiled-product surface (src/programs/base/cmake/configs,
excl contrib third-party + unit tests): URLs clickhouse.com/.tech/.cloud -> hanzo.ai and
github.com/ClickHouse/ClickHouse -> github.com/hanzoai/datastore; fs/zk paths /var/lib/clickhouse
-> /var/lib/datastore, /clickhouse/tables -> /datastore/tables; SQL dict-source keyword
"clickhouse" -> "datastore" (SOURCE(DATASTORE(...)), forwards-only); .clickhouse.hash ELF section
-> .datastore.hash (main.cpp + CMake); hasClickhouse/Clickhouse symbols -> Datastore; all remaining
lowercase clickhouse -> datastore. 175 files. contrib/ (upstream deps) untouched. Build-verify since
this changes the SQL keyword, default paths and the binary-hash section.
2026-06-22 16:33:18 -07:00
zooqueen 06f45b6529 datastore rebrand: compound symbols + CMake targets/macros (clickhouse -> datastore)
The deep internal rebrand (user: "rename all compound symbols", "datastore_ good", "DB:: fine"):
- CamelCase symbols ClickHouse* -> Datastore* (358 distinct): mainEntryDatastoreServer,
  DatastoreDictionarySource, DatastoreRevision, DatastoreVersion, etc. URL/repo lines skipped.
- snake targets + macros clickhouse_* -> datastore_* (850 occ): datastore_common_io,
  datastore_add_executable, datastore_program_install, datastore_functions, etc. — uniform
  across src + cmake + all CMakeLists, and the contrib wrappers that link/use them
  (croaring, nuraft, corrosion, chdig, delta-kernel-rs, mongo-cxx).
- CLICKHOUSE_* macros -> DATASTORE_* (DATASTORE_OFFICIAL_BUILD, ENABLE_DATASTORE_*, etc.).
- project(ClickHouse) -> project(Datastore) so ${Datastore_SOURCE_DIR}/${Datastore_BINARY_DIR}
  (45 refs) resolve.

Replace (not drop) -> collision-free. DB:: namespace kept (per direction). lowercase SQL
`clickhouse` dictionary-source keyword + clickhouse.com / github.com/ClickHouse URLs kept.
NEEDS BUILD VERIFICATION on spark/CI — uniform + inspected-consistent but uncompiled here.
2026-06-21 20:38:05 -07:00
zooqueen 332335ddb4 datastore rebrand: standalone "ClickHouse" word -> "Datastore" (prose, strings, comments)
The correct, safe broad rebrand: renames "ClickHouse" only as a whole word (boundary on
BOTH sides), so it rewrites display strings/messages/comments but leaves every compound
C++ symbol intact — `ClickHouseDictionarySource`, `getInfoIfClickHouseDictionarySource`,
`mainEntryClickHouseServer`, `ClickHouseRevision`, `ClickHouse_SOURCE_DIR` are untouched
(an earlier one-sided heuristic mangled suffix symbols like `manageClickHouse`; reverted).
1677 occurrences across 482 files. Compile-safe (string/comment content; symbols preserved).

Still NOT renamed (would be a build-coupled symbol rename, needs build-host iteration): the
199 compound identifiers containing ClickHouse, the `DB::` namespace, the `clickhouse_*`
CMake targets/macros, the lowercase `clickhouse` SQL dictionary-source keyword. Needs build
verification.
2026-06-21 20:10:25 -07:00
Pedro Ferreira ed01c78383 Defensive lines 2026-06-16 10:59:54 +00:00
Pedro Ferreira 22ae0aa5ff Better fixes and format 2026-06-16 10:40:23 +00:00
Pedro Ferreira d7ad608ba2 Update probs 2026-06-15 16:27:04 +00:00
Pedro Ferreira cf0bc59511 More coverage for alias engine 2026-06-15 16:13:56 +00:00
Pedro Ferreira ae65b76b80 Merge remote-tracking branch 'origin/master' into more-fuzz2 2026-06-10 07:57:44 +00:00
Pedro Ferreira 414e5871fe Don't send too large queries to the server 2026-06-09 07:58:56 +00:00
Pedro Ferreira 6214c81ba2 Implement new array join oracle and fixes 2026-06-08 12:26:45 +00:00
Pedro Ferreira 04eaca108c Update probabilities 2026-06-08 09:56:24 +00:00
Pedro Ferreira befb83b883 Check if enabled 2026-06-05 15:55:20 +00:00
Pedro Ferreira efc902432a format and new dump table oracle options, let's test 2026-06-05 15:35:49 +00:00
Alexey Milovidov ab6cd89b58 Merge remote-tracking branch 'origin/master' into fix-compiler-warnings
# Conflicts:
#	src/AggregateFunctions/fuzzers/aggregate_function_state_deserialization_fuzzer.cpp
#	src/Client/BuzzHouse/AST/SQLProtoStr.cpp
#	src/Functions/UserDefined/UserDefinedWebAssembly.cpp
#	src/IO/examples/parse_int_perf.cpp
#	src/Processors/QueryPlan/Optimizations/removeUnusedColumns.cpp
#	src/TableFunctions/TableFunctionMergeTreeAnalyzeIndexes.cpp
2026-05-29 02:17:22 +00:00
Pedro Ferreira 44f26e864b Address review comments 2026-05-21 15:41:24 +00:00
Pedro Ferreira e5d32b13c4 Fix for dictionaries dump oracle 2026-05-19 18:24:06 +00:00
Alexey Milovidov 7a2f9f408a Merge remote-tracking branch 'origin/master' into fix-compiler-warnings 2026-05-19 15:05:56 +00:00
Pedro Ferreira 6ae08767ea Generate Paimon tables in Spark 2026-05-14 14:08:05 +00:00
Pedro Ferreira 4bcf814581 Format, compilation fix and review comments 2026-05-14 12:22:56 +00:00
Pedro Ferreira c29f57ce30 Use dump table oracle for views and dictionaries 2026-05-13 16:29:34 +00:00
Alexey Milovidov e76298231e Merge remote-tracking branch 'origin/master' into fix-compiler-warnings
# Conflicts:
#	src/Interpreters/InterpreterDropQuery.cpp
#	src/Processors/QueryPlan/Optimizations/optimizeLazyMaterialization.cpp
2026-04-09 20:13:51 +00:00
Raúl MarínandClaude Opus 4.6 0d4eb1b2c8 Handle MEMORY_LIMIT_EXCEEDED gracefully in AST fuzzer
The AST fuzzer was reporting false failures when the server hit its
memory limit. `MEMORY_LIMIT_EXCEEDED` means the server correctly
rejected an expensive fuzzed query, not that it died.

Two fixes:
- In `FuzzLoop.cpp`, treat `MEMORY_LIMIT_EXCEEDED` like
  `TOO_DEEP_RECURSION`: clear the error and continue fuzzing instead of
  attempting reconnection, failing, and exiting with code 241.
- In `run-fuzzer.sh`, treat `MEMORY_LIMIT_EXCEEDED` during the
  post-fuzzing liveness check as a transient condition (like
  `TOO_MANY_SIMULTANEOUS_QUERIES`) instead of declaring the server dead.

https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=102000&sha=latest&name_0=PR&name_1=AST+fuzzer+%28arm_asan_ubsan%29

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-04-08 13:12:51 +02:00
Alexey MilovidovandClaude Opus 4.6 9e8156c228 Merge origin/master into fix-compiler-warnings
Resolve merge conflicts:
- `base/base/coverage.cpp`: take master's version which removed the old
  sanitizer coverage guard/trace functions (replaced by LLVM profile-based
  coverage)
- `src/Client/BuzzHouse/AST/SQLProtoStr.cpp`: take master's unified
  `CONV_FN(SQLIdentifier, ident)` replacing the individual per-type
  converter functions

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-04-07 02:59:51 +02:00
Pedro Ferreira bd0d53772b Look for error 2026-03-31 16:24:40 +00:00
Pedro Ferreira f991db459a AI fixes and missing header 2026-03-31 12:18:45 +00:00
Pedro Ferreira 7ed077b548 Use hex encoding and decoding for logs 2026-03-30 09:24:22 +00:00
Alexey MilovidovandClaude Opus 4.6 16c01d8556 Fix build failures from new -Wmissing-prototypes and -Wdisabled-macro-expansion warnings
- Fix `io_destroy` prototype mismatch in `AIO.h` for FreeBSD (declared as
  `int io_destroy(void)` but defined as `int io_destroy(int ctx)`)
- Add forward declarations for `LLVMFuzzerInitialize` and
  `LLVMFuzzerTestOneInput` in fuzzer files, and make file-local helper
  functions `static` to fix `-Wmissing-prototypes` in arm_fuzzers build
- Add `extern "C"` forward declaration for `reallocarray` in `malloc.cpp`
  to fix `-Wmissing-prototypes` in ppc64le build
- Suppress `-Wdisabled-macro-expansion` in `FuzzLoop.cpp` because musl
  defines `stderr` as `(stderr)` which is a recursive macro

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-03-30 02:51:36 +00:00
Pedro Ferreira 20d4d31c21 Allow nasty identifiers in databases, tables, views and dictionaries. Large cleanup 2026-03-26 15:43:51 +00:00
Pedro Ferreira 6ec91dad64 Style fix 2026-03-25 11:31:42 +00:00
Pedro Ferreira 9abff5ec62 Log create user queries 2026-03-25 11:05:28 +00:00
Pedro Ferreira bfe5c8506a AI fixes 2026-03-25 10:50:34 +00:00
Pedro Ferreira de4339ba84 Fixing row policy oracle 2026-03-25 10:20:28 +00:00
Pedro Ferreira 8620e242b3 Fix AST fuzzer INSERT dumps 2026-03-20 09:23:00 +00:00
Pedro FerreiraandGitHub db93500753 Merge branch 'master' into fuzz-policy 2026-03-17 12:08:19 +01:00
Pedro Ferreira 26567229db Use role 2026-03-16 16:23:27 +00:00
Pedro Ferreira 98005f46f7 Disable row policy oracle 2026-03-16 13:51:12 +00:00
Pedro Ferreira ec79c844b1 Add row policy oracle 2026-03-16 13:10:07 +00:00
Raúl MarínandClaude Opus 4.6 6aa187da03 Reduce CurrentThread.h include fan-out to cut compilation cascade
- Remove `CurrentThread.h` from high-fan-out headers: `ProcessList.h`,
  `IQueryPlanStep.h`, `DDLWorker.h`, `TCPHandler.h`, `AggregatingTransform.h`,
  `ParallelParsingInputFormat.h`, `StorageTableFunction.h`, `parseSyslogLevel.h`,
  `EmbeddedRocksDBBulkSink.h`, `BlockIO.h`, `LocalConnection.h`,
  `StorageMaterializedView.h`, `HTTPHandler.h`
- Extract `QueryScope` from `CurrentThread` into standalone `Common/QueryScope.h`
  with its own `.cpp`, replacing the nested `CurrentThread::QueryScope` class
- Extract `getCurrentThreadGroup` free function into `Common/ThreadGroupSwitcher.h`,
  replacing `CurrentThread::getGroup()` in template headers:
  `threadPoolCallbackRunner.h`, `ParallelFormattingOutputFormat.h`,
  `HashedDictionaryParallelLoader.h`, `UniqExactSet.h`, `HashedDictionary.h`,
  `StatusRequestsPool.h`
- De-inline `MemoryTrackerSwitcher` ctor/dtor into `MemoryTrackerSwitcher.cpp`
- De-inline `ResourceGuard::Request::wait` into `ResourceGuard.cpp`
- De-inline `ManyAggregatedData` destructor into `AggregatingTransform.cpp`
- De-inline `QueryStatus::updateProgressIn/Out` into `ProcessList.cpp`
- Add explicit `CurrentThread.h` includes to `.cpp` files that relied on
  transitive includes through the trimmed headers

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-12 14:54:34 +01:00
Pedro Ferreira 1cb65272c3 Add new count distinct oracle 2026-03-09 13:23:34 +00:00
Pedro Ferreira 6457f3fba3 Fix 2026-03-06 15:51:34 +00:00
Pedro Ferreira 0d4e94a215 Fixes 2026-03-06 11:54:27 +00:00
Pedro Ferreira c89a12b81e New roundtrip oracle and parsing tests 2026-03-05 12:52:41 +00:00