Merge branch 'master' of github.com:ClickHouse/ClickHouse into fix-crash-in-window-view

This commit is contained in:
Alexey Milovidov 2024-03-21 02:41:44 +01:00
commit ebd7e13eeb
12 changed files with 137 additions and 2 deletions

View File

@ -92,7 +92,9 @@ void writeQueryWithHighlightedErrorPositions(
}
else
{
size_t bytes_to_hilite = UTF8::seqLength(*current_position_to_hilite);
ssize_t bytes_to_hilite = UTF8::seqLength(*current_position_to_hilite);
if (bytes_to_hilite > end - current_position_to_hilite)
bytes_to_hilite = end - current_position_to_hilite;
/// Bright on red background.
out << "\033[41;1m";

View File

@ -21,7 +21,7 @@ $CLICKHOUSE_CLIENT -q "select number as x, number + 1 as y, concat('string: ', t
diff $non_parallel_file $parallel_file
echo -ne '{prefix} \n${data}\n $$ suffix $$\n${totals}\n${min}\n${max}\n${rows:Quoted}\n${rows_before_limit:Quoted}\n${rows_read:Quoted}\n${bytes_read:Quoted}\n' > $resultset_path
echo -ne '{prefix} \n${data}\n $$ suffix $$\n${totals}\n${min}\n${max}\n${rows:Quoted}\n${rows_before_limit:Quoted}\n' > $resultset_path
echo "Template-2"
$CLICKHOUSE_CLIENT -q "select number as x, number + 1 as y, concat('string: ', toString(number)) as s from numbers(200000) group by number with totals order by number limit 190000 format Template $TEMPLATE_SETTINGS" --output_format_parallel_formatting=0 --extremes=1 > $non_parallel_file

View File

@ -0,0 +1,11 @@
30 30 1970-01-01
30 1970-01-01 30 30 1970-01-01 -1980.1
30 1970-01-01 30 30 1970-01-01 -1980.1
30 1970-01-01 30 30 1970-01-01 -1980.1
30 1970-01-01 30 30 1970-01-01 -1980.1
30 1970-01-01 30 30 1970-01-01 -1980.1
30 1970-01-01 30 30 1970-01-01 -1980.1
30 1970-01-01 30 30 1970-01-01 -1980.1
30 1970-01-01 30 30 1970-01-01 -1980.1
30 1970-01-01 30 30 1970-01-01 -1980.1

View File

@ -0,0 +1,27 @@
-- https://github.com/ClickHouse/ClickHouse/issues/60317
SELECT
toNullable(materialize(_CAST(30, 'LowCardinality(UInt8)'))) as a,
_CAST(30, 'LowCardinality(UInt8)') as b,
makeDate(materialize(_CAST(30, 'LowCardinality(UInt8)')), 10, _CAST(30, 'Nullable(UInt8)')) as c
FROM system.one
GROUP BY
_CAST(30, 'Nullable(UInt8)')
SETTINGS allow_experimental_analyzer = 1;
-- WITH CUBE (note that result is different with the analyzer (analyzer is correct including all combinations)
SELECT
toNullable(toNullable(materialize(_CAST(30, 'LowCardinality(UInt8)')))) AS `toNullable(toNullable(materialize(toLowCardinality(30))))`,
_CAST(0, 'Date') AS `makeDate(-1980.1, -1980.1, 10)`,
_CAST(30, 'LowCardinality(UInt8)') AS `toLowCardinality(30)`,
30 AS `30`,
makeDate(materialize(_CAST(30, 'LowCardinality(UInt8)')), 10, _CAST(30, 'Nullable(UInt8)')) AS `makeDate(materialize(toLowCardinality(30)), 10, toNullable(toNullable(30)))`,
-1980.1 AS `-1980.1`
FROM system.one AS __table1
GROUP BY
_CAST(30, 'Nullable(UInt8)'),
-1980.1,
materialize(30),
_CAST(30, 'Nullable(UInt8)')
WITH CUBE
WITH TOTALS
SETTINGS allow_experimental_analyzer = 1;

View File

@ -0,0 +1,27 @@
#!/usr/bin/expect -f
set basedir [file dirname $argv0]
set basename [file tail $argv0]
exp_internal -f $env(CLICKHOUSE_TMP)/$basename.debuglog 0
set history_file $env(CLICKHOUSE_TMP)/$basename.history
log_user 0
set timeout 60
match_max 100000
expect_after {
# Do not ignore eof from expect
-i $any_spawn_id eof { exp_continue }
# A default timeout action is to do nothing, change it to fail
-i $any_spawn_id timeout { exit 1 }
}
spawn bash -c "source $basedir/../shell_config.sh ; \$CLICKHOUSE_CLIENT_BINARY \$CLICKHOUSE_CLIENT_OPT --disable_suggestion --history_file=$history_file"
expect ":) "
send -- "SELECT \x99\r"
expect "Syntax error"
send "exit\r"
expect eof

View File

@ -0,0 +1,9 @@
%W 2018-01-02 22:33:44 1
%W 2018-01-02 22:33:44 1
%W 2018-01-02 22:33:44 1
%W 2018-01-02 22:33:44 1
%W 2018-01-02 22:33:44 1
%W 2018-01-02 22:33:44 1
%W 2018-01-02 22:33:44 1
%W 2018-01-02 22:33:44 1
%W 2018-01-02 22:33:44 1

View File

@ -0,0 +1,23 @@
-- https://github.com/ClickHouse/ClickHouse/issues/60772
SELECT toFixedString(toFixedString(toFixedString(toFixedString(toFixedString(toFixedString('%W', 2), 2), 2),toLowCardinality(toLowCardinality(toNullable(2)))), 2), 2),
toFixedString(toFixedString('2018-01-02 22:33:44', 19), 19),
hasSubsequence(toNullable(materialize(toLowCardinality('garbage'))), 'gr')
GROUP BY
'2018-01-02 22:33:44',
toFixedString(toFixedString('2018-01-02 22:33:44', 19), 19),
'gr',
'2018-01-02 22:33:44'
SETTINGS allow_experimental_analyzer = 1;
-- WITH CUBE (note that result is different with the analyzer (analyzer is correct including all combinations)
SELECT
toFixedString(toFixedString(toFixedString(toFixedString(toFixedString(toFixedString('%W', 2), 2), 2), toLowCardinality(toLowCardinality(toNullable(2)))), 2), 2),
toFixedString(toFixedString('2018-01-02 22:33:44', 19), 19),
hasSubsequence(toNullable(materialize(toLowCardinality('garbage'))), 'gr')
GROUP BY
'2018-01-02 22:33:44',
toFixedString(toFixedString('2018-01-02 22:33:44', 19), 19),
'gr',
'2018-01-02 22:33:44'
WITH CUBE
SETTINGS allow_experimental_analyzer = 1;

View File

@ -0,0 +1 @@
\0\0\0 key="v" \0 key="v" key="v" key="v" key="v" \0 key="v"

View File

@ -0,0 +1,6 @@
SELECT
concat(concat(unhex('00'), concat(unhex('00'), concat(unhex(toFixedString('00', 2)), toFixedString(toFixedString(' key="v" ', 9), 9), concat(unhex('00'), toFixedString(' key="v" ', 9)), toFixedString(materialize(toLowCardinality(' key="v" ')), 9)), toFixedString(' key="v" ', 9)), toFixedString(' key="v" ', 9)), unhex('00'), ' key="v" ') AS haystack
GROUP BY
concat(unhex('00'), toFixedString(materialize(toFixedString(' key="v" ', 9)), 9), toFixedString(toFixedString('00', 2), toNullable(2)), toFixedString(toFixedString(toFixedString(' key="v" ', 9), 9), 9)),
concat(' key="v" ')
SETTINGS allow_experimental_analyzer = 1;

View File

@ -0,0 +1,4 @@
38 \N
38 \N
38 \N
38 \N

View File

@ -0,0 +1,25 @@
CREATE TABLE set_index_not__fuzz_0 (`name` String, `status` Enum8('alive' = 0, 'rip' = 1), INDEX idx_status status TYPE set(2) GRANULARITY 1)
ENGINE = MergeTree ORDER BY name
SETTINGS index_granularity = 8192;
INSERT INTO set_index_not__fuzz_0 SELECT * from generateRandom() limit 1;
SELECT
38,
concat(position(concat(concat(position(concat(toUInt256(3)), 'ca', 2), 3),NULLIF(1, materialize(toLowCardinality(1)))), toLowCardinality(toNullable('ca'))), concat(NULLIF(1, 1), concat(3), toNullable(3)))
FROM set_index_not__fuzz_0
GROUP BY
toNullable(3),
concat(concat(NULLIF(1, 1), toNullable(toNullable(3))))
SETTINGS allow_experimental_analyzer = 1;
-- WITH ROLLUP (note that result is different with the analyzer (analyzer is correct including all combinations)
SELECT
38,
concat(position(concat(concat(position(concat(toUInt256(3)), 'ca', 2), 3), NULLIF(1, materialize(toLowCardinality(1)))), toLowCardinality(toNullable('ca'))), concat(NULLIF(1, 1), concat(3), toNullable(3)))
FROM set_index_not__fuzz_0
GROUP BY
toNullable(3),
concat(concat(NULLIF(1, 1), toNullable(toNullable(3))))
WITH ROLLUP
SETTINGS allow_experimental_analyzer = 1;