Repository navigation
Backport #130192 to 26.3: Keep the NULL partition in Delta Lake partition pruning when the filter's set holds NULL - #130717
robot-ch-test-poll3 wants to merge 215 commits into
Conversation
…r a `map` with an unsupported value
…ode to CR, LF or NUL
… map with a nil or empty key
…acement access entities
Backport #127318 to 26.3: Distrust the compromised eMudhra certificates
Backport #127281 to 26.3: Fix crash in MsgPack schema inference for a map with a nil or empty key
Backport #126906 to 26.3: Fix abort in `Protobuf` schema inference for a `map` with an unsupported value
Backport #125497 to 26.3: Reject HTTP header values that RFC 2047-decode to CR, LF or NUL
…TE TABLE` without column definitions
Backport #126905 to 26.3: Fix segfault in `MySQLDump` format on `CREATE TABLE` without column definitions
Backport #127136 to 26.3: Require drop privileges when restoring replacement access entities
…ction` in `RawBLOB` output
Backport #127288 to 26.3: Write the serialized state of `AggregateFunction` in `RawBLOB` output
…ariants on empty block after insert deduplication
… exception on INSERT and merge
Backport #127286 to 26.3: Reject too deep cursors instead of exhausting the stack
Backport #105578 to 26.3: Fix TTL expressions with subcolumns causing exception on INSERT and merge
Backport #127439 to 26.3: Fix `LOGICAL_ERROR` in ReplacingMergeTree variants on empty block after insert deduplication
Backport #127419 to 26.3: Bump `brotli` from v1.2.0 to v1.2.1
…of the password when the TOTP code is missing
…calar overriding a policy's scalar subquery
Backport #125823 to 26.3: Return `REQUIRED_SECOND_FACTOR` regardless of the password when the TOTP code is missing
…lacePartitionFrom to fix race"
…urrent embedded client sessions
Backport #130323 to 26.3: Bump `mongo-c-driver` from 2.5.7 to 2.5.8
Backport #124553 to 26.3: Group PREWHERE read steps by exact columns and rewrite `m['key']` to a key subcolumn only for bucketed `Map`
Backport #130517 to 26.3: Fix crash in log file rotation when the process has no free file descriptors
… can run 26.3's KeyDescription::getKeyFromAST takes no `virtuals` argument (#102827 is not on 26.3), so drop the `{}` the cherry-pick carried. The test built its Delta tables with INSERT INTO FUNCTION deltaLakeLocal under allow_delta_lake_writes. On 26.3 that setting is still called allow_experimental_delta_lake_writes, and a partitioned INSERT of a NULL value fails with NOT_IMPLEMENTED (#111793 is not on 26.3). Write the same tables by hand instead, as 26.3's 05237 test does: Parquet data files through file() and one add action per file, a NULL partition value committed as a JSON null under __HIVE_DEFAULT_PARTITION__. Two cases fail on 26.3 with and without this change, so they are dropped: `ifNull(p, 0) IN (0)` prunes the NULL partition (a MergeTree table partitioned by the same Nullable column returns the same wrong rows on 26.3), and `has([NULL, 'a'], s)` throws CANNOT_INSERT_NULL_IN_ORDINARY_COLUMN (#115647 is not on 26.3). On 26.3 the fix keeps the NULL partition's file for `has([5, 7], p)`, so that case prunes 1 file instead of 2 (rows unchanged): 26.3 builds no set index for a UInt8 array over a Nullable(Int64) key; 26.3's MergeTree partition pruning does not use that predicate on a Nullable key either. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The build fails in A one-commit fix (a fast-forward of Checked on a 26.3 debug build (clang-21): it compiles, the test passes (100 of 100 runs), and with |
timezoneOffset did not read the offset, it reconstructed it from the
distance between two start-of-day timestamps:
res = (lut[index].date - lut[epoch].date) % 86400;
res = res > 43200 ? (86400 - res) : (0 - res);
return res + offset_at_start_of_epoch;
lut[i].date is the UTC instant of local midnight of day i, so the
difference of two such instants is days * 86400 - (offset_now -
offset_epoch). Taking it modulo 86400 keeps only the sub-day part of the
offset change since the epoch and discards any whole-day part, which the
added offset_at_start_of_epoch cannot restore. The zones that
permanently shifted their offset by 24 hours when they crossed the
international date line therefore stayed pinned at their pre-jump
offset, which is why each of them reported correctly before its jump and
wrongly after it.
The wrap on the second line also handles only one sign. In C++ the
remainder takes the sign of the dividend, so for a day before the epoch
res is negative, the res > 43200 test can never fire, and 0 - res yields
a value near +86400 rather than a small negative offset. That is a
second, independent defect affecting most zones at pre-1970 instants,
not just the seven date-line ones from the report.
Compute the offset directly instead. The UTC offset at local midnight of
a day is day_number * 86400 - lut[index].date, since local midnight is
that many seconds of local time from the epoch while date is the UTC
instant of the same midnight. This is exact for either sign and any
magnitude, needs no modulo and no wrap branches. The existing correction
for an offset change later in the same day is kept as it was, and
offset_at_start_of_epoch is no longer added here because the new base
term is absolute rather than epoch-relative. The member itself stays, it
still has other users.
Measured over all 597 rows of system.time_zones at 14 instants spanning
1900 to 2300, against Python zoneinfo as an independent oracle, wrong
samples drop from 500 across 307 zones to 18, and each of those 18 is a
tzdata version difference between the bundled 2025a and the system
2026a. Every one of the 488 samples this changes differs by exactly one
day, so nothing sub-day moved and no previously correct sample
regressed.
The same offset feeds parseDateTime and its OrNull, OrZero, 64 and Joda
variants, a zone named inside a Joda format string,
EXTRACT(TIMEZONE_HOUR / TIMEZONE_MINUTE ...), the %z specifier of
formatDateTime, and toUTCTimestamp / fromUTCTimestamp, all of which were
wrong by a day on the affected zones and are fixed here. The remaining
consumers reduce the offset modulo a day, so an exact one-day error
already cancelled for them; they were correct before and remain so, and
the test pins them as controls.
Reported by PedroTadim.
Closes #115281.
(cherry picked from commit c35cc8b)
`toTime` is the legacy function by default here, and \`EXTRACT(TIMEZONE_HOUR ...)\` is not supported. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d file, test from 1900 On this branch `DateLUT` loads zones that are not embedded (`libc:` names, the host database), so the ORC reader and writer threw `LOGICAL_ERROR` for them. `DateTime64` starts at 1900 here, so the test uses values between 1900 and the first transition, and checks the day shift fixed by #115332. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Backport #130311 to 26.3: Bump vendored `expat` from 2.9.0 to 2.10.0
Backport #130354 to 26.3: Fix ORC `TIMESTAMP` values before the first time zone transition
…t struct has none of the requested fields
…in YAMLRegExpTree error
Backport #130279 to 26.3: Fix reading ORC lists and maps whose element struct has none of the requested fields
Backport #128978 to 26.3: Do not echo dictionary source file content in YAMLRegExpTree error
…a NULL-handling function to a `Nullable` partition key
…sages parsed before authentication
… NULL for it Port of #124041, a prerequisite of #121154 on this branch: when a link of the monotonic chain turns a non-NULL bound into NULL, the bound has no position in the `Range` order, so the range is left unanalyzed instead of compared. Without it the `NOT (coalesce(nullIf(c0, 5), 0) = 1)` case of `05233_assume_not_null_nullable_partition_key_pruning` still prunes the partition of 5 (4 rows expected, 3 returned), as seen on the 26.9 backport. #124041 is written against the try/catch chain loop of #117355, which this branch does not have, so this applies only its check to the branch's loop. #130788 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The backport of #111604 used `ColumnConstPtr` and the three-argument `ActionsDAG::addColumn(column, type, name)` overload, neither of which exists in 26.3. Build failed with: error: unknown type name 'ColumnConstPtr' error: no viable conversion from 'ColumnPtr' to 'ColumnConst' Rewrite the NULL-mask mapping to build a `ColumnWithTypeAndName` and call the single-argument `addColumn`, matching the adjacent `else` branch in the same function. Build log: https://s3.amazonaws.com/clickhouse-test-reports/PRs/130735/4dc280f0a6520269e1bc114481c6d319f80319d4/build_amd_debug/build_clickhouse/build_clickhouse.log
Backport #121154 to 26.3: Fix wrong results when a predicate applies a NULL-handling function to a `Nullable` partition key
Backport #130462 to 26.3: Bound the declared length of PostgreSQL messages parsed before authentication
Backport #111604 to 26.3: Set skip index: route NULL-constant atoms to UNKNOWN so granules are not wrongly pruned
|
🕵 Thanks @groeneai: I applied your fix (25da41d) as a fast-forward and merged the latest |
The `26.3` branch history was rewritten, so the previously merged `26.3` commits are no longer its ancestors. Conflicts in `src/Core/Field.cpp` and `src/Interpreters/InterpreterCreateQuery.cpp` (files this PR does not touch) are resolved by taking the `26.3` version; the result differs from `26.3` only in this backport's four files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…prunes no file On 26.3 the Nullable key condition does not prove that this predicate is false for the `NULL` partition, so the partition pruner keeps its file and prunes 0 files instead of 1. The rows are the same; keeping a file is the conservative outcome. Reproduced with the `build_arm_release` binary of this PR (26.3.61.91); the other cases match the reference. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=130717&sha=a3a2d22f6027fc8c95c20735d2a9c17fa472b7a0&name_0=BackportPR&name_1=Stateless%20tests%20%28amd_asan%2C%20distributed%20plan%2C%20parallel%2C%202%2F2%29 PR: #130717 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🕵 Superseded by #131851. The |
Original pull-request #130192
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