From 3357baa209fe4a450f15e3b6a595f8e361615ddc Mon Sep 17 00:00:00 2001 From: Nikolai Kochetov Date: Mon, 10 Jul 2017 20:30:18 +0300 Subject: [PATCH] added changing settings in readonly mode test [#CLICKHOUSE-3041] --- .../0_stateless/00474_readonly_settings.reference | 14 ++++++++++++++ .../queries/0_stateless/00474_readonly_settings.sh | 13 +++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 dbms/tests/queries/0_stateless/00474_readonly_settings.reference create mode 100755 dbms/tests/queries/0_stateless/00474_readonly_settings.sh diff --git a/dbms/tests/queries/0_stateless/00474_readonly_settings.reference b/dbms/tests/queries/0_stateless/00474_readonly_settings.reference new file mode 100644 index 00000000000..672b858d944 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00474_readonly_settings.reference @@ -0,0 +1,14 @@ + "name": "value", + "value": 4611686018427387904 + "name": "value", + "value": "4611686018427387904" +value +value +Cannot execute SET query in readonly mode. + "name": "value", + "value": "9223372036854775808" + "name": "value", + "value": 9223372036854775808 +value +value +Cannot override setting diff --git a/dbms/tests/queries/0_stateless/00474_readonly_settings.sh b/dbms/tests/queries/0_stateless/00474_readonly_settings.sh new file mode 100755 index 00000000000..f90592a6875 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00474_readonly_settings.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +clickhouse-client --query="select toUInt64(pow(2, 62)) as value format JSON" --output_format_json_quote_64bit_integers=0 | grep value +clickhouse-client --query="select toUInt64(pow(2, 62)) as value format JSON" --output_format_json_quote_64bit_integers=1 | grep value + +clickhouse-client --user readonly --multiquery --query="set output_format_json_quote_64bit_integers=1 ; select toUInt64(pow(2, 63)) as value format JSON" 2>&1 | grep -o 'value\|Cannot execute SET query in readonly mode.' +clickhouse-client --user readonly --multiquery --query="set output_format_json_quote_64bit_integers=0 ; select toUInt64(pow(2, 63)) as value format JSON" 2>&1 | grep -o 'value\|Cannot execute SET query in readonly mode.' + +curl -sS 'http://localhost:8123/?query=SELECT+toUInt64(pow(2,+63))+as+value+format+JSON&output_format_json_quote_64bit_integers=1' | grep value +curl -sS 'http://localhost:8123/?query=SELECT+toUInt64(pow(2,+63))+as+value+format+JSON&output_format_json_quote_64bit_integers=0' | grep value + +curl -sS 'http://localhost:8123/?user=readonly&query=SELECT+toUInt64(pow(2,+63))+as+value+format+JSON&output_format_json_quote_64bit_integers=1' 2>&1 | grep -o 'value\|Cannot override setting' +curl -sS 'http://localhost:8123/?user=readonly&query=SELECT+toUInt64(pow(2,+63))+as+value+format+JSON&output_format_json_quote_64bit_integers=0' 2>&1 | grep -o 'value\|Cannot override setting'