mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 00:52:02 +00:00
Merge remote-tracking branch 'origin/master' into fix-coverage
This commit is contained in:
commit
fd430585e1
@ -127,9 +127,6 @@ function setup_logs_replication
|
|||||||
echo 'Create all configured system logs'
|
echo 'Create all configured system logs'
|
||||||
clickhouse-client --query "SYSTEM FLUSH LOGS"
|
clickhouse-client --query "SYSTEM FLUSH LOGS"
|
||||||
|
|
||||||
# It's doesn't make sense to try creating tables if SYNC fails
|
|
||||||
echo "SYSTEM SYNC DATABASE REPLICA default" | clickhouse-client "${CONNECTION_ARGS[@]}" || return 0
|
|
||||||
|
|
||||||
debug_or_sanitizer_build=$(clickhouse-client -q "WITH ((SELECT value FROM system.build_options WHERE name='BUILD_TYPE') AS build, (SELECT value FROM system.build_options WHERE name='CXX_FLAGS') as flags) SELECT build='Debug' OR flags LIKE '%fsanitize%'")
|
debug_or_sanitizer_build=$(clickhouse-client -q "WITH ((SELECT value FROM system.build_options WHERE name='BUILD_TYPE') AS build, (SELECT value FROM system.build_options WHERE name='CXX_FLAGS') as flags) SELECT build='Debug' OR flags LIKE '%fsanitize%'")
|
||||||
echo "Build is debug or sanitizer: $debug_or_sanitizer_build"
|
echo "Build is debug or sanitizer: $debug_or_sanitizer_build"
|
||||||
|
|
||||||
|
@ -1522,9 +1522,16 @@ void executeQuery(
|
|||||||
if (output_format)
|
if (output_format)
|
||||||
handle_exception_in_output_format(*output_format, format_name, context, output_format_settings);
|
handle_exception_in_output_format(*output_format, format_name, context, output_format_settings);
|
||||||
}
|
}
|
||||||
|
/// The timezone was already set before query was processed,
|
||||||
|
/// But `session_timezone` setting could be modified in the query itself, so we update the value.
|
||||||
|
result_details.timezone = DateLUT::instance().getTimeZone();
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The timezone was already set before query was processed,
|
||||||
|
/// But `session_timezone` setting could be modified in the query itself, so we update the value.
|
||||||
|
result_details.timezone = DateLUT::instance().getTimeZone();
|
||||||
|
|
||||||
auto & pipeline = streams.pipeline;
|
auto & pipeline = streams.pipeline;
|
||||||
|
|
||||||
std::unique_ptr<WriteBuffer> compressed_buffer;
|
std::unique_ptr<WriteBuffer> compressed_buffer;
|
||||||
|
@ -7300,11 +7300,20 @@ void MergeTreeData::reportBrokenPart(MergeTreeData::DataPartPtr data_part) const
|
|||||||
broken_part_callback(part->name);
|
broken_part_callback(part->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (data_part->getState() == MergeTreeDataPartState::Active)
|
else
|
||||||
|
{
|
||||||
|
MergeTreeDataPartState state = MergeTreeDataPartState::Temporary;
|
||||||
|
{
|
||||||
|
auto lock = lockParts();
|
||||||
|
state = data_part->getState();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state == MergeTreeDataPartState::Active)
|
||||||
broken_part_callback(data_part->name);
|
broken_part_callback(data_part->name);
|
||||||
else
|
else
|
||||||
LOG_DEBUG(log, "Will not check potentially broken part {} because it's not active", data_part->getNameWithState());
|
LOG_DEBUG(log, "Will not check potentially broken part {} because it's not active", data_part->getNameWithState());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MergeTreeData::MatcherFn MergeTreeData::getPartitionMatcher(const ASTPtr & partition_ast, ContextPtr local_context) const
|
MergeTreeData::MatcherFn MergeTreeData::getPartitionMatcher(const ASTPtr & partition_ast, ContextPtr local_context) const
|
||||||
{
|
{
|
||||||
|
@ -19,3 +19,9 @@
|
|||||||
< Content-Type: application/octet-stream
|
< Content-Type: application/octet-stream
|
||||||
< X-ClickHouse-Format: RowBinary
|
< X-ClickHouse-Format: RowBinary
|
||||||
< X-ClickHouse-Timezone: CLICKHOUSE_TIMEZONE
|
< X-ClickHouse-Timezone: CLICKHOUSE_TIMEZONE
|
||||||
|
< X-ClickHouse-Timezone: Europe/Berlin
|
||||||
|
< X-ClickHouse-Timezone: Africa/Cairo
|
||||||
|
< X-ClickHouse-Timezone: Europe/Berlin
|
||||||
|
< X-ClickHouse-Timezone: America/Denver
|
||||||
|
< X-ClickHouse-Timezone: Europe/Lisbon
|
||||||
|
< X-ClickHouse-Timezone: Europe/Lisbon
|
||||||
|
@ -13,3 +13,16 @@ ${CLICKHOUSE_CURL} -vsS "${CLICKHOUSE_URL}" --data-binary @- <<< "SELECT 1 FORMA
|
|||||||
${CLICKHOUSE_CURL} -vsS "${CLICKHOUSE_URL}" --data-binary @- <<< "SELECT 1 FORMAT Vertical" 2>&1 | grep -e '< Content-Type' -e '< X-ClickHouse-Format' -e '< X-ClickHouse-Timezone' | sed "s|$CLICKHOUSE_TIMEZONE_ESCAPED|CLICKHOUSE_TIMEZONE|" | sed 's/\r$//' | sort;
|
${CLICKHOUSE_CURL} -vsS "${CLICKHOUSE_URL}" --data-binary @- <<< "SELECT 1 FORMAT Vertical" 2>&1 | grep -e '< Content-Type' -e '< X-ClickHouse-Format' -e '< X-ClickHouse-Timezone' | sed "s|$CLICKHOUSE_TIMEZONE_ESCAPED|CLICKHOUSE_TIMEZONE|" | sed 's/\r$//' | sort;
|
||||||
${CLICKHOUSE_CURL} -vsS "${CLICKHOUSE_URL}" --data-binary @- <<< "SELECT 1 FORMAT Native" 2>&1 | grep -e '< Content-Type' -e '< X-ClickHouse-Format' -e '< X-ClickHouse-Timezone' | sed "s|$CLICKHOUSE_TIMEZONE_ESCAPED|CLICKHOUSE_TIMEZONE|" | sed 's/\r$//' | sort;
|
${CLICKHOUSE_CURL} -vsS "${CLICKHOUSE_URL}" --data-binary @- <<< "SELECT 1 FORMAT Native" 2>&1 | grep -e '< Content-Type' -e '< X-ClickHouse-Format' -e '< X-ClickHouse-Timezone' | sed "s|$CLICKHOUSE_TIMEZONE_ESCAPED|CLICKHOUSE_TIMEZONE|" | sed 's/\r$//' | sort;
|
||||||
${CLICKHOUSE_CURL} -vsS "${CLICKHOUSE_URL}" --data-binary @- <<< "SELECT 1 FORMAT RowBinary" 2>&1 | grep -e '< Content-Type' -e '< X-ClickHouse-Format' -e '< X-ClickHouse-Timezone' | sed "s|$CLICKHOUSE_TIMEZONE_ESCAPED|CLICKHOUSE_TIMEZONE|" | sed 's/\r$//' | sort;
|
${CLICKHOUSE_CURL} -vsS "${CLICKHOUSE_URL}" --data-binary @- <<< "SELECT 1 FORMAT RowBinary" 2>&1 | grep -e '< Content-Type' -e '< X-ClickHouse-Format' -e '< X-ClickHouse-Timezone' | sed "s|$CLICKHOUSE_TIMEZONE_ESCAPED|CLICKHOUSE_TIMEZONE|" | sed 's/\r$//' | sort;
|
||||||
|
|
||||||
|
${CLICKHOUSE_CURL} -vsS "${CLICKHOUSE_URL}" --data-binary @- <<< "SELECT timezone() SETTINGS session_timezone='Europe/Berlin'" 2>&1 | grep '< X-ClickHouse-Timezone' | grep -v 'GET' | tr -d '\r';
|
||||||
|
${CLICKHOUSE_CURL} -vsS "${CLICKHOUSE_URL}" --data-binary @- <<< "SELECT timezone() SETTINGS session_timezone='Africa/Cairo'" 2>&1 | grep '< X-ClickHouse-Timezone' | grep -v 'GET' | tr -d '\r';
|
||||||
|
|
||||||
|
# Not pretty but working way of removing randomized session_timezone for this part of test
|
||||||
|
CLICKHOUSE_URL_WO_SESSION_TZ=$(echo "${CLICKHOUSE_URL}" |sed 's/\&session_timezone\=[A-Za-z0-9\/\%\_\-\+\-]*//g' | sed 's/\?session_timezone\=[A-Za-z0-9\/\%\_\-\+\-]*\&/\?/g');
|
||||||
|
|
||||||
|
${CLICKHOUSE_CURL} -vsS "${CLICKHOUSE_URL_WO_SESSION_TZ}&session_timezone=Europe/Berlin&query=SELECT+timezone()" 2>&1 | grep '< X-ClickHouse-Timezone' | grep -v 'GET' | tr -d '\r';
|
||||||
|
${CLICKHOUSE_CURL} -vsS "${CLICKHOUSE_URL_WO_SESSION_TZ}&session_timezone=America/Denver&query=SELECT+timezone()" 2>&1 | grep '< X-ClickHouse-Timezone' | grep -v 'GET' | tr -d '\r';
|
||||||
|
# check that proper X-ClickHouse-Timezone returned on query fail
|
||||||
|
${CLICKHOUSE_CURL} -vsS "${CLICKHOUSE_URL_WO_SESSION_TZ}&session_timezone=UTC&query=SELECT+intDiv(1,+(3600-timeZoneOffset('2024-05-06+12:00:00'::DateTime)))+SETTINGS+session_timezone+=+'Europe/Lisbon'" 2>&1 | grep '< X-ClickHouse-Timezone' | grep -v 'GET' | tr -d '\r';
|
||||||
|
# main query's session_timezone shall be set in header
|
||||||
|
${CLICKHOUSE_CURL} -vsS "${CLICKHOUSE_URL_WO_SESSION_TZ}&session_timezone=America/New_York&query=SELECT+1,(SELECT+1+SETTINGS+session_timezone='UTC')+SETTINGS+session_timezone='Europe/Lisbon'" 2>&1 | grep '< X-ClickHouse-Timezone' | grep -v 'GET' | tr -d '\r';
|
||||||
|
@ -2,6 +2,7 @@ Pacific/Pitcairn Pacific/Pitcairn
|
|||||||
Asia/Novosibirsk Asia/Novosibirsk
|
Asia/Novosibirsk Asia/Novosibirsk
|
||||||
2022-12-12 17:23:23
|
2022-12-12 17:23:23
|
||||||
2022-12-13 07:23:23.123
|
2022-12-13 07:23:23.123
|
||||||
|
2022-12-13 07:23:23 2022-12-13 07:23:23
|
||||||
2002-12-12 23:23:23 2002-12-12 23:23:23
|
2002-12-12 23:23:23 2002-12-12 23:23:23
|
||||||
2002-12-12 23:23:23.123 2002-12-12 23:23:23.123
|
2002-12-12 23:23:23.123 2002-12-12 23:23:23.123
|
||||||
2000-01-01 01:00:00
|
2000-01-01 01:00:00
|
@ -9,6 +9,9 @@ SELECT timezone(), timezoneOf(now());
|
|||||||
SELECT toDateTime(toDateTime('2022-12-12 23:23:23'), 'Europe/Zurich');
|
SELECT toDateTime(toDateTime('2022-12-12 23:23:23'), 'Europe/Zurich');
|
||||||
SELECT toDateTime64(toDateTime64('2022-12-12 23:23:23.123', 3), 3, 'Europe/Zurich') SETTINGS session_timezone = 'America/Denver';
|
SELECT toDateTime64(toDateTime64('2022-12-12 23:23:23.123', 3), 3, 'Europe/Zurich') SETTINGS session_timezone = 'America/Denver';
|
||||||
|
|
||||||
|
-- subquery shall use main query's session_timezone
|
||||||
|
SELECT toDateTime(toDateTime('2022-12-12 23:23:23'), 'Europe/Zurich'), (SELECT toDateTime(toDateTime('2022-12-12 23:23:23'), 'Europe/Zurich') SETTINGS session_timezone = 'Europe/Helsinki') SETTINGS session_timezone = 'America/Denver';
|
||||||
|
|
||||||
-- test proper serialization
|
-- test proper serialization
|
||||||
SELECT toDateTime('2002-12-12 23:23:23') AS dt, toString(dt) SETTINGS session_timezone = 'Asia/Phnom_Penh';
|
SELECT toDateTime('2002-12-12 23:23:23') AS dt, toString(dt) SETTINGS session_timezone = 'Asia/Phnom_Penh';
|
||||||
SELECT toDateTime64('2002-12-12 23:23:23.123', 3) AS dt64, toString(dt64) SETTINGS session_timezone = 'Asia/Phnom_Penh';
|
SELECT toDateTime64('2002-12-12 23:23:23.123', 3) AS dt64, toString(dt64) SETTINGS session_timezone = 'Asia/Phnom_Penh';
|
Loading…
Reference in New Issue
Block a user