From 0041fdf497b2c7780fe5bcb3eabe54b71ded40fa Mon Sep 17 00:00:00 2001 From: Nikita Taranov Date: Sun, 1 Dec 2024 18:50:55 +0100 Subject: [PATCH] impl --- src/Interpreters/executeQuery.cpp | 2 +- ...l_format_matching_case_insensitive.reference | 1 + ...276_null_format_matching_case_insensitive.sh | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 tests/queries/0_stateless/03276_null_format_matching_case_insensitive.reference create mode 100755 tests/queries/0_stateless/03276_null_format_matching_case_insensitive.sh diff --git a/src/Interpreters/executeQuery.cpp b/src/Interpreters/executeQuery.cpp index a94eca3d7b1..29280c91f1a 100644 --- a/src/Interpreters/executeQuery.cpp +++ b/src/Interpreters/executeQuery.cpp @@ -1538,7 +1538,7 @@ std::pair executeQuery( ? getIdentifierName(ast_query_with_output->format) : context->getDefaultFormat(); - if (format_name == "Null") + if (boost::iequals(format_name, "Null")) res.null_format = true; } diff --git a/tests/queries/0_stateless/03276_null_format_matching_case_insensitive.reference b/tests/queries/0_stateless/03276_null_format_matching_case_insensitive.reference new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/tests/queries/0_stateless/03276_null_format_matching_case_insensitive.reference @@ -0,0 +1 @@ +1 diff --git a/tests/queries/0_stateless/03276_null_format_matching_case_insensitive.sh b/tests/queries/0_stateless/03276_null_format_matching_case_insensitive.sh new file mode 100755 index 00000000000..d1736d58832 --- /dev/null +++ b/tests/queries/0_stateless/03276_null_format_matching_case_insensitive.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +set -e + +CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +# shellcheck source=../shell_config.sh +. "$CUR_DIR"/../shell_config.sh + +query_id="03276_null_format_matching_case_insensitive_$RANDOM$RANDOM" +$CLICKHOUSE_CLIENT --query_id "$query_id" -q "select * from numbers_mt(1e8) format null" + +$CLICKHOUSE_CLIENT -q " + SYSTEM FLUSH LOGS; + + -- SendBytes should be close to 0, previously for this query it was around 800MB + select ProfileEvents['NetworkSendBytes'] < 1e6 from system.query_log where current_database = currentDatabase() and event_date >= yesterday() and query_id = '$query_id' and type = 'QueryFinish'; +"