From 6d4d2976b7fbc11c35aaf6a7ae6c5245487ffeb7 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sat, 1 Aug 2020 03:59:00 +0300 Subject: [PATCH] fgrep -> grep -F --- ...uted_optimize_skip_select_on_unused_shards.sh | 16 ++++++++-------- ...skip_select_on_unused_shards_with_prewhere.sh | 16 ++++++++-------- .../01013_sync_replica_timeout_zookeeper.sh | 2 +- ..._with_nondeterministic_functions_zookeeper.sh | 8 ++++---- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/tests/queries/0_stateless/00754_distributed_optimize_skip_select_on_unused_shards.sh b/tests/queries/0_stateless/00754_distributed_optimize_skip_select_on_unused_shards.sh index 4e7a5757e5c..aeacd21a0bc 100755 --- a/tests/queries/0_stateless/00754_distributed_optimize_skip_select_on_unused_shards.sh +++ b/tests/queries/0_stateless/00754_distributed_optimize_skip_select_on_unused_shards.sh @@ -16,11 +16,11 @@ ${CLICKHOUSE_CLIENT} --query "INSERT INTO mergetree_00754 VALUES (1, 1, 1);" # Should fail because second shard is unavailable ${CLICKHOUSE_CLIENT} --query "SELECT count(*) FROM distributed;" 2>&1 \ -| fgrep -q "All connection tries failed" && echo 'OK' || echo 'FAIL' +| grep -F -q "All connection tries failed" && echo 'OK' || echo 'FAIL' # Should fail without setting `optimize_skip_unused_shards` ${CLICKHOUSE_CLIENT} --query "SELECT count(*) FROM distributed WHERE a = 0 AND b = 0;" 2>&1 \ -| fgrep -q "All connection tries failed" && echo 'OK' || echo 'FAIL' +| grep -F -q "All connection tries failed" && echo 'OK' || echo 'FAIL' # Should pass now ${CLICKHOUSE_CLIENT} -n --query=" @@ -32,7 +32,7 @@ ${CLICKHOUSE_CLIENT} -n --query=" ${CLICKHOUSE_CLIENT} -n --query=" SET optimize_skip_unused_shards = 1; SELECT count(*) FROM distributed WHERE a = 2 AND b = 2; -" 2>&1 \ | fgrep -q "All connection tries failed" && echo 'OK' || echo 'FAIL' +" 2>&1 \ | grep -F -q "All connection tries failed" && echo 'OK' || echo 'FAIL' # Try more complext expressions for constant folding - all should pass. @@ -82,24 +82,24 @@ ${CLICKHOUSE_CLIENT} -n --query=" ${CLICKHOUSE_CLIENT} -n --query=" SET optimize_skip_unused_shards = 1; SELECT count(*) FROM distributed WHERE a = 0 AND b <= 1; -" 2>&1 \ | fgrep -q "All connection tries failed" && echo 'OK' || echo 'FAIL' +" 2>&1 \ | grep -F -q "All connection tries failed" && echo 'OK' || echo 'FAIL' ${CLICKHOUSE_CLIENT} -n --query=" SET optimize_skip_unused_shards = 1; SELECT count(*) FROM distributed WHERE a = 0 AND c = 0; -" 2>&1 \ | fgrep -q "All connection tries failed" && echo 'OK' || echo 'FAIL' +" 2>&1 \ | grep -F -q "All connection tries failed" && echo 'OK' || echo 'FAIL' ${CLICKHOUSE_CLIENT} -n --query=" SET optimize_skip_unused_shards = 1; SELECT count(*) FROM distributed WHERE a = 0 OR a = 1 AND b = 0; -" 2>&1 \ | fgrep -q "All connection tries failed" && echo 'OK' || echo 'FAIL' +" 2>&1 \ | grep -F -q "All connection tries failed" && echo 'OK' || echo 'FAIL' ${CLICKHOUSE_CLIENT} -n --query=" SET optimize_skip_unused_shards = 1; SELECT count(*) FROM distributed WHERE a = 0 AND b = 0 OR a = 2 AND b = 2; -" 2>&1 \ | fgrep -q "All connection tries failed" && echo 'OK' || echo 'FAIL' +" 2>&1 \ | grep -F -q "All connection tries failed" && echo 'OK' || echo 'FAIL' ${CLICKHOUSE_CLIENT} -n --query=" SET optimize_skip_unused_shards = 1; SELECT count(*) FROM distributed WHERE a = 0 AND b = 0 OR c = 0; -" 2>&1 \ | fgrep -q "All connection tries failed" && echo 'OK' || echo 'FAIL' +" 2>&1 \ | grep -F -q "All connection tries failed" && echo 'OK' || echo 'FAIL' diff --git a/tests/queries/0_stateless/00754_distributed_optimize_skip_select_on_unused_shards_with_prewhere.sh b/tests/queries/0_stateless/00754_distributed_optimize_skip_select_on_unused_shards_with_prewhere.sh index c8056f4ce17..0793adb53a7 100755 --- a/tests/queries/0_stateless/00754_distributed_optimize_skip_select_on_unused_shards_with_prewhere.sh +++ b/tests/queries/0_stateless/00754_distributed_optimize_skip_select_on_unused_shards_with_prewhere.sh @@ -21,11 +21,11 @@ ${CLICKHOUSE_CLIENT} --query "INSERT INTO mergetree_00754 VALUES (1, 1, 'World') # Should fail because the second shard is unavailable ${CLICKHOUSE_CLIENT} --query "SELECT count(*) FROM distributed_00754;" 2>&1 \ -| fgrep -q "All connection tries failed" && echo 'OK' || echo 'FAIL' +| grep -F -q "All connection tries failed" && echo 'OK' || echo 'FAIL' # Should fail without setting `optimize_skip_unused_shards` = 1 ${CLICKHOUSE_CLIENT} --query "SELECT count(*) FROM distributed_00754 PREWHERE a = 0 AND b = 0;" 2>&1 \ -| fgrep -q "All connection tries failed" && echo 'OK' || echo 'FAIL' +| grep -F -q "All connection tries failed" && echo 'OK' || echo 'FAIL' # Should pass now ${CLICKHOUSE_CLIENT} -n --query=" @@ -38,7 +38,7 @@ ${CLICKHOUSE_CLIENT} -n --query=" ${CLICKHOUSE_CLIENT} -n --query=" SET optimize_skip_unused_shards = 1; SELECT count(*) FROM distributed_00754 PREWHERE a = 2 AND b = 2; -" 2>&1 \ | fgrep -q "All connection tries failed" && echo 'OK' || echo 'FAIL' +" 2>&1 \ | grep -F -q "All connection tries failed" && echo 'OK' || echo 'FAIL' # Try more complex expressions for constant folding - all should pass. @@ -77,24 +77,24 @@ ${CLICKHOUSE_CLIENT} -n --query=" ${CLICKHOUSE_CLIENT} -n --query=" SET optimize_skip_unused_shards = 1; SELECT count(*) FROM distributed_00754 PREWHERE a = 0 AND b <= 1; -" 2>&1 \ | fgrep -q "All connection tries failed" && echo 'OK' || echo 'FAIL' +" 2>&1 \ | grep -F -q "All connection tries failed" && echo 'OK' || echo 'FAIL' ${CLICKHOUSE_CLIENT} -n --query=" SET optimize_skip_unused_shards = 1; SELECT count(*) FROM distributed_00754 PREWHERE a = 0 WHERE c LIKE '%l%'; -" 2>&1 \ | fgrep -q "All connection tries failed" && echo 'OK' || echo 'FAIL' +" 2>&1 \ | grep -F -q "All connection tries failed" && echo 'OK' || echo 'FAIL' ${CLICKHOUSE_CLIENT} -n --query=" SET optimize_skip_unused_shards = 1; SELECT count(*) FROM distributed_00754 PREWHERE a = 0 OR a = 1 AND b = 0; -" 2>&1 \ | fgrep -q "All connection tries failed" && echo 'OK' || echo 'FAIL' +" 2>&1 \ | grep -F -q "All connection tries failed" && echo 'OK' || echo 'FAIL' ${CLICKHOUSE_CLIENT} -n --query=" SET optimize_skip_unused_shards = 1; SELECT count(*) FROM distributed_00754 PREWHERE a = 0 AND b = 0 OR a = 2 AND b = 2; -" 2>&1 \ | fgrep -q "All connection tries failed" && echo 'OK' || echo 'FAIL' +" 2>&1 \ | grep -F -q "All connection tries failed" && echo 'OK' || echo 'FAIL' ${CLICKHOUSE_CLIENT} -n --query=" SET optimize_skip_unused_shards = 1; SELECT count(*) FROM distributed_00754 PREWHERE a = 0 AND b = 0 OR c LIKE '%l%'; -" 2>&1 \ | fgrep -q "All connection tries failed" && echo 'OK' || echo 'FAIL' +" 2>&1 \ | grep -F -q "All connection tries failed" && echo 'OK' || echo 'FAIL' diff --git a/tests/queries/0_stateless/01013_sync_replica_timeout_zookeeper.sh b/tests/queries/0_stateless/01013_sync_replica_timeout_zookeeper.sh index 6f11e44b2a8..a3eab48ad99 100755 --- a/tests/queries/0_stateless/01013_sync_replica_timeout_zookeeper.sh +++ b/tests/queries/0_stateless/01013_sync_replica_timeout_zookeeper.sh @@ -21,7 +21,7 @@ ${CLICKHOUSE_CLIENT} -n -q " timeout 10s "${CLICKHOUSE_CLIENT}" -n -q " SET receive_timeout=1; SYSTEM SYNC REPLICA $R2 -" 2>&1 | fgrep -q "Code: 159. DB::Exception" && echo 'OK' || echo 'Failed!' +" 2>&1 | grep -F -q "Code: 159. DB::Exception" && echo 'OK' || echo 'Failed!' # By dropping tables all related SYNC REPLICA queries would be terminated as well ${CLICKHOUSE_CLIENT} -n -q " diff --git a/tests/queries/0_stateless/01017_mutations_with_nondeterministic_functions_zookeeper.sh b/tests/queries/0_stateless/01017_mutations_with_nondeterministic_functions_zookeeper.sh index f3338d81c8c..9b0df6a9155 100755 --- a/tests/queries/0_stateless/01017_mutations_with_nondeterministic_functions_zookeeper.sh +++ b/tests/queries/0_stateless/01017_mutations_with_nondeterministic_functions_zookeeper.sh @@ -38,16 +38,16 @@ ${CLICKHOUSE_CLIENT} -n -q " # Check that in mutations of replicated tables predicates do not contain non-deterministic functions ${CLICKHOUSE_CLIENT} --query "ALTER TABLE $R1 DELETE WHERE ignore(rand())" 2>&1 \ -| fgrep -q "must use only deterministic functions" && echo 'OK' || echo 'FAIL' +| grep -F -q "must use only deterministic functions" && echo 'OK' || echo 'FAIL' ${CLICKHOUSE_CLIENT} --query "ALTER TABLE $R1 UPDATE y = y + rand() % 1 WHERE not ignore()" 2>&1 \ -| fgrep -q "must use only deterministic functions" && echo 'OK' || echo 'FAIL' +| grep -F -q "must use only deterministic functions" && echo 'OK' || echo 'FAIL' ${CLICKHOUSE_CLIENT} --query "ALTER TABLE $R1 UPDATE y = x + arrayCount(x -> (x + y) % 2, range(y)) WHERE not ignore()" > /dev/null 2>&1 \ && echo 'OK' || echo 'FAIL' ${CLICKHOUSE_CLIENT} --query "ALTER TABLE $R1 UPDATE y = x + arrayCount(x -> (rand() + x) % 2, range(y)) WHERE not ignore()" 2>&1 \ -| fgrep -q "must use only deterministic functions" && echo 'OK' || echo 'FAIL' +| grep -F -q "must use only deterministic functions" && echo 'OK' || echo 'FAIL' # For regular tables we do not enforce deterministic functions @@ -62,7 +62,7 @@ ${CLICKHOUSE_CLIENT} --query "ALTER TABLE $R1 UPDATE y = joinGet('${CLICKHOUSE_D && echo 'OK' || echo 'FAIL' ${CLICKHOUSE_CLIENT} --query "ALTER TABLE $R1 DELETE WHERE dictHas('${CLICKHOUSE_DATABASE}.dict1', toUInt64(x))" 2>&1 \ -| fgrep -q "must use only deterministic functions" && echo 'OK' || echo 'FAIL' +| grep -F -q "must use only deterministic functions" && echo 'OK' || echo 'FAIL' ${CLICKHOUSE_CLIENT} --query "ALTER TABLE $R1 DELETE WHERE dictHas('${CLICKHOUSE_DATABASE}.dict1', toUInt64(x))" --allow_nondeterministic_mutations=1 2>&1 \ && echo 'OK' || echo 'FAIL'