ClickHouse/src
Val Doroshchuk 3cea474ccf MaterializedMySQL: Fix the infinite loop in ReadBuffer::read
This fixes https://github.com/ClickHouse/ClickHouse/issues/33549

The infinite loop caused because sometimes the pos of ReadBuffer overflows the end.

It happens f.e. when `MySQLPacketPayloadReadBuffer::nextImpl` might return empty buffer,
because `in.nextIfAtEnd();` could not read more bytes and thus no bytes available (pos == end).
It might happen when a network error or the connection to MySQL was closed or killed.
This leads to empty `working_buffer` but successful returning from the func.
And check `if (in.eof())` from `MySQLBinlogEventReadBuffer::nextImpl()` fails and also causes empty its `working_buffer` and successul return.

At the end `payload.ignore(1)` and `payload.read(c)` produces the infinite loop since it is not eof() and ++pos overflows the end of the buffer.

Should be tested by `test_mysql_kill*` from test.py
2023-08-04 11:34:31 +02:00
..
Access Remove creation of a unnecessary temporary ContextAccess on login. 2023-08-03 13:44:59 +02:00
AggregateFunctions Convert hashSets in parallel before merge (#50748) 2023-07-27 15:06:34 +02:00
Analyzer fix ci for #52091 2023-08-01 16:44:13 +02:00
Backups Fix tests. 2023-08-03 13:52:35 +02:00
Bridge Decrease default settings for http headers name and value to 128K 2023-06-21 12:59:27 +02:00
BridgeHelper add missing finalize calls in buffers 2023-06-27 16:54:14 +02:00
Client Implemented max sessions for user 2023-07-30 22:09:03 +00:00
Columns Merge pull request #52761 from copperybean/fix-sort 2023-08-01 15:28:41 +02:00
Common Merge pull request #42019 from ClickHouse/more-checks-in-thread-status 2023-08-04 05:56:28 +02:00
Compression Merge branch 'master' into check-for-hiding-cyrillic-characters 2023-07-30 02:16:56 +02:00
Coordination Merge pull request #52687 from alkorgun/fix-named-collections-on-cluster-23.7 2023-08-03 14:50:28 +02:00
Core Merge branch 'master' into change-protocol-version 2023-08-02 15:44:08 +03:00
Daemon System logs improvements 2023-07-28 07:23:34 +00:00
Databases Merge pull request #52962 from canhld94/fix_mysql_password_leak 2023-08-04 10:57:59 +02:00
DataTypes Merge branch 'master' of github.com:ClickHouse/ClickHouse into database-filesystem-remove-catch 2023-08-01 07:30:57 +02:00
Dictionaries Merge branch 'master' into master 2023-07-30 12:20:54 +08:00
Disks Merge branch 'master' into revert-revert-drop-cache 2023-08-01 23:19:38 +02:00
Formats Merge branch 'master' into change-protocol-version 2023-08-02 15:44:08 +03:00
Functions Merge branch 'master' into array_intersect_order 2023-08-02 15:27:38 +02:00
Interpreters Merge branch 'master' into disable-fs-cache-for-backups 2023-08-04 01:15:23 +02:00
IO MaterializedMySQL: Fix the infinite loop in ReadBuffer::read 2023-08-04 11:34:31 +02:00
Loggers System logs improvements 2023-07-28 07:23:34 +00:00
Parsers Merge pull request #52687 from alkorgun/fix-named-collections-on-cluster-23.7 2023-08-03 14:50:28 +02:00
Planner Introduce IStorage::supportsTrivialCountOptimization() 2023-07-24 05:50:44 +02:00
Processors Merge branch 'master' into more-checks-in-thread-status 2023-08-03 14:34:31 +02:00
QueryPipeline Merge branch 'master' into Avogar-patch-2 2023-07-26 13:18:27 +02:00
Server Update src/Server/KeeperTCPHandler.cpp 2023-08-01 09:04:55 +02:00
Storages Merge branch 'master' into disable-fs-cache-for-backups 2023-08-04 01:15:23 +02:00
TableFunctions Merge pull request #51141 from ClickHouse/azure_blob_storage_sas_token 2023-08-01 12:27:17 +02:00
CMakeLists.txt Merge remote-tracking branch 'upstream/master' into s3queue 2023-07-31 15:32:56 +02:00
configure_config.cmake Attempt to fix LTO 2023-07-24 00:03:40 +02:00
NOTICE