Style fix for error message

This commit is contained in:
BoloniniD 2021-07-17 15:30:03 +03:00
parent f0113a79d9
commit 19b673fb3b
3 changed files with 3 additions and 3 deletions

View File

@ -520,7 +520,7 @@ Pipe StorageFile::read(
else else
{ {
// else if fd is not a regular file, then throw an Exception // else if fd is not a regular file, then throw an Exception
throw Exception("Cannot read from a pipeline twice", ErrorCodes::CANNOT_READ_FROM_FILE_DESCRIPTOR); throw Exception("Cannot read from a pipe twice", ErrorCodes::CANNOT_READ_FROM_FILE_DESCRIPTOR);
} }
} }
pipes.emplace_back(std::make_shared<StorageFileSource>( pipes.emplace_back(std::make_shared<StorageFileSource>(

View File

@ -24,4 +24,4 @@ Attempt to read twice from a regular file
6,"AAA" 6,"AAA"
****************** ******************
Attempt to read twice from a pipe Attempt to read twice from a pipe
OK: stderr contains a message 'Cannot read from a pipeline twice' OK: stderr contains a message 'Cannot read from a pipe twice'

View File

@ -17,7 +17,7 @@ ${CLICKHOUSE_LOCAL} --structure 'key String' -q 'select * from table; select * f
echo '******************' echo '******************'
echo 'Attempt to read twice from a pipe' echo 'Attempt to read twice from a pipe'
echo 1 | ${CLICKHOUSE_LOCAL} --structure "a int" --query "select a from table where a in (select a from table)" 2>"$STD_ERROR_CAPTURED" echo 1 | ${CLICKHOUSE_LOCAL} --structure "a int" --query "select a from table where a in (select a from table)" 2>"$STD_ERROR_CAPTURED"
expected_error_message='Cannot read from a pipeline twice' expected_error_message='Cannot read from a pipe twice'
cat "$STD_ERROR_CAPTURED" | grep -q "$expected_error_message" && echo "OK: stderr contains a message '$expected_error_message'" || echo "FAILED: Error message is wrong" cat "$STD_ERROR_CAPTURED" | grep -q "$expected_error_message" && echo "OK: stderr contains a message '$expected_error_message'" || echo "FAILED: Error message is wrong"
rm "$SAMPLE_FILE" "$STD_ERROR_CAPTURED" rm "$SAMPLE_FILE" "$STD_ERROR_CAPTURED"