From 289b9fda999598699ab6c1e4dfa07ff9057064e4 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 17 Jun 2019 01:05:43 +0300 Subject: [PATCH] Updated tests --- .../0_stateless/00954_client_prepared_statements.reference | 2 +- .../00955_complex_prepared_statements.reference | 2 +- .../0_stateless/00955_complex_prepared_statements.sh | 7 ++----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/dbms/tests/queries/0_stateless/00954_client_prepared_statements.reference b/dbms/tests/queries/0_stateless/00954_client_prepared_statements.reference index 2dbd21b2eab..f25c522a3c5 100644 --- a/dbms/tests/queries/0_stateless/00954_client_prepared_statements.reference +++ b/dbms/tests/queries/0_stateless/00954_client_prepared_statements.reference @@ -2,7 +2,7 @@ 1 Hello, world 2005-05-05 05:05:05 2 test 2005-05-25 15:00:00 2 test 2005-05-25 15:00:00 -Code: 36. +Code: 456. abc abc Hello, world diff --git a/dbms/tests/queries/0_stateless/00955_complex_prepared_statements.reference b/dbms/tests/queries/0_stateless/00955_complex_prepared_statements.reference index 818e30f1273..701cc5f8781 100644 --- a/dbms/tests/queries/0_stateless/00955_complex_prepared_statements.reference +++ b/dbms/tests/queries/0_stateless/00955_complex_prepared_statements.reference @@ -3,4 +3,4 @@ [10,10,10] [[10],[10],[10]] [10,10,10] [[10],[10],[10]] (10,'Test') (10,('dt',10)) 2015-02-15 -OK +Code: 457. diff --git a/dbms/tests/queries/0_stateless/00955_complex_prepared_statements.sh b/dbms/tests/queries/0_stateless/00955_complex_prepared_statements.sh index a0e3d5aee54..fd30921b1ac 100755 --- a/dbms/tests/queries/0_stateless/00955_complex_prepared_statements.sh +++ b/dbms/tests/queries/0_stateless/00955_complex_prepared_statements.sh @@ -3,9 +3,7 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) . $CURDIR/../shell_config.sh -EXCEPTION_TEXT="Code: 456." -EXCEPTION_SUCCESS_TEXT="OK" -EXCEPTION_FAIL_TEXT="FAIL" +EXCEPTION_TEXT="Code: 457." $CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS ps"; $CLICKHOUSE_CLIENT -q "CREATE TABLE ps ( @@ -37,7 +35,6 @@ $CLICKHOUSE_CLIENT --max_threads=1 --param_nd="2015-02-15" \ # Must throw an exception to avoid SQL injection $CLICKHOUSE_CLIENT --max_threads=1 --param_injection="[1] OR 1" \ -q "SELECT * FROM ps WHERE a = {injection:Array(UInt32)}" 2>&1 \ - | grep -q "$EXCEPTION_TEXT" && echo "$EXCEPTION_SUCCESS_TEXT" \ - || echo "$EXCEPTION_FAIL_TEXT"; + | grep -o "$EXCEPTION_TEXT" $CLICKHOUSE_CLIENT -q "DROP TABLE ps";