mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-29 19:12:03 +00:00
Add test case for base64Encode returning corrupted data
Sometimes, base64Encode returns data that belongs to the next string in the buffer. This test, when failing, shows something like that: -SELECT * FROM tabl_1 SETTINGS log_comment = ?; -SELECT * FROM tabl_2 SETTINGS log_comment = ?; +SELECT * FROM tabl_1 SETTINGS log_comment = ?;\0S +SELECT * FROM tabl_2 SETTINGS log_comment = ?;\0c Where the S at the end of the first string is the first S of the next string in the buffer. I don't know exactly why, but reading from query_log is how I manage to reliably trigger the bug. The same code on literals, or even on a different table, did not trigger the bug, something related to alignment maybe.
This commit is contained in:
parent
fab8da1c64
commit
f05aaa4651
@ -0,0 +1,2 @@
|
||||
SELECT * FROM tabl_1 SETTINGS log_comment = ?;
|
||||
SELECT * FROM tabl_2 SETTINGS log_comment = ?;
|
@ -0,0 +1,13 @@
|
||||
SET log_queries=1;
|
||||
|
||||
CREATE TABLE tabl_1 (key String) ENGINE MergeTree ORDER BY key;
|
||||
CREATE TABLE tabl_2 (key String) ENGINE MergeTree ORDER BY key;
|
||||
SELECT * FROM tabl_1 SETTINGS log_comment = 'ad15a651';
|
||||
SELECT * FROM tabl_2 SETTINGS log_comment = 'ad15a651';
|
||||
SYSTEM FLUSH LOGS;
|
||||
|
||||
SELECT base64Decode(base64Encode(normalizeQuery(query)))
|
||||
FROM system.query_log
|
||||
WHERE type='QueryFinish' AND log_comment = 'ad15a651'
|
||||
GROUP BY normalizeQuery(query)
|
||||
ORDER BY normalizeQuery(query);
|
Loading…
Reference in New Issue
Block a user