Merge pull request #55297 from ClickHouse/kssenii-patch-6

MaterializedPostgreSQL: remove back check
This commit is contained in:
Kseniia Sumarokova 2023-10-08 10:31:23 +02:00 committed by GitHub
commit 0af252ae31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -246,14 +246,6 @@ void MaterializedPostgreSQLConsumer::readTupleData(
case 't': /// Text formatted value
{
Int32 col_len = readInt32(message, pos, size);
/// Sanity check for protocol misuse.
/// PostgreSQL uses a fixed page size (commonly 8 kB), and does not allow tuples to span multiple pages.
static constexpr Int32 sanity_check_max_col_len = 1024 * 8 * 2; /// *2 -- just in case.
if (unlikely(col_len > sanity_check_max_col_len))
throw Exception(ErrorCodes::POSTGRESQL_REPLICATION_INTERNAL_ERROR,
"Column length is suspiciously long: {}", col_len);
String value;
for (Int32 i = 0; i < col_len; ++i)
value += readInt8(message, pos, size);