v.22.12upgrade-notes
Fixed Backward Incompatibility in (De)serialization of Aggregate Functions with String Argument in ClickHouse
Fixed backward incompatibility in (de)serialization of states ofmin,max,any*,argMin,argMaxaggregate functions withStringargument. The incompatibility affects 22.9, 22.10 and 22.11 branches (fixed since 22.9.6, 22.10.4 and 22.11.2 correspondingly). Some minor releases of 22.3, 22.7 and 22.8 branches are also affected: 22.3.13...22.3.14 (fixed since 22.3.15), 22.8.6...22.8.9 (fixed since 22.8.10), 22.7.6 and newer (will not be fixed in 22.7, we recommend upgrading from 22.7.* to 22.8.10 or newer). This release note does not concern users that have never used affected versions. Incompatible versions append an extra'\0'to strings when reading states of the aggregate functions mentioned above. For example, if an older version saved state ofanyState('foobar')tostate_columnthen the incompatible version will print'foobar\0'onanyMerge(state_column). Also incompatible versions write states of the aggregate functions without trailing'\0'. Newer versions (that have the fix) can correctly read data written by all versions including incompatible versions, except one corner case. If an incompatible version saved a state with a string that actually ends with null character, then newer version will trim trailing'\0'when reading state of affected aggregate function. For example, if an incompatible version saved state ofanyState('abrac\0dabra\0')tostate_columnthen newer versions will print'abrac\0dabra'onanyMerge(state_column). The issue also affects distributed queries when an incompatible version works in a cluster together with older or newer versions. #43038 (Alexander Tokmakov, Raúl Marín). Note: all the official ClickHouse builds already include the patches. This is not necessarily true for unofficial third-party builds that should be avoided.