diff --git a/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments.lib b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments.lib new file mode 100755 index 0000000000..531b54a64c --- /dev/null +++ b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments.lib @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. $CURDIR/../shell_config.sh + +function test_variant { + perl -E "say \$_ for map {chomp; (qq{$1})} qx{$CLICKHOUSE_CLIENT -q 'SELECT name FROM system.functions ORDER BY name;'}" | $CLICKHOUSE_CLIENT -n --ignore-error >/dev/null 2>&1 + $CLICKHOUSE_CLIENT -q "SELECT 'Still alive'" +} diff --git a/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments.sh b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments.sh deleted file mode 100755 index ae8a443c1e..0000000000 --- a/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) -. $CURDIR/../shell_config.sh - -# Server should not crash on any function trash calls - -# todo: maybe add more strange usages -perl -E "say \$_ for map {chomp; (qq{SELECT \$_;}, qq{SELECT \$_();}, qq{SELECT \$_(NULL);}, qq{SELECT \$_([]);}, qq{SELECT \$_([NULL]);}, qq{SELECT \$_(-1);}, qq{SELECT \$_('');},)} qx{$CLICKHOUSE_CLIENT -q 'SELECT name FROM system.functions ORDER BY name;'}" | $CLICKHOUSE_CLIENT -n --ignore-error >/dev/null 2>&1 - -$CLICKHOUSE_CLIENT -q "SELECT 'Still alive'" diff --git a/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments.reference b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments1.reference similarity index 100% rename from dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments.reference rename to dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments1.reference diff --git a/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments1.sh b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments1.sh new file mode 100755 index 0000000000..74dde0326d --- /dev/null +++ b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments1.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. $CURDIR/../shell_config.sh + +. $CURDIR/00534_long_functions_bad_arguments.lib + +test_variant 'SELECT $_;' + +# todo: maybe add more strange usages diff --git a/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments2.reference b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments2.reference new file mode 100644 index 0000000000..7193c3d3f3 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments2.reference @@ -0,0 +1 @@ +Still alive diff --git a/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments2.sh b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments2.sh new file mode 100755 index 0000000000..fb15671dc5 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments2.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. $CURDIR/../shell_config.sh + +. $CURDIR/00534_long_functions_bad_arguments.lib + +test_variant 'SELECT $_();' diff --git a/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments3.reference b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments3.reference new file mode 100644 index 0000000000..7193c3d3f3 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments3.reference @@ -0,0 +1 @@ +Still alive diff --git a/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments3.sh b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments3.sh new file mode 100755 index 0000000000..50235c0461 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments3.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. $CURDIR/../shell_config.sh + +. $CURDIR/00534_long_functions_bad_arguments.lib + +test_variant 'SELECT $_(NULL);' diff --git a/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments4.reference b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments4.reference new file mode 100644 index 0000000000..7193c3d3f3 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments4.reference @@ -0,0 +1 @@ +Still alive diff --git a/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments4.sh b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments4.sh new file mode 100755 index 0000000000..8afcbf1f37 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments4.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. $CURDIR/../shell_config.sh + +. $CURDIR/00534_long_functions_bad_arguments.lib + +test_variant 'SELECT $_([]);' diff --git a/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments5.reference b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments5.reference new file mode 100644 index 0000000000..7193c3d3f3 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments5.reference @@ -0,0 +1 @@ +Still alive diff --git a/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments5.sh b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments5.sh new file mode 100755 index 0000000000..55df49e7da --- /dev/null +++ b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments5.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. $CURDIR/../shell_config.sh + +. $CURDIR/00534_long_functions_bad_arguments.lib + +test_variant 'SELECT $_([NULL]);' diff --git a/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments6.reference b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments6.reference new file mode 100644 index 0000000000..7193c3d3f3 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments6.reference @@ -0,0 +1 @@ +Still alive diff --git a/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments6.sh b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments6.sh new file mode 100755 index 0000000000..084a320d41 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments6.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. $CURDIR/../shell_config.sh + +. $CURDIR/00534_long_functions_bad_arguments.lib + +test_variant 'SELECT $_(-1);' diff --git a/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments7.reference b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments7.reference new file mode 100644 index 0000000000..7193c3d3f3 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments7.reference @@ -0,0 +1 @@ +Still alive diff --git a/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments7.sh b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments7.sh new file mode 100755 index 0000000000..78b9afafe5 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00534_long_functions_bad_arguments7.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. $CURDIR/../shell_config.sh + +. $CURDIR/00534_long_functions_bad_arguments.lib + +test_variant 'SELECT $_('');' diff --git a/debian/control b/debian/control index ef7f758847..df43f4538e 100644 --- a/debian/control +++ b/debian/control @@ -49,7 +49,7 @@ Description: debugging symbols for clickhouse-server-base This package contains the debugging symbols for clickhouse-server-base. Package: clickhouse-test -#Priority: extra +Priority: extra Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, clickhouse-client, bash, expect, python, python-lxml, python-termcolor, curl, perl, sudo Description: Clickhouse tests