Revert "Add stronger exception guarantees to bool serialization"

This reverts commit 62d06a0a4cd39344b41b90300b772299f9719924.
This commit is contained in:
Salvatore Mesoraca 2023-09-28 15:42:33 +02:00
parent f417de4820
commit 36da379b93
No known key found for this signature in database
GPG Key ID: 0567E50A25403074

View File

@ -166,13 +166,13 @@ void deserializeImpl(
buf.rollbackToCheckpoint();
if (checkString(settings.bool_false_representation, buf) && check_end_of_value(buf))
{
col->insert(false);
buf.dropCheckpoint();
if (buf.hasUnreadData())
throw Exception(
ErrorCodes::CANNOT_PARSE_BOOL,
"Cannot continue parsing after parsed bool value because it will result in the loss of some data. It may happen if "
"bool_true_representation or bool_false_representation contains some delimiters of input format");
col->insert(false);
return;
}
@ -181,19 +181,15 @@ void deserializeImpl(
{
buf.dropCheckpoint();
if (buf.hasUnreadData())
{
col->popBack(1);
throw Exception(
ErrorCodes::CANNOT_PARSE_BOOL,
"Cannot continue parsing after parsed bool value because it will result in the loss of some data. It may happen if "
"bool_true_representation or bool_false_representation contains some delimiters of input format");
}
return;
}
buf.makeContinuousMemoryFromCheckpointToPos();
buf.rollbackToCheckpoint();
col->popBack(1);
throw Exception(
ErrorCodes::CANNOT_PARSE_BOOL,
"Cannot parse boolean value here: '{}', should be '{}' or '{}' controlled by setting bool_true_representation and "